diff mm7_5.cpp @ 17:fe0d9a98213f

17.01.13 (fix Hint error)
author Ritor1
date Thu, 17 Jan 2013 16:24:25 +0600
parents b4982f23d2e9
children d5954a85577a
line wrap: on
line diff
--- a/mm7_5.cpp	Thu Jan 17 09:24:40 2013 +0600
+++ b/mm7_5.cpp	Thu Jan 17 16:24:25 2013 +0600
@@ -13552,7 +13552,7 @@
 // 50654C: using guessed type int dword_50654C;
 
 //----- (00412E85) --------------------------------------------------------
-char __cdecl sub_412E85()
+char __cdecl DrawBook_History()
 {
   unsigned int v0; // eax@3
   unsigned int v1; // eax@7
@@ -13659,7 +13659,7 @@
 
 
 //----- (00413126) --------------------------------------------------------
-void __cdecl DrawSpellbook_Quests()
+void __cdecl DrawBook_Quests()
 {
   unsigned int v0; // eax@3
   unsigned int v1; // eax@7
@@ -13755,7 +13755,7 @@
 
 
 //----- (0041338E) --------------------------------------------------------
-void __cdecl DrawSpellbook_Autonotes()
+void __cdecl DrawBook_Autonotes()
 {
   unsigned int v0; // eax@3
   unsigned int v1; // eax@7
@@ -14058,7 +14058,7 @@
 
 
 //----- (00413980) --------------------------------------------------------
-char *__cdecl DrawSpellbook_Map()
+char *__cdecl DrawBook_Maps()
 {
   unsigned int v0; // eax@3
   unsigned int v1; // eax@7
@@ -14204,37 +14204,34 @@
 
 
 //----- (00413CC6) --------------------------------------------------------
-void __thiscall DrawSpellbook(unsigned int uBook)
-{
-  unsigned int v1; // esi@1
-
-  v1 = uBook;
-  pRenderer->DrawTextureIndexed(
-    471u,
-    445u,
-    (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0));
-  switch ( v1 )
-  {
-    case 0xB1u:
+void __thiscall SellectDrawBook(unsigned int uBook)
+{
+  enum WindowType pWindowType; // esi@1
+
+  pWindowType = (enum WindowType)uBook;
+  pRenderer->DrawTextureIndexed(471u, 445u, (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0));
+  switch ( pWindowType )
+  {
+    case WINDOW_Lloyd: // 177
       DrawLloydBeaconsScreen();
       break;
-    case 0xC3u:
+    case WINDOW_TownPortal: //195
       DrawTownPortalScreen();
       break;
-    case 0xC8u:
-      DrawSpellbook_Quests();
+    case WINDOW_QuestBook: //200
+      DrawBook_Quests();
       break;
-    case 0xC9u:
-      DrawSpellbook_Autonotes();
+    case WINDOW_AutonotesBook: //201
+      DrawBook_Autonotes();
       break;
-    case 0xCAu:
-      DrawSpellbook_Map();
+    case WINDOW_MapsBook://202
+      DrawBook_Maps();
       break;
-    case 0xCBu:
-      DrawSpellbook_Calendar();
+    case WINDOW_CalendarBook://203
+      DrawBook_Calendar();
       break;
-    case 0xE0u:
-      sub_412E85();
+    case WINDOW_HistoryBook://224
+      DrawBook_History();
       break;
   }
 }
@@ -14255,7 +14252,7 @@
 }
 
 //----- (00413D6F) --------------------------------------------------------
-char __cdecl DrawSpellbook_Calendar()
+char __cdecl DrawBook_Calendar()
 {
   unsigned int v0; // esi@1
   char *v1; // eax@5
@@ -15008,7 +15005,7 @@
 
 
 //----- (004156F0) --------------------------------------------------------
-void __cdecl GUI_UpdateWindows()
+void __cdecl GUI_UpdateWindows() // Нужно всё преобразовать в кейсы
 {
   GUIWindow *pWindow; // esi@4
   unsigned int pWindowType; // eax@4
@@ -15143,7 +15140,7 @@
                   GameMenuUI_DrawKeyBindings();
                 }
               }
-              else//pWindowType == 103
+              else//pWindowType == 103 (0x67) WINDOW_67
               {
                 pWindow->DrawMessageBox(0);
                 pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0);
@@ -15165,7 +15162,7 @@
               }
               continue;
             }
-            pTexture = (Texture *)*((_DWORD *)pWindow->ptr_1C + 15);//pWindowType == 99
+            pTexture = (Texture *)*((_DWORD *)pWindow->ptr_1C + 15);//pWindowType == 99 (0x63) WINDOW_63
             pY = pWindow->uFrameY;
             pX = pWindow->uFrameX;
 //LABEL_18:
@@ -15174,7 +15171,7 @@
             viewparams->bRedrawGameUI = 1;
             continue;
           }
-          memset(&GUIButton2, 0, 0xBCu);//pWindowType == 98
+          memset(&GUIButton2, 0, 0xBCu);//pWindowType == 98 (0x62) WINDOW_RestWindow
           GUIButton2.uZ = 197;
           GUIButton2.uW = 197;
           GUIButton2.uX = 27;
@@ -15193,7 +15190,7 @@
           pGUIWindow2->Release();
           continue;
         }
-        if ( pWindow->Hint != (char *)1 )//pWindowType == 97
+        if ( pWindow->Hint != (char *)1 )//pWindowType == 97 (0x61) WINDOW_61
           pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
         v32 = pWindow->ptr_1C;
         pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)v32 + 16));
