diff mm7_5.cpp @ 949:c0d0656aa662

Awards
author Nomad
date Wed, 01 May 2013 20:04:24 +0200
parents 5a2dbb00c399
children e9292c58644a
line wrap: on
line diff
--- a/mm7_5.cpp	Wed May 01 17:31:10 2013 +0200
+++ b/mm7_5.cpp	Wed May 01 20:04:24 2013 +0200
@@ -9381,11 +9381,11 @@
 //----- (0040DEDB) --------------------------------------------------------
 unsigned int __stdcall R8G8B8_to_TargetFormat(int uColor)
 {
-  return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat((unsigned __int8)uColor, BYTE1(uColor), BYTE2(uColor));
+  return TargetColor((unsigned __int8)uColor, BYTE1(uColor), BYTE2(uColor));
 }
 
 //----- (0040DEF3) --------------------------------------------------------
-unsigned short GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat( unsigned __int16 r, unsigned __int16 g, unsigned __int16 b )
+unsigned short TargetColor( unsigned __int16 r, unsigned __int16 g, unsigned __int16 b )
     {
   return ((unsigned int)b >> (8 - LOBYTE(pRenderer->uTargetBBits))) | pRenderer->uTargetGMask & (g << (LOBYTE(pRenderer->uTargetGBits) + 
                            LOBYTE(pRenderer->uTargetBBits) - 8)) | pRenderer->uTargetRMask & (r << (LOBYTE(pRenderer->uTargetGBits) + 
@@ -10150,7 +10150,7 @@
 
   v0 = pParty->uCurrentHour;
   v6 = pMapStats->GetMapInfo(pCurrentMapName);
-  a5 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x4Bu, 0x4Bu, 0x4Bu);
+  a5 = TargetColor(0x4Bu, 0x4Bu, 0x4Bu);
   pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_13);
   v7 = (unsigned __int8)pDayMoonPhase[pParty->uDaysPlayed];
   if ( (signed int)v0 <= 12 )
@@ -10272,13 +10272,13 @@
 //----- (00414162) --------------------------------------------------------
 void __cdecl uGameUIFontMain_initialize()
 {
-  uGameUIFontMain = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xAu, 0, 0);
+  uGameUIFontMain = TargetColor(0xAu, 0, 0);
 }
 
 //----- (00414174) --------------------------------------------------------
 void __cdecl uGameUIFontShadow_initialize()
 {
-  uGameUIFontShadow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE6u, 214u, 193u);
+  uGameUIFontShadow = TargetColor(0xE6u, 214u, 193u);
 }
 
 
@@ -11230,7 +11230,7 @@
           v11 = pTmpBuf;
           strcpy(pTmpBuf, v12);
         }
-        v13 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
+        v13 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
         a1.DrawTitleText(pFontArrus, 0, 0xCu, v13, v11, 3u);
         a1.uFrameWidth -= 24;
         a1.uFrameZ = a1.uFrameX + a1.uFrameWidth - 1;
@@ -11451,7 +11451,7 @@
     v2 = 255;
     v3 = 0;
   }
-  return GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v3, v2, v6);
+  return TargetColor(v3, v2, v6);
 }
 
 //----- (00417939) --------------------------------------------------------
@@ -11465,9 +11465,9 @@
 
   v1 = uConditionIdx;
   v2 = 65535;
-  v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
-  v6 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x23u, 0);
-  v4 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0);
+  v3 = TargetColor(0xE1u, 0xCDu, 0x23u);
+  v6 = TargetColor(0xFFu, 0x23u, 0);
+  v4 = TargetColor(0, 0xFFu, 0);
   switch ( v1 )
   {
     case 0u:
@@ -11525,7 +11525,7 @@
   Dst.uFrameHeight -= 12;
   Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1;
   Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1;
-  v4 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
+  v4 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
   sprintf(pTmpBuf, format_4E2D80, v4, v3);
   Dst.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf, 3u);
   return Dst.DrawText(pFontSmallnum, 1, LOBYTE(pFontLucida->uFontHeight), 0, v2, 0, 0, 0);
@@ -11540,9 +11540,9 @@
   unsigned int red; // [sp+10h] [bp-8h]@1
   unsigned int white; // [sp+14h] [bp-4h]@1
 
-  white = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
-  red = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0);
-  yellow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0);
+  white = TargetColor(0xFFu, 0xFFu, 0xFFu);
+  red = TargetColor(0xFFu, 0, 0);
+  yellow = TargetColor(0xFFu, 0xFFu, 0);
   if ( !(uPlayerClass % 4) )
   {
     if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] >= skill_level )