comparison mm7_5.cpp @ 949:c0d0656aa662

Awards
author Nomad
date Wed, 01 May 2013 20:04:24 +0200
parents 5a2dbb00c399
children e9292c58644a
comparison
equal deleted inserted replaced
948:5a2dbb00c399 949:c0d0656aa662
9379 } 9379 }
9380 9380
9381 //----- (0040DEDB) -------------------------------------------------------- 9381 //----- (0040DEDB) --------------------------------------------------------
9382 unsigned int __stdcall R8G8B8_to_TargetFormat(int uColor) 9382 unsigned int __stdcall R8G8B8_to_TargetFormat(int uColor)
9383 { 9383 {
9384 return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat((unsigned __int8)uColor, BYTE1(uColor), BYTE2(uColor)); 9384 return TargetColor((unsigned __int8)uColor, BYTE1(uColor), BYTE2(uColor));
9385 } 9385 }
9386 9386
9387 //----- (0040DEF3) -------------------------------------------------------- 9387 //----- (0040DEF3) --------------------------------------------------------
9388 unsigned short GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat( unsigned __int16 r, unsigned __int16 g, unsigned __int16 b ) 9388 unsigned short TargetColor( unsigned __int16 r, unsigned __int16 g, unsigned __int16 b )
9389 { 9389 {
9390 return ((unsigned int)b >> (8 - LOBYTE(pRenderer->uTargetBBits))) | pRenderer->uTargetGMask & (g << (LOBYTE(pRenderer->uTargetGBits) + 9390 return ((unsigned int)b >> (8 - LOBYTE(pRenderer->uTargetBBits))) | pRenderer->uTargetGMask & (g << (LOBYTE(pRenderer->uTargetGBits) +
9391 LOBYTE(pRenderer->uTargetBBits) - 8)) | pRenderer->uTargetRMask & (r << (LOBYTE(pRenderer->uTargetGBits) + 9391 LOBYTE(pRenderer->uTargetBBits) - 8)) | pRenderer->uTargetRMask & (r << (LOBYTE(pRenderer->uTargetGBits) +
9392 LOBYTE(pRenderer->uTargetRBits) + LOBYTE(pRenderer->uTargetBBits) - 8)); 9392 LOBYTE(pRenderer->uTargetRBits) + LOBYTE(pRenderer->uTargetBBits) - 8));
9393 } 9393 }
10148 int v7; // [sp+64h] [bp-8h]@1 10148 int v7; // [sp+64h] [bp-8h]@1
10149 int a5; // [sp+68h] [bp-4h]@1 10149 int a5; // [sp+68h] [bp-4h]@1
10150 10150
10151 v0 = pParty->uCurrentHour; 10151 v0 = pParty->uCurrentHour;
10152 v6 = pMapStats->GetMapInfo(pCurrentMapName); 10152 v6 = pMapStats->GetMapInfo(pCurrentMapName);
10153 a5 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x4Bu, 0x4Bu, 0x4Bu); 10153 a5 = TargetColor(0x4Bu, 0x4Bu, 0x4Bu);
10154 pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_13); 10154 pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_13);
10155 v7 = (unsigned __int8)pDayMoonPhase[pParty->uDaysPlayed]; 10155 v7 = (unsigned __int8)pDayMoonPhase[pParty->uDaysPlayed];
10156 if ( (signed int)v0 <= 12 ) 10156 if ( (signed int)v0 <= 12 )
10157 { 10157 {
10158 if ( !v0 ) 10158 if ( !v0 )
10270 } 10270 }
10271 10271
10272 //----- (00414162) -------------------------------------------------------- 10272 //----- (00414162) --------------------------------------------------------
10273 void __cdecl uGameUIFontMain_initialize() 10273 void __cdecl uGameUIFontMain_initialize()
10274 { 10274 {
10275 uGameUIFontMain = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xAu, 0, 0); 10275 uGameUIFontMain = TargetColor(0xAu, 0, 0);
10276 } 10276 }
10277 10277
10278 //----- (00414174) -------------------------------------------------------- 10278 //----- (00414174) --------------------------------------------------------
10279 void __cdecl uGameUIFontShadow_initialize() 10279 void __cdecl uGameUIFontShadow_initialize()
10280 { 10280 {
10281 uGameUIFontShadow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE6u, 214u, 193u); 10281 uGameUIFontShadow = TargetColor(0xE6u, 214u, 193u);
10282 } 10282 }
10283 10283
10284 10284
10285 10285
10286 10286
11228 { 11228 {
11229 v12 = v6->pName; 11229 v12 = v6->pName;
11230 v11 = pTmpBuf; 11230 v11 = pTmpBuf;
11231 strcpy(pTmpBuf, v12); 11231 strcpy(pTmpBuf, v12);
11232 } 11232 }
11233 v13 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); 11233 v13 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
11234 a1.DrawTitleText(pFontArrus, 0, 0xCu, v13, v11, 3u); 11234 a1.DrawTitleText(pFontArrus, 0, 0xCu, v13, v11, 3u);
11235 a1.uFrameWidth -= 24; 11235 a1.uFrameWidth -= 24;
11236 a1.uFrameZ = a1.uFrameX + a1.uFrameWidth - 1; 11236 a1.uFrameZ = a1.uFrameX + a1.uFrameWidth - 1;
11237 v14 = BuilDialogueString((char *)lpsz, uActiveCharacter - 1, 0, 0, 0, 0); 11237 v14 = BuilDialogueString((char *)lpsz, uActiveCharacter - 1, 0, 0, 0, 0);
11238 a1.DrawText(pFontArrus, 100, 36, 0, v14, 0, 0, 0); 11238 a1.DrawText(pFontArrus, 100, 36, 0, v14, 0, 0, 0);
11449 { 11449 {
11450 v6 = 0; 11450 v6 = 0;
11451 v2 = 255; 11451 v2 = 255;
11452 v3 = 0; 11452 v3 = 0;
11453 } 11453 }
11454 return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v3, v2, v6); 11454 return TargetColor(v3, v2, v6);
11455 } 11455 }
11456 11456
11457 //----- (00417939) -------------------------------------------------------- 11457 //----- (00417939) --------------------------------------------------------
11458 signed int __thiscall GetConditionDrawColor(unsigned int uConditionIdx) 11458 signed int __thiscall GetConditionDrawColor(unsigned int uConditionIdx)
11459 { 11459 {
11463 unsigned int v4; // eax@1 11463 unsigned int v4; // eax@1
11464 unsigned int v6; // [sp+Ch] [bp-4h]@1 11464 unsigned int v6; // [sp+Ch] [bp-4h]@1
11465 11465
11466 v1 = uConditionIdx; 11466 v1 = uConditionIdx;
11467 v2 = 65535; 11467 v2 = 65535;
11468 v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); 11468 v3 = TargetColor(0xE1u, 0xCDu, 0x23u);
11469 v6 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x23u, 0); 11469 v6 = TargetColor(0xFFu, 0x23u, 0);
11470 v4 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0); 11470 v4 = TargetColor(0, 0xFFu, 0);
11471 switch ( v1 ) 11471 switch ( v1 )
11472 { 11472 {
11473 case 0u: 11473 case 0u:
11474 case 1u: 11474 case 1u:
11475 case 3u: 11475 case 3u:
11523 Dst.uFrameWidth -= 24; 11523 Dst.uFrameWidth -= 24;
11524 Dst.uFrameY += 12; 11524 Dst.uFrameY += 12;
11525 Dst.uFrameHeight -= 12; 11525 Dst.uFrameHeight -= 12;
11526 Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1; 11526 Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1;
11527 Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1; 11527 Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1;
11528 v4 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); 11528 v4 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
11529 sprintf(pTmpBuf, format_4E2D80, v4, v3); 11529 sprintf(pTmpBuf, format_4E2D80, v4, v3);
11530 Dst.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf, 3u); 11530 Dst.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf, 3u);
11531 return Dst.DrawText(pFontSmallnum, 1, LOBYTE(pFontLucida->uFontHeight), 0, v2, 0, 0, 0); 11531 return Dst.DrawText(pFontSmallnum, 1, LOBYTE(pFontLucida->uFontHeight), 0, v2, 0, 0, 0);
11532 } 11532 }
11533 11533
11538 int v12; // eax@14 11538 int v12; // eax@14
11539 unsigned int yellow; // [sp+Ch] [bp-Ch]@1 11539 unsigned int yellow; // [sp+Ch] [bp-Ch]@1
11540 unsigned int red; // [sp+10h] [bp-8h]@1 11540 unsigned int red; // [sp+10h] [bp-8h]@1
11541 unsigned int white; // [sp+14h] [bp-4h]@1 11541 unsigned int white; // [sp+14h] [bp-4h]@1
11542 11542
11543 white = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); 11543 white = TargetColor(0xFFu, 0xFFu, 0xFFu);
11544 red = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0); 11544 red = TargetColor(0xFFu, 0, 0);
11545 yellow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0); 11545 yellow = TargetColor(0xFFu, 0xFFu, 0);
11546 if ( !(uPlayerClass % 4) ) 11546 if ( !(uPlayerClass % 4) )
11547 { 11547 {
11548 if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] >= skill_level ) 11548 if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] >= skill_level )
11549 return white; 11549 return white;
11550 if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 1][uPlayerSkillType] < skill_level 11550 if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 1][uPlayerSkillType] < skill_level