diff mm7_5.cpp @ 1458:934074e7fcc1

ModalWindow __thiscall and __cdecl removed Some random renames & refactors
author Nomad
date Wed, 21 Aug 2013 14:26:36 +0200
parents bfe342ae0c1f
children 2ca62c9e7b3c
line wrap: on
line diff
--- a/mm7_5.cpp	Wed Aug 14 00:40:51 2013 +0400
+++ b/mm7_5.cpp	Wed Aug 21 14:26:36 2013 +0200
@@ -51,7 +51,7 @@
 #include "Lights.h"
 
 //----- (004304E7) --------------------------------------------------------
-void __cdecl GameUI_MsgProc()
+void  GameUI_MsgProc()
 {
   //signed int v0; // edi@6
   //char *v1; // esi@6
@@ -890,7 +890,7 @@
             MM7Initialization();
             continue;
           }
-          ModalWindow(pNPCTopics[453].pText, 0);
+          ModalWindow(pNPCTopics[453].pText, UIMSG_0);
           continue;
         case UIMSG_GameMenu_ReturnToGame:
           pGUIWindow_CurrentMenu->Release();
@@ -983,7 +983,7 @@
               }
               break;
           }
-          if ( !ptr_507BDC )
+          if ( !pModalWindow )
           {
             pRenderer->ClearZBuffer(0, 479);
             viewparams->bRedrawGameUI = 1;
@@ -1392,7 +1392,7 @@
                       continue;
                     case SCREEN_CHARACTERS:
                       CharacterUI_ReleaseButtons();
-                      sub_419379();
+                      ReleaseAwardsScrollBar();
                       pIcons_LOD->RemoveTexturesPackFromTextureList();
                       if ( pGUIWindow_Settings )
                       {
@@ -1479,7 +1479,7 @@
                   continue;
                 }
                 CharacterUI_ReleaseButtons();
-                sub_419379();
+                ReleaseAwardsScrollBar();
                 pIcons_LOD->RemoveTexturesPackFromTextureList();
               }
               if ( pGUIWindow_Settings )
@@ -1565,7 +1565,7 @@
             back_to_game();
             continue;
           }
-          sub_41426F();
+          ModalWindow_Release();
           continue;
         case UIMSG_ScrollNPCPanel://Right and Left button for NPCPanel
           if ( uMessageParam )
@@ -2249,13 +2249,14 @@
           sprintfex(pFinalMessage.data(), "%s\n \n%s\n \n%s", pGlobalTXT_LocalizationStrings[151],// "Congratulations Adventurer."
             pGlobalTXT_LocalizationStrings[118],// "We hope that you've enjoyed playing Might and Magic VII as much as we did making it. We have saved this screen as MM7_WIN.PCX in your MM7 directory. You can print it out as proof of your accomplishment."
             pGlobalTXT_LocalizationStrings[167]);// "- The Might and Magic VII Development Team."   
-          ModalWindow(pFinalMessage.data(), 196);
+          ModalWindow(pFinalMessage.data(), UIMSG_OnFinalWindowClose);
           uGameState = GAME_STATE_FINAL_WINDOW;
           continue;
-        case UIMSG_C4:
+        case UIMSG_OnFinalWindowClose:
 			__debugbreak();
           uGameState = GAME_STATE_PLAYING;
           strcpy((char *)pKeyActionMap->pPressedKeysBuffer, "2");
+          __debugbreak(); // missed break/continue?
         case UIMSG_DD:
 			__debugbreak();
           sprintf(pTmpBuf.data(), "%s", pKeyActionMap->pPressedKeysBuffer);
@@ -2479,7 +2480,7 @@
             pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
           if ( pCurrentScreen )
             continue;
