diff mm7_2.cpp @ 2061:b2a434d65344

GAME_SETTINGS_* defines introduced DEBUG_SETTINGS_* defines introduced
author Nomad
date Mon, 02 Dec 2013 15:13:49 +0200
parents f9698295c0bd
children 259df09dfb50
line wrap: on
line diff
--- a/mm7_2.cpp	Mon Dec 02 17:00:58 2013 +0600
+++ b/mm7_2.cpp	Mon Dec 02 15:13:49 2013 +0200
@@ -695,7 +695,7 @@
 }
 
 //----- (004BF91E) --------------------------------------------------------
-unsigned int  GameOverMenu(void *ecx0)
+unsigned int GameOverMenu(void *ecx0)
 {
   const char *v1; // eax@2
   unsigned int result; // eax@3
@@ -725,7 +725,7 @@
   RGBTexture _this; // [sp+Ch] [bp-C4h]@1
   //RGBTexture::RGBTexture(&this);
 
-  BYTE1(dword_6BE364_game_settings_1) &= 0xBFu;
+  dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_4000;
   bGameoverLoop = 1;
   pVideoPlayer->bStopBeforeSchedule = 0;
   pAudioPlayer->StopChannels(-1, -1);
@@ -810,7 +810,7 @@
   pWindow.DrawTitleText(pFont, 1u, pWindow.uFrameHeight - 2 * LOBYTE(pFont->uFontHeight) - 5, 1u, pTmpBuf.data(), 3u);
   sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[94], v23);
   pWindow.DrawTitleText(pFont, 1u, pWindow.uFrameHeight, 1u, pTmpBuf.data(), 3u);
-  BYTE1(dword_6BE364_game_settings_1) |= 0x40u;
+  dword_6BE364_game_settings_1 |= GAME_SETTINGS_4000;
   pRenderer->EndScene();
   pRenderer->Present();
   if ( pRenderer->pRenderD3D )
@@ -2982,9 +2982,9 @@
 
   pGameLoadingUI_ProgressBar->Progress();
 
-  if ( dword_6BE368_debug_settings_2 & 4 )
+  if (dword_6BE368_debug_settings_2 & DEBUG_SETTINGS_NO_ACTORS)
     uNumActors = 0;
-  if ( dword_6BE368_debug_settings_2 & 8 )
+  if ( dword_6BE368_debug_settings_2 & DEBUG_SETTINGS_NO_DECORATIONS)
     uNumLevelDecorations = 0;
   init_event_triggers();
 
@@ -3068,19 +3068,20 @@
       pWindow = pGUIWindow_CurrentMenu;
     }
 
-    for (MSG msg; PeekMessage(&msg, 0, 0, 0, PM_REMOVE);)
+    for (MSG msg; PeekMessageW(&msg, 0, 0, 0, PM_REMOVE);)
     {
       if (msg.message == WM_QUIT)
         Game_DeinitializeAndTerminate(0);
       TranslateMessage(&msg);
-      DispatchMessage(&msg);
+      DispatchMessageW(&msg);
     }
-    if (dword_6BE364_game_settings_1 & 0x0100)
+
+    if (dword_6BE364_game_settings_1 & GAME_SETTINGS_APP_INACTIVE)
     {
       WaitMessage();
+      continue;
     }
-    else
-    {
+
       pRenderer->BeginScene();
       pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX);
 
@@ -3136,7 +3137,6 @@
       }
       pRenderer->EndScene();
       pRenderer->Present();
-    }
   }
   GUI_MainMenuMessageProc();
   pRenderer->BeginScene();
@@ -3987,7 +3987,7 @@
 
 
   
-  if (dword_6BE364_game_settings_1 & 2 || !(dword_6BE368_debug_settings_2 & 1))// 
+  if (dword_6BE364_game_settings_1 & 2 || !(dword_6BE368_debug_settings_2 & DEBUG_SETTINGS_RUN_IN_WIDOW))// 
                                                 //   color depth != 16
                                                 // or
                                                 //   not in window
@@ -4034,7 +4034,7 @@
   pVideoPlayer = new VideoPlayer();
   pVideoPlayer->Initialize(window);
 