@@ -15244,7 +15241,7 @@
       if ( v14 )//pWindowType > 80
       {
         v15 = v14 - 9;
-        if ( !v15 )//pWindowType == 89
+        if ( !v15 )//pWindowType == 89 (0x59) WINDOW_59
         {
           pWindow->DrawMessageBox(0);
           pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0);
@@ -15281,17 +15278,17 @@
           continue;
         }
         v16 = v15 - 1;
-        if ( !v16 )// pWindowType == 90
+        if ( !v16 )// pWindowType == 90 (0x5A) WINDOW_5A
         {
           if ( pWindow->Hint != (char *)1 )
             pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
           pButtonPtr_1C = (GUIButton *)pWindow->ptr_1C;
-          if ( (pButtonPtr_1C->uX /*& 0x80000000u*/) == 0 )
+          if ( pButtonPtr_1C->uX >= 0 )//if ( (pButtonPtr_1C->uX & 0x80000000u) == 0 )
           {
             if ( (signed int)pButtonPtr_1C->uX <= 640 )
             {
               //v25 = pButtonPtr_1C->uY;
-              if ( (pButtonPtr_1C->uY /*& 0x80000000u*/) == 0 )
+              if ( pButtonPtr_1C->uY >= 0 ) //if ( (pButtonPtr_1C->uY & 0x80000000u) == 0 )
               {
                 if ( (signed int)pButtonPtr_1C->uY <= 480 )
                 {
@@ -15332,7 +15329,7 @@
           continue;
         }
         v17 = v16 - 1;
-        if ( !v17 )//pWindowType == 91
+        if ( !v17 )//pWindowType == 91 (0x5B) WINDOW_5B
         {
           if ( pWindow->Hint != (char *)1 )
             pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
@@ -15357,7 +15354,7 @@
           continue;
         }
         v18 = v17 - 1;
-        if ( !v18 )//pWindowType == 92
+        if ( !v18 )//pWindowType == 92 (0x5C) WINDOW_5C
         {
           if ( pWindow->Hint != (char *)1 )
             pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
@@ -15377,7 +15374,7 @@
           continue;
         }
         v19 = v18 - 1;
-        if ( !v19 )//pWindowType == 93
+        if ( !v19 )//pWindowType == 93 (0x5D) WINDOW_5D
         {
           if ( pWindow->Hint != (char *)1 )
             pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
@@ -15390,7 +15387,7 @@
           continue;
         }
       }
-      else//pWindowType == 80
+      else//pWindowType == 80 (0x50) WINDOW_50
       {
         v27 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
         if ( ptr_507BD0->field_40 == 1 )
@@ -15433,7 +15430,7 @@
     }
     else
     {
-      if ( pWindowType == 70 )
+      if ( pWindowType == 70 ) // 0x46 WINDOW_FinalWindow
       {
         sub_41420D_press_esc();
         continue;
@@ -15448,7 +15445,7 @@
             v13 = v12 - 4;
             if ( v13 )//pWindowType > 30
             {
-              if ( v13 == 1 ) //pWindowType == 31
+              if ( v13 == 1 ) //pWindowType == 31 (0x1F) WINDOW_1F
               {
                 pRenderer->ClearZBuffer(0, 479);
                 draw_leather();
@@ -15458,12 +15455,12 @@
                   (Texture *)(uTextureID_x_x_u != -1 ? &pIcons_LOD->pTextures[uTextureID_x_x_u] : 0));
               }
             }
-            else// pWindowType == 30
+            else// pWindowType == 30 (0x1E) WINDOW_1E
             {
               sub_467FB6();
             }
           }
-          else //pWindowType == 26
+          else //pWindowType == 26 (0x1A) WINDOW_1A
           {
             TransitionUI_Draw();
           }
@@ -15480,15 +15477,15 @@
               v9 = v8 - 3;
               if ( v9 )//pWindowType > 23
               {
-                //if ( v9 == 1 ) //pWindowType == 24
+                //if ( v9 == 1 ) //pWindowType == 24 (0x18) WINDOW_MainMenu_Load
                 //  sub_4606F7();
               }
-              else//pWindowType == 23
+              else//pWindowType == 23 (0x17) WINDOW_17
               {
                 sub_4606FE();
               }
             }
-            else//pWindowType == 20
+            else//pWindowType == 20 (0x14) WINDOW_Chest
             {
               if ( pCurrentScreen == 10 )
               {
@@ -15507,7 +15504,7 @@
               }
             }
           }
-          else//pWindowType == 19
+          else//pWindowType == 19 (0x13) WINDOW_GreetingNPC
           {
             DrawBranchlessDialogueUI();
           }
@@ -15544,7 +15541,7 @@
         }
         continue;
       }