-          if ( sub_42F4DA() )
+          if ( _42F4DA_check_actor_proximity() )
           {
             if ( pParty->bTurnBasedModeOn == 1 )
             {
@@ -2885,13 +2886,13 @@
         case UIMSG_ClickStatsBtn:
           pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100;
           CharacterUI_ReleaseButtons();
-          sub_419379();
+          ReleaseAwardsScrollBar();
           GUIWindow::Create(pCharacterScreen_StatsBtn->uX, pCharacterScreen_StatsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_StatsBtn, 0);
           continue;
         case UIMSG_ClickSkillsBtn:
           pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 101;
           CharacterUI_ReleaseButtons();
-          sub_419379();
+          ReleaseAwardsScrollBar();
           CharacterUI_SkillsTab_CreateButtons();
           GUIWindow::Create(pCharacterScreen_SkillsBtn->uX, pCharacterScreen_SkillsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_SkillsBtn, 0);
           continue;
@@ -2920,7 +2921,7 @@
           continue;
         case UIMSG_ClickInventoryBtn:
           pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103;
-          sub_419379();
+          ReleaseAwardsScrollBar();
           CharacterUI_ReleaseButtons();
           GUIWindow::Create(pCharacterScreen_InventoryBtn->uX, pCharacterScreen_InventoryBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_InventoryBtn, 0);
           continue;
@@ -2928,7 +2929,7 @@
           GUIWindow::Create(pCharacterScreen_ExitBtn->uX, pCharacterScreen_ExitBtn->uY, 0, 0, WINDOW_ExitCharacterWindow, (int)pCharacterScreen_ExitBtn, 0);
           continue;
         case UIMSG_ClickAwardsBtn:
-          sub_419379();
+          ReleaseAwardsScrollBar();
           CharacterUI_ReleaseButtons();
           CreateAwardsScrollBar();
           pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 102;
@@ -3238,7 +3239,7 @@
 }
 
 //----- (004356FF) --------------------------------------------------------
-void __cdecl back_to_game()
+void  back_to_game()
 {
   dword_507BF0_is_there_popup_onscreen = 0;
   dword_4E455C = 1;
@@ -3251,7 +3252,7 @@
 }
 
 //----- (00435748) --------------------------------------------------------
-void __cdecl GUI_MainMenuMessageProc()
+void  GUI_MainMenuMessageProc()
 {
   Player *pPlayer; // ebx@2
   void *v3; // edi@21
@@ -3420,7 +3421,7 @@
           pMouse->SetCursorBitmap("MICON2");
           break;
         case UIMSG_3A:
-          SetCurrentMenuID(MENU_10);
+          SetCurrentMenuID(MENU_DebugBLVLevel);
           break;
         case UIMSG_LoadGame:
           if (!pSavegameUsedSlots[uLoadGameUI_SelectedSlot])
@@ -3479,12 +3480,12 @@
           break;
         case UIMSG_AE:
           GUIWindow::Create(pMainMenu_BtnExit->uX, pMainMenu_BtnExit->uY, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnExit, 0);
-          SetCurrentMenuID(MENU_10);
+          SetCurrentMenuID(MENU_DebugBLVLevel);
           break;
         case UIMSG_Escape:
-          if ( ptr_507BDC )
+          if ( pModalWindow )
           {
-            sub_41426F();
+            ModalWindow_Release();
             break;
           }
           if ( !(BYTE1(dword_6BE364_game_settings_1) & 0x40) )
@@ -3579,7 +3580,7 @@
 }
 
 //----- (00436427) --------------------------------------------------------
-double __cdecl get_shading_dist_mist()
+double  get_shading_dist_mist()
 {
   if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
     return (double)pOutdoorCamera->shading_dist_mist;
@@ -4626,6 +4627,8 @@
   signed int a3a; // [sp+24h] [bp+8h]@14
   int a4a; // [sp+28h] [bp+Ch]@2
 
+  __debugbreak();
+
   v4 = a4;
   v5 = a4->uAttributes;
   if ( v5 & 0x100 )
@@ -4759,6 +4762,8 @@
   int a4a; // [sp+28h] [bp+Ch]@2
   signed int a5a; // [sp+2Ch] [bp+10h]@14
 
+  __debugbreak();
+
   v5 = a4;
   v6 = a4->uAttributes;
   v7 = 0;
@@ -4895,13 +4900,6 @@
                            LOBYTE(pRenderer->uTargetRBits) + LOBYTE(pRenderer->uTargetBBits) - 8));
 }
 
-//----- (0040DFA7) --------------------------------------------------------
-int __stdcall retzero_sub_40DFA7(int a1)
-{
-  return 0;
-}
-// 40DFA7: using guessed type int __stdcall retzero_sub_40DFA7(int);
-
 
 
 //----- (0040F82D) --------------------------------------------------------
@@ -4964,7 +4962,7 @@
 }
 
 //----- (0040F92A) --------------------------------------------------------
-void __fastcall sub_40F92A(int *pZBuffer, Texture *a2, int a3)
+void __fastcall ZBuffer_DoFill2(int *pZBuffer, Texture *a2, int a3)
 {
   Texture *v3; // esi@1
   void *v4; // eax@3
@@ -5005,7 +5003,7 @@
 }
 
 //----- (00410D99) --------------------------------------------------------
-signed int __fastcall sub_410D99_get_map_index(int a1)
+int __fastcall sub_410D99_get_map_index(int a1)
 {
   int v1; // edi@1
   signed int v2; // ebp@1