-  dword_6BE364_game_settings_1 |= 0x4000;
+  dword_6BE364_game_settings_1 |= GAME_SETTINGS_4000;
 
     switch ( uTurnSpeed )
     {
@@ -4324,10 +4324,10 @@
   bool bNoMargareth = false;
   if (pCmdLine && *pCmdLine)
   {
-    if (wcsstr(pCmdLine, L"-usedefs"))
-      bDebugResouces = 1;
+    //if (wcsstr(pCmdLine, L"-usedefs"))
+    //  bDebugResouces = 1;
     if (wcsstr(pCmdLine, L"-window"))
-      dword_6BE368_debug_settings_2 |= 1u;
+      dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_RUN_IN_WIDOW;
 
     if (wcsstr(pCmdLine, L"-nointro"))
       bNoIntro = true;//dword_6BE364_game_settings_1 |= 4;
@@ -4341,7 +4341,7 @@
       bWalkSound = false;//dword_6BE364_game_settings_1 |= 0x20;
     if (wcsstr(pCmdLine, L"-novideo"))
     {
-      dword_6BE364_game_settings_1 |= 0x40;
+      dword_6BE364_game_settings_1 |= GAME_SETTINGS_NO_HOUSE_ANIM;
       bNoVideo = true;
     }
     if (wcsstr(pCmdLine, L"-nocd"))
@@ -4375,7 +4375,7 @@
     SetUserInterface(PartyAlignment_Neutral, false);
     ShowIntroVideo_and_LoadingScreen();
     WriteWindowsRegistryInt("Ran once", 1);
-    dword_6BE364_game_settings_1 |= 0x4000;
+    dword_6BE364_game_settings_1 |= GAME_SETTINGS_4000;
     pGame->InitializeGammaController();
     SecondaryInitialization();
     pRenderer->SetRasterClipRect(0, 0, 639, 479);
@@ -4543,19 +4543,19 @@
 
 
   if (GetPrivateProfileIntW(L"debug", L"nomonster", 0, pIniFilename))
-    dword_6BE368_debug_settings_2 |= 4;
+    dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_NO_ACTORS;
   if (bUseRegistry)
     v1 = ReadWindowsRegistryInt("startinwindow", 0);
   else
     v1 = GetPrivateProfileIntW(L"debug", L"startinwindow", 0, pIniFilename);
   if (v1)
-    dword_6BE368_debug_settings_2 |= 1;
+    dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_RUN_IN_WIDOW;
   if (GetPrivateProfileIntW(L"debug", L"showFR", 0, pIniFilename))
-    dword_6BE368_debug_settings_2 |= 2;
+    dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_0002_SHOW_FR;
   if (GetPrivateProfileIntW(L"debug", L"nodamage", 0, pIniFilename))
-    dword_6BE368_debug_settings_2 |= 0x10;
+    dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_NO_DAMAGE;
   if (GetPrivateProfileIntW(L"debug", L"nodecoration", 0, pIniFilename))
-    dword_6BE368_debug_settings_2 |= 8;
+    dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_NO_DECORATIONS;
 
   wchar_t pStartingMapNameW[1024];
   GetPrivateProfileStringW(L"file", L"startmap", L"out01.odm", pStartingMapNameW, 0x20u, pIniFilename);
@@ -4990,19 +4990,18 @@
 //----- (0046BDC0) --------------------------------------------------------
 void  UpdateUserInput_and_MapSpecificStuff()
 {
-  if ( dword_6BE364_game_settings_1 & 0x80 )
+  if (dword_6BE364_game_settings_1 & GAME_SETTINGS_0080_SKIP_USER_INPUT_THIS_FRAME)
   {
-    LOBYTE(dword_6BE364_game_settings_1) = dword_6BE364_game_settings_1 & 0x7F;
+    dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_0080_SKIP_USER_INPUT_THIS_FRAME;
+    return;
   }
-  else
-  {
+
     if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
       BLV_UpdateUserInputAndOther();
     else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
         ODM_UpdateUserInputAndOther();
 
     area_of_effect__damage_evaluate();
-  }
 }
 
 //----- (0046BFFA) --------------------------------------------------------