changeset 297:ada52edca264

m
author Ritor1
date Tue, 19 Feb 2013 09:13:51 +0600
parents 250e49fef6f6
children 055cea8660e5
files Player.cpp Player.h mm7_4.cpp
diffstat 3 files changed, 25 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/Player.cpp	Mon Feb 18 16:39:49 2013 +0600
+++ b/Player.cpp	Tue Feb 19 09:13:51 2013 +0600
@@ -6833,26 +6833,26 @@
 }
 
 //----- (004907E7) --------------------------------------------------------
-__int16 Player::GetStatColor(unsigned int uStat)
-{
-  Player *v2; // edi@1
-  __int16 uWhite; // si@1
+unsigned int Player::GetStatColor(int uStat)
+{
+  //Player *v2; // edi@1
+  unsigned int uWhite; // si@1
 //  int uStartingHP; // eax@1
-  int v5; // edx@1
+  //int v5; // edx@1
  // unsigned __int8 v6; // zf@1
  // char v7; // sf@1
-  unsigned __int8 v8; // of@1
-  __int16 result; // ax@2
-  __int16 uGreen; // [sp+8h] [bp-8h]@1
-  __int16 uRed; // [sp+Ch] [bp-4h]@1
-
-  v2 = this;
+  int v8; // of@1
+  //__int16 result; // ax@2
+  unsigned int uGreen; // [sp+8h] [bp-8h]@1
+  unsigned int uRed; // [sp+Ch] [bp-4h]@1
+  int attribute_value;
+
+  //v2 = this;
   uRed = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x23u, 0);
   uGreen = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0);
   uWhite = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
   v8 = stru_4ED7B0.race[GetRace()].attr[uStat].uBaseValue;
 
-  int attribute_value = 0;
   switch (uStat)
   {
     case 0:  attribute_value = uMight;        break;
@@ -6864,18 +6864,12 @@
     case 6:  attribute_value = uLuck;         break;
   };
 
-  v5 = attribute_value;
-  if ( v5 >= v8 )
-  {
-    result = uGreen;
-    if ( v5 == v8 )
-      result = uWhite;
-  }
+  if ( attribute_value == v8 )
+    return uWhite;
+  else if ( attribute_value > v8 )
+    return uGreen;
   else
-  {
-    result = uRed;
-  }
-  return result;
+    return uRed;
 }
 
 //----- (004908A8) --------------------------------------------------------
--- a/Player.h	Mon Feb 18 16:39:49 2013 +0600
+++ b/Player.h	Tue Feb 19 09:13:51 2013 +0600
@@ -514,7 +514,7 @@
   void DecreaseAttribute(int eAttribute);
   int IncreaseAttribute(int eAttribute);
   void Player::Zero();
-  __int16 GetStatColor(unsigned int uStat);
+  unsigned int GetStatColor(int uStat);
   bool DiscardConditionIfLastsLongerThan(unsigned int uCondition, unsigned __int64 uTime);
   int _490EEE(ItemGen *pItem, int a3, int a4, int a5);
   int GetBodybuilding();
--- a/mm7_4.cpp	Mon Feb 18 16:39:49 2013 +0600
+++ b/mm7_4.cpp	Tue Feb 19 09:13:51 2013 +0600
@@ -5518,31 +5518,31 @@
     pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + uX - 24, 291, uColor1, pText, 0, 0, 0);
     uNumMight = player->GetActualMight();
     sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[144], v129, uNumMight);// "Might"
-    LOWORD(v24) = player->GetStatColor(0);
+    v24 = player->GetStatColor(0);
     pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 169, v24, pTmpBuf, 0, 0, 0);
     v25 = player->GetActualIntelligence();
     sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[116], v129, v25);// "Intellect"
-    LOWORD(v26) = player->GetStatColor(1);
+    v26 = player->GetStatColor(1);
     pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v128 + 169, v26, pTmpBuf, 0, 0, 0);
     v27 = player->GetActualWillpower();
     sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[163], v129, v27);// "Personality"
-    LOWORD(v28) = player->GetStatColor(2);
+    v28 = player->GetStatColor(2);
     pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 2 * v128 + 169, v28, pTmpBuf, 0, 0, 0);
     v29 = player->GetActualEndurance();
     sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[75], v129, v29);// "Endurance"
-    LOWORD(v30) = player->GetStatColor(3);
+    v30 = player->GetStatColor(3);
     pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, uY, v30, pTmpBuf, 0, 0, 0);
     v31 = player->GetActualAccuracy();
     sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[1], v129, v31);// "Accuracy"
-    LOWORD(v32) = player->GetStatColor(4);
+    v32 = player->GetStatColor(4);
     pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 4 * v128 + 169, v32, pTmpBuf, 0, 0, 0);
     v33 = player->GetActualSpeed();
     sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[211], v129, v33);// "Speed"
-    LOWORD(v34) = player->GetStatColor(5);
+    v34 = player->GetStatColor(5);
     pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v122, v34, pTmpBuf, 0, 0, 0);
     v35 = player->GetActualLuck();
     sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[136], v129, v35);// "Luck"
-    LOWORD(v36) = player->GetStatColor(6u);
+    v36 = player->GetStatColor(6);
     pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v119, v36, pTmpBuf, 0, 0, 0);
     v37 = player->GetSkillIdxByOrder(0);
     pTextCenter = pFontCreate->AlignText_Center(0x96u, pSkillNames[v37]);