-      if ( pWindowType == 18 )
+      if ( pWindowType == 18 ) //(0x12) WINDOW_SpellBook
       {
         sub_412B58();
       }
@@ -15558,15 +15555,15 @@
             v6 = v5 - 4;
             if ( v6 )//pWindowType > 16
             {
-              if ( v6 == 1 )//pWindowType == 17
+              if ( v6 == 1 )//pWindowType == 17 (0x11) WINDOW_ChangeLocation
                 TravelUI_Draw();
             }
-            else//pWindowType == 16
+            else//pWindowType == 16 (0x10) WINDOW_10
             {
               RestUI_Draw();
             }
           }
-          else// pWindowType == 12
+          else// pWindowType == 12 (0xC) WINDOW_C
           {
             QuickRefDraw();
           }
@@ -15583,21 +15580,21 @@
               v4 = v3 - 2;
               if ( v4 )//pWindowType > 6
               {
-                if ( v4 == 3 )//pWindowType == 9
-                  DrawSpellbook((unsigned int)pWindow->ptr_1C);
+                if ( v4 == 3 )//pWindowType == 9 (0x9) WINDOW_Book
+                  SellectDrawBook((unsigned int)pWindow->ptr_1C);
               }
-              else//pWindowType == 6
+              else//pWindowType == 6 (0x6) WINDOW_Options
               {
                 sub_414F82_DrawGameOptions();
               }
             }
-            else//pWindowType == 4
+            else//pWindowType == 4 (0x4) WINDOW_CharacterRecord
             {
               CharacterUI_CharacterScreen_Draw(uActiveCharacter);
             }
             continue;
           }
-          pTexture = (Texture *)(uTextureID_507944 != -1 ? &pIcons_LOD->pTextures[uTextureID_507944] : 0);//pWindowType == 3
+          pTexture = (Texture *)(uTextureID_507944 != -1 ? &pIcons_LOD->pTextures[uTextureID_507944] : 0);//pWindowType == 3 (0x3)
           pY = pViewport->uViewportY;
           pX = pViewport->uViewportX;
           //goto LABEL_18;