diff mm7_4.cpp @ 2231:8673f3aedfb9

sub_4B1523 to sub_4B1523_showSpellbookInfo, changed input type, some vars renamed
author Grumpy7
date Sat, 22 Feb 2014 19:44:49 +0100
parents 10c909eb6766
children a9fa57fda3ae
line wrap: on
line diff
--- a/mm7_4.cpp	Sat Feb 22 18:25:53 2014 +0100
+++ b/mm7_4.cpp	Sat Feb 22 19:44:49 2014 +0100
@@ -1731,10 +1731,10 @@
 }
 
 //----- (004B1523) --------------------------------------------------------
-void  sub_4B1523(int *_this)
+void sub_4B1523_showSpellbookInfo(int spellItemId)
 {
-  int v1; // esi@1
-  int v2; // edx@1
+  int spellId; // esi@1
+  int spellLevel; // edx@1
   unsigned int v3; // eax@2
   int v4; // eax@4
   LONG v5; // ecx@4
@@ -1742,14 +1742,14 @@
   char *v7; // ST44_4@12
   unsigned __int16 v8; // ax@12
   GUIWindow a1; // [sp+Ch] [bp-68h]@4
-  unsigned int v11; // [sp+60h] [bp-14h]@1
+  unsigned int spellSchool; // [sp+60h] [bp-14h]@1
   POINT a2; // [sp+64h] [bp-10h]@1
   int v13; // [sp+6Ch] [bp-8h]@4
   int v14; // [sp+70h] [bp-4h]@4
 
-  v1 = *_this - 399;
-  v2 = (*_this - 400) % 11 + 1;
-  v11 = 4 * (*_this - 400) / 11;
+  spellId = spellItemId - 399;
+  spellLevel = (spellItemId - 400) % 11 + 1;
+  spellSchool = 4 * (spellItemId - 400) / 11;
  // sprintf(pTmpBuf.data(), "%s%03d", spellbook_texture_filename_suffices[v11 / 4], v2); not used
   if ( pMouse->GetCursorPos(&a2)->y <= 320 )
     v3 = pMouse->GetCursorPos(&a2)->y + 30;
@@ -1774,11 +1774,11 @@
   if ( v4 > v5 )
     v5 = v4;
   sprintf(pTmpBuf2.data(), "%s\n\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s",
-    pSpellStats->pInfos[v1].pDescription, pGlobalTXT_LocalizationStrings[431],        // "Normal"
-    v5 + 3, v5 + 10, pSpellStats->pInfos[v1].pBasicSkillDesc, pGlobalTXT_LocalizationStrings[433],        // "Expert"
-    v5 + 3, v5 + 10, pSpellStats->pInfos[v1].pExpertSkillDesc, pGlobalTXT_LocalizationStrings[432],        // "Master"
-    v5 + 3, v5 + 10, pSpellStats->pInfos[v1].pMasterSkillDesc, pGlobalTXT_LocalizationStrings[96],         // "Grand"
-    v5 + 3, v5 + 10, pSpellStats->pInfos[v1].pGrandmasterSkillDesc);
+    pSpellStats->pInfos[spellId].pDescription, pGlobalTXT_LocalizationStrings[431],        // "Normal"
+    v5 + 3, v5 + 10, pSpellStats->pInfos[spellId].pBasicSkillDesc, pGlobalTXT_LocalizationStrings[433],        // "Expert"
+    v5 + 3, v5 + 10, pSpellStats->pInfos[spellId].pExpertSkillDesc, pGlobalTXT_LocalizationStrings[432],        // "Master"
+    v5 + 3, v5 + 10, pSpellStats->pInfos[spellId].pMasterSkillDesc, pGlobalTXT_LocalizationStrings[96],         // "Grand"
+    v5 + 3, v5 + 10, pSpellStats->pInfos[spellId].pGrandmasterSkillDesc);
   v6 = pFontSmallnum->CalcTextHeight(pTmpBuf2.data(), &a1, 0, 0);
   a1.uFrameHeight += v6;
   if ( (signed int)a1.uFrameHeight < 150 )
@@ -1787,7 +1787,7 @@
   a1.DrawMessageBox(0);
   a1.uFrameWidth -= 12;
   a1.uFrameHeight -= 12;
-  v7 = pSpellStats->pInfos[v1].pName;
+  v7 = pSpellStats->pInfos[spellId].pName;
   a1.uFrameZ = a1.uFrameX + a1.uFrameWidth - 1;
   a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1;
   v8 = Color16(0xFFu, 0xFFu, 0x9Bu);
@@ -1795,8 +1795,8 @@
   a1.DrawText(pFontSmallnum, 120, 44, 0, pTmpBuf2.data(), 0, 0, 0);
   a1.uFrameZ = a1.uFrameX + 107;
   a1.uFrameWidth = 108;
-  a1.DrawTitleText(pFontComic, 0xCu, 0x4Bu, 0, pSkillNames[v11 / 4 + 12], 3u);
-  sprintfex(pTmpBuf.data(), "%s\n%d", pGlobalTXT_LocalizationStrings[522], *(&pSpellDatas[0].uNormalLevelMana + 10 * v1));
+  a1.DrawTitleText(pFontComic, 0xCu, 0x4Bu, 0, pSkillNames[spellSchool / 4 + 12], 3u);
+  sprintfex(pTmpBuf.data(), "%s\n%d", pGlobalTXT_LocalizationStrings[522], *(&pSpellDatas[0].uNormalLevelMana + 10 * spellId));
   a1.DrawTitleText(pFontComic, 0xCu, a1.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16, 0, pTmpBuf.data(), 3);
 }