changeset 978:9334a8c59c8d

uGameState
author Ritor1
date Thu, 09 May 2013 02:26:04 +0600
parents ac85898f5903
children 8b46828a64f4
files AudioPlayer.h Events.cpp Game.cpp UIHouses.cpp mm7_2.cpp mm7_3.cpp mm7_4.cpp mm7_5.cpp
diffstat 8 files changed, 233 insertions(+), 231 deletions(-) [+]
line wrap: on
line diff
--- a/AudioPlayer.h	Thu May 09 01:33:54 2013 +0600
+++ b/AudioPlayer.h	Thu May 09 02:26:04 2013 +0600
@@ -75,6 +75,7 @@
 {
   SOUND_Invalid = 0,
   SOUND_EnteringAHouse = 0x6,
+  SOUND_7 = 7,
   SOUND_8 = 0x8,
   SOUND_27 = 0x1B,
   SOUND_Button = 66,
--- a/Events.cpp	Thu May 09 01:33:54 2013 +0600
+++ b/Events.cpp	Thu May 09 02:26:04 2013 +0600
@@ -1320,7 +1320,7 @@
 					v133 = 1;
 					if ( pCurrentScreen == SCREEN_HOUSE )
 						{
-						if ( uGameState == 2 )
+						if ( uGameState == GAME_STATE_2 )
 							{
 							pAudioPlayer->StopChannels(-1, -1);
 							dialog_menu_id = HOUSE_DIALOGUE_NULL;
--- a/Game.cpp	Thu May 09 01:33:54 2013 +0600
+++ b/Game.cpp	Thu May 09 02:26:04 2013 +0600
@@ -276,7 +276,7 @@
   {
     pParty->Reset();
     dword_6BE340 = 0;
-    uGameState = 0;
+    uGameState = GAME_STATE_0;
     LoadGame(uLoadGameUI_SelectedSlot);
   }
 
@@ -393,34 +393,34 @@
         viewparams->bRedrawGameUI = true;
       }
       pAudioPlayer->UpdateSounds();
-      if (uGameState == 1)
+      if (uGameState == GAME_FINISHED)
         //goto LABEL_96;
       {
         bLoadinga = 1;
         continue;
       }
-      if (uGameState == 2)
+      if (uGameState == GAME_STATE_2)
       {
         pAudioPlayer->StopChannels(-1, -1);
         PrepareWorld(0);
-        uGameState = 0;
+        uGameState = GAME_STATE_0;
         continue;
       }
-      if ( (signed int)uGameState <= 2 )
+      if ( (signed int)uGameState <= GAME_STATE_2 )
         //goto LABEL_85;
       {
         pGame->Draw();
         continue;
       }
-      if ( (signed int)uGameState <= 5 || uGameState == 7 )
+      if ( (signed int)uGameState <= GAME_STATE_5 || uGameState == GAME_STATE_GAME_QUITTING_TO_MAIN_MENU )
       {
 //LABEL_96:
         bLoadinga = 1;
         continue;
       }
-      if ( uGameState != 8 )
+      if ( uGameState != GAME_STATE_8 )
       {
-        if ( uGameState != 9 )
+        if ( uGameState != GAME_STATE_FINAL_WINDOW )
         {
 //LABEL_85:
           pGame->Draw();
@@ -541,17 +541,17 @@
         pPlayers[v17[v12 % v11]]->PlaySound(SPEECH_99, 0);
       }
       ShowStatusBarString(pGlobalTXT_LocalizationStrings[524], 2u);// "Once again you've cheated death!.." "Вы снова обхитрили смерть! …"
-      uGameState = 0;
+      uGameState = GAME_STATE_0;
     }
     while ( !bLoadinga );
     dword_6BE340 = 0;
     pEventTimer->Pause();
     ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
-    if ( uGameState == 3 )
+    if ( uGameState == GAME_STATE_3 )
     {
       sub_491E3A();
       LoadPlayerPortraintsAndVoices();
-      uGameState = 0;
+      uGameState = GAME_STATE_0;
       pIcons_LOD->dword_11B84 = pIcons_LOD->uNumLoadedFiles;
       bLoading = true;
       continue;
--- a/UIHouses.cpp	Thu May 09 01:33:54 2013 +0600
+++ b/UIHouses.cpp	Thu May 09 02:26:04 2013 +0600
@@ -24,6 +24,7 @@
 #include "Log.h"
 #include "MM7.h"
 #include "mm7_data.h"
+#include "Game.h"
 
 int uHouse_ExitPic; // weak
 
@@ -1902,7 +1903,7 @@
           dword_5B65BC = 0;
           _5B65B4_npcdata_loword_house_or_other = v5->arrival_rot_y;
           v11 = *((int *)v5 + 3);
-          uGameState = 2;
+          uGameState = GAME_STATE_2;
           _5B65A8_npcdata_uflags_or_other = v11;
           _5B65AC_npcdata_fame_or_other = v5->arrival_y;
           _5B65B0_npcdata_rep_or_other = v5->arrival_z;
--- a/mm7_2.cpp	Thu May 09 01:33:54 2013 +0600
+++ b/mm7_2.cpp	Thu May 09 02:26:04 2013 +0600
@@ -9464,7 +9464,7 @@
     while ( 1 )
     {
       MainMenu_Loop();
-      uGameState = 0;
+      uGameState = GAME_STATE_0;
 //LABEL_21:
       while ( 1 )
       {
@@ -9502,7 +9502,7 @@
           if ( uGameState == GAME_STATE_NEWGAME_OUT_GAMEMENU )
           {
             SetCurrentMenuID(MENU_NEWGAME);
-            uGameState = 0;
+            uGameState = GAME_STATE_0;
             continue;
           }
           break;
@@ -9517,7 +9517,7 @@
         }
         if (GetCurrentMenuID() == MENU_5 || GetCurrentMenuID() == MENU_LoadingProcInMainMenu)
         {
-          uGameState = 0;
+          uGameState = GAME_STATE_0;
         }
         else
         {
@@ -9552,24 +9552,24 @@
 //LABEL_48:
         pGame->Loop();
 LABEL_49:
-        if ( uGameState == 3 )
+        if ( uGameState == GAME_STATE_3 )
         {
           v12 = 5;
           SetCurrentMenuID((MENU_STATE)v12);
           //goto LABEL_21;
-          uGameState = 0;
+          uGameState = GAME_STATE_0;
           continue;
         }
         if ( uGameState == GAME_STATE_NEWGAME_OUT_GAMEMENU )
         {
           SetCurrentMenuID(MENU_NEWGAME);
-          uGameState = 0;
+          uGameState = GAME_STATE_0;
           continue;
         }
         if ( uGameState == GAME_STATE_GAME_QUITTING_TO_MAIN_MENU)// from the loaded game
         {
           pAudioPlayer->StopChannels(-1, -1);
-          uGameState = 0;
+          uGameState = GAME_STATE_0;
           break;
         }
       }
--- a/mm7_3.cpp	Thu May 09 01:33:54 2013 +0600
+++ b/mm7_3.cpp	Thu May 09 02:26:04 2013 +0600
@@ -14341,7 +14341,7 @@
   if ( _strcmpi(pCurrentMapName, v2) )
     SaveGame(1, 0);
 
-  uGameState = 2;
+  uGameState = GAME_STATE_2;
   strcpy(pCurrentMapName, v2);
   uLevel_StartingPointType = start_point;
 }
--- a/mm7_4.cpp	Thu May 09 01:33:54 2013 +0600
+++ b/mm7_4.cpp	Thu May 09 02:26:04 2013 +0600
@@ -2794,7 +2794,7 @@
 LABEL_135:
     if ( pCurrentScreen != SCREEN_REST
       && (!v51 || dword_5C35C0) )
-      uGameState = 8;
+      uGameState = GAME_STATE_8;
   }
   if ( uActiveCharacter )
   {
--- a/mm7_5.cpp	Thu May 09 01:33:54 2013 +0600
+++ b/mm7_5.cpp	Thu May 09 02:26:04 2013 +0600
@@ -46,7 +46,7 @@
 //----- (004304E7) --------------------------------------------------------
 void __cdecl GameUI_MsgProc()
 {
-  signed int v0; // edi@6
+  //signed int v0; // edi@6
   char *v1; // esi@6
   unsigned int v2; // edx@7
   Actor *pActor; // ecx@13
@@ -76,8 +76,8 @@
   unsigned int v27; // edx@204
   unsigned int v28; // ecx@204
   GUIWindow *pWindow2; // ecx@248
-  int v30; // edx@258
-  const char *v31; // ecx@262
+  //int v30; // edx@258
+  //const char *v31; // ecx@262
   signed int v32; // eax@269
   unsigned int v33; // eax@277
   unsigned __int8 v34; // al@279
@@ -214,10 +214,10 @@
   //int v165; // [sp+0h] [bp-5FCh]@107
   int v166; // [sp+0h] [bp-5FCh]@121
   int v167; // [sp+0h] [bp-5FCh]@135
-  int v168; // [sp+0h] [bp-5FCh]@149
+  //int v168; // [sp+0h] [bp-5FCh]@149
   int v169; // [sp+0h] [bp-5FCh]@165
   int v170; // [sp+0h] [bp-5FCh]@204
-  signed int v171; // [sp+0h] [bp-5FCh]@259
+  //signed int v171; // [sp+0h] [bp-5FCh]@259
   KeyToggleType pKeyToggleType; // [sp+0h] [bp-5FCh]@287
   char *v173; // [sp+0h] [bp-5FCh]@444
   char *v174; // [sp+0h] [bp-5FCh]@449
@@ -286,7 +286,7 @@
   }
   if ( pMessageQueue_50CBD0->uNumMessages )
   {
-    v0 = 1;
+    //v0 = 1;
     v1 = "";
     while ( 2 )
     {
@@ -297,7 +297,7 @@
       switch ( uMessage )
       {
         case UIMSG_ChangeGameState:
-          uGameState = v0;
+          uGameState = GAME_FINISHED;
           continue;
         case UIMSG_PlayArcomage:
           pVideoPlayer->_4BF5B2();
@@ -307,13 +307,13 @@
         case UIMSG_StartNPCDialogue:
           if ( !uActiveCharacter )
             continue;
-          viewparams->field_48 = v0;
+          viewparams->field_48 = 1;
           if ( pMessageQueue_50CBD0->uNumMessages )
             pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
           dword_5B65D0_dialogue_actor_npc_id = pActors[uMessageParam].sNPC_ID;
           pActor = &pActors[uMessageParam];
           //goto _actor_init_dlg;
-          pActor->InitializeDialogue(v0);
+          pActor->InitializeDialogue(1);
           continue;
         case UIMSG_StartHireling1Dialogue:
         case UIMSG_StartHireling2Dialogue:
@@ -366,7 +366,7 @@
               memset(&actor, 0, 0x344u);
               actor.sNPC_ID += -1 - (unsigned __int8)pParty->field_709 - hireling_idx;
               pActor = &actor;
-              pActor->InitializeDialogue(v0);
+              pActor->InitializeDialogue(1);
             }
           }
           continue;
@@ -394,9 +394,9 @@
             if ( pMessageQueue_50CBD0->uNumMessages )
               pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
             pGUIWindow_CurrentMenu->Release();
-            uGameState = 4;
+            uGameState = GAME_STATE_NEWGAME_OUT_GAMEMENU;
             pCurrentScreen = SCREEN_GAME;
-            viewparams->bRedrawGameUI = v0;
+            viewparams->bRedrawGameUI = 1;
           }
           else
           {
@@ -413,7 +413,7 @@
             pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
           pGUIWindow_CurrentMenu->Release();
           pCurrentScreen = SCREEN_LOADGAME;
-          GameUI_DrawLoadMenu(v0);
+          GameUI_DrawLoadMenu(1);
           continue;
         case UIMSG_Quit:
           if ( dword_6BE138 == 132 || uMessageParam )
@@ -424,10 +424,10 @@
               pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
             pGUIWindow_CurrentMenu->Release();
             pCurrentScreen = SCREEN_GAME;
-            viewparams->bRedrawGameUI = v0;
+            viewparams->bRedrawGameUI = 1;
             if ( !uMessageParam )
               pAudioPlayer->PlaySound((SoundID)(SOUND_EnteringAHouse|0x1), 0, 0, -1, 0, 0, 0, 0);
-            uGameState = 7;
+            uGameState = GAME_STATE_GAME_QUITTING_TO_MAIN_MENU;
           }
           else
           {
@@ -463,7 +463,7 @@
           GUIWindow::Create(241, 302, 106, 42, WINDOW_SaveLoadBtn, (int)pBtnLoadSlot, 0);
           continue;
         case UIMSG_SelectLoadSlot:
-          if ( pGUIWindow_CurrentMenu->field_40 == v0 )
+          if ( pGUIWindow_CurrentMenu->field_40 == 1 )
             pKeyActionMap->_459ED1(0);
           if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != pSaveListPosition + uMessageParam )
           {
@@ -505,12 +505,12 @@
           if ( pSavegameUsedSlots[uLoadGameUI_SelectedSlot] )
           {
             LoadGame(uLoadGameUI_SelectedSlot);
-            uGameState = 3;
+            uGameState = GAME_STATE_3;
           }
           stru_506E40.Release();
           continue;
         case UIMSG_SaveGame:
-          if ( pGUIWindow_CurrentMenu->field_40 == v0 )
+          if ( pGUIWindow_CurrentMenu->field_40 == 1 )
           {
             pKeyActionMap->_459ED1(0);
             strcpy((char *)&pSavegameHeader[uLoadGameUI_SelectedSlot], (const char *)pKeyActionMap->pPressedKeysBuffer);
@@ -527,7 +527,7 @@
           if ( pMessageQueue_50CBD0->uNumMessages )
             pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
           pGUIWindow_CurrentMenu->Release();
-          viewparams->field_48 = v0;
+          viewparams->field_48 = 1;
           pCurrentScreen = SCREEN_OPTIONS;
 
           options_menu_skin.uTextureID_Background     = pIcons_LOD->LoadTexture("ControlBG", TEXTURE_16BIT_PALETTE);
@@ -555,48 +555,48 @@
           pGUIWindow_CurrentMenu->CreateButton(22, 270,
                                                pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])->uTextureWidth,
                                                pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])->uTextureHeight,
-                                               v0, 0, UIMSG_SetTurnSpeed, 0x80, 0, v1, 0);
+                                               1, 0, UIMSG_SetTurnSpeed, 0x80, 0, v1, 0);
           pGUIWindow_CurrentMenu->CreateButton(93, 270,
                                                pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])->uTextureWidth,
                                                pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])->uTextureHeight,
-                                               v0, 0, UIMSG_SetTurnSpeed, 0x40u, 0, v1, 0);
+                                               1, 0, UIMSG_SetTurnSpeed, 0x40u, 0, v1, 0);
           pGUIWindow_CurrentMenu->CreateButton(164, 270,
                                                pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])->uTextureWidth,
                                                pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])->uTextureHeight,
-                                               v0, 0, UIMSG_SetTurnSpeed, 0, 0, v1, 0);
+                                               1, 0, UIMSG_SetTurnSpeed, 0, 0, v1, 0);
 
           pGUIWindow_CurrentMenu->CreateButton(20, 303,
                                                pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)->uTextureWidth,
                                                pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)->uTextureHeight,
-                                               v0, 0, UIMSG_ToggleWalkSound, 0, 0, v1, 0);
+                                               1, 0, UIMSG_ToggleWalkSound, 0, 0, v1, 0);
           pGUIWindow_CurrentMenu->CreateButton(128, 303,
                                                pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)->uTextureWidth,
                                                pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)->uTextureHeight,
-                                               v0, 0, UIMSG_ToggleShowDamage, 0, 0, v1, 0);
+                                               1, 0, UIMSG_ToggleShowDamage, 0, 0, v1, 0);
           pGUIWindow_CurrentMenu->CreateButton(20, 325,
                                                pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)->uTextureWidth,
                                                pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)->uTextureHeight,
-                                               v0, 0, UIMSG_ToggleAlwaysRun, 0, 0, v1, 0);
+                                               1, 0, UIMSG_ToggleAlwaysRun, 0, 0, v1, 0);
           pGUIWindow_CurrentMenu->CreateButton(128, 325,
                                                pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)->uTextureWidth,
                                                pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)->uTextureHeight,
-                                               v0, 0, UIMSG_ToggleFlipOnExit, 0, 0, v1, 0);
-
-          pBtn_SliderLeft  = pGUIWindow_CurrentMenu->CreateButton(243, 162, 16, 16, v0, 0, UIMSG_ChangeSoundVolume, 4, 0, v1, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0);
-          pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 162, 16, 16, v0, 0, UIMSG_ChangeSoundVolume, 5, 0, v1, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0);
-          pGUIWindow_CurrentMenu->CreateButton(263, 162, 172, 17, v0, 0, UIMSG_ChangeSoundVolume, 0, 0, v1, 0);
-
-          pBtn_SliderLeft  = pGUIWindow_CurrentMenu->CreateButton(243, 216, 16, 16, v0, 0, UIMSG_ChangeMusicVolume, 4, 0, v1, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0);
-          pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 216, 16, 16, v0, 0, UIMSG_ChangeMusicVolume, 5, 0, v1, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0);
-          pGUIWindow_CurrentMenu->CreateButton(263, 216, 172, 17, v0, 0, UIMSG_ChangeMusicVolume, 0, 0, v1, 0);
-
-          pBtn_SliderLeft  = pGUIWindow_CurrentMenu->CreateButton(243, 270, 16, 16, v0, 0, UIMSG_ChangeVoiceVolume, 4, 0, v1, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0);
-          pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 270, 16, 16, v0, 0, UIMSG_ChangeVoiceVolume, 5, 0, v1, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0);
-          pGUIWindow_CurrentMenu->CreateButton(263, 270, 172, 17, v0, 0, UIMSG_ChangeVoiceVolume, 0, 0, v1, 0);
-
-          pGUIWindow_CurrentMenu->CreateButton(241, 302, 214, 40, v0, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[619], 0); // "Return to Game"
-          pGUIWindow_CurrentMenu->CreateButton( 19, 140, 214, 40, v0, 0, UIMSG_OpenKeyMappingOptions, 0, 0x4Bu, v1, 0);
-          pGUIWindow_CurrentMenu->CreateButton( 19, 194, 214, 40, v0, 0, UIMSG_OpenVideoOptions, 0, 86, v1, 0);
+                                               1, 0, UIMSG_ToggleFlipOnExit, 0, 0, v1, 0);
+
+          pBtn_SliderLeft  = pGUIWindow_CurrentMenu->CreateButton(243, 162, 16, 16, 1, 0, UIMSG_ChangeSoundVolume, 4, 0, v1, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0);
+          pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 162, 16, 16, 1, 0, UIMSG_ChangeSoundVolume, 5, 0, v1, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0);
+          pGUIWindow_CurrentMenu->CreateButton(263, 162, 172, 17, 1, 0, UIMSG_ChangeSoundVolume, 0, 0, v1, 0);
+
+          pBtn_SliderLeft  = pGUIWindow_CurrentMenu->CreateButton(243, 216, 16, 16, 1, 0, UIMSG_ChangeMusicVolume, 4, 0, v1, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0);
+          pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 216, 16, 16, 1, 0, UIMSG_ChangeMusicVolume, 5, 0, v1, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0);
+          pGUIWindow_CurrentMenu->CreateButton(263, 216, 172, 17, 1, 0, UIMSG_ChangeMusicVolume, 0, 0, v1, 0);
+
+          pBtn_SliderLeft  = pGUIWindow_CurrentMenu->CreateButton(243, 270, 16, 16, 1, 0, UIMSG_ChangeVoiceVolume, 4, 0, v1, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0);
+          pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 270, 16, 16, 1, 0, UIMSG_ChangeVoiceVolume, 5, 0, v1, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0);
+          pGUIWindow_CurrentMenu->CreateButton(263, 270, 172, 17, 1, 0, UIMSG_ChangeVoiceVolume, 0, 0, v1, 0);
+
+          pGUIWindow_CurrentMenu->CreateButton(241, 302, 214, 40, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[619], 0); // "Return to Game"
+          pGUIWindow_CurrentMenu->CreateButton( 19, 140, 214, 40, 1, 0, UIMSG_OpenKeyMappingOptions, 0, 0x4Bu, v1, 0);
+          pGUIWindow_CurrentMenu->CreateButton( 19, 194, 214, 40, 1, 0, UIMSG_OpenVideoOptions, 0, 86, v1, 0);
           continue;
 
         case UIMSG_OpenKeyMappingOptions://Open
@@ -636,7 +636,7 @@
           //*(_WORD *)KeyButtonArray[28] = 0;
           memcpy(pPrevVirtualCidesMapping, pKeyActionMap->pVirtualKeyCodesMapping, 0x78u);
           v1 = "";
-          v0 = 1;
+          //v0 = 1;
           continue;
         case UIMSG_ChangeKeyButton:
           if ( dword_506E68 != -1 )
@@ -645,10 +645,10 @@
             continue;
           }
           v14 = uMessageParam;
-          if ( KeyboardPageNum != v0 )
+          if ( KeyboardPageNum != 1 )
             v14 = uMessageParam + 14;
           dword_506E68 = v14;
-          pKeyActionMap->EnterText(0, v0, pGUIWindow_CurrentMenu);
+          pKeyActionMap->EnterText(0, 1, pGUIWindow_CurrentMenu);
           continue;
         case UIMSG_ResetKeyMapping:
           v197 = 1;
@@ -662,7 +662,7 @@
               if ( v197 )
               {
                 v16 = pKeyActionMap->GetActionVKey((enum InputAction)uAction);
-                GUI_ReplaceHotkey(LOBYTE(pPrevVirtualCidesMapping[uAction]), v16, v0);
+                GUI_ReplaceHotkey(LOBYTE(pPrevVirtualCidesMapping[uAction]), v16, 1);
                 v197 = 0;
               }
               else
@@ -681,7 +681,7 @@
           pAudioPlayer->PlaySound((SoundID)219, 0, 0, -1, 0, 0, 0, 0);
           continue;
         case UIMSG_SelectKeyPage1:
-          KeyboardPageNum = v0;
+          KeyboardPageNum = 1;
           continue;
         case UIMSG_SelectKeyPage2:
           KeyboardPageNum = 2;
@@ -690,7 +690,7 @@
           if ( pMessageQueue_50CBD0->uNumMessages )
             pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
           pGUIWindow_CurrentMenu->Release();
-          viewparams->field_48 = v0;
+          viewparams->field_48 = 1;
           pCurrentScreen = SCREEN_VIDEO_OPTIONS;
           uTextureID_507C10 = pIcons_LOD->LoadTexture("optvid", TEXTURE_16BIT_PALETTE);
           uTextureID_507C14 = pIcons_LOD->LoadTexture("opvdH-bs", TEXTURE_16BIT_PALETTE);
@@ -712,16 +712,16 @@
           uTextureID_507C54 = pIcons_LOD->LoadTexture("opvdG-cl", TEXTURE_16BIT_PALETTE);
           uTextureID_507C58 = pIcons_LOD->LoadTexture("opvdG-tn", TEXTURE_16BIT_PALETTE);
           pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_VideoOptions, 0, 0);
-          pGUIWindow_CurrentMenu->CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, v0, 0, UIMSG_Escape, 0, 0, v1, 0);
+          pGUIWindow_CurrentMenu->CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, 1, 0, UIMSG_Escape, 0, 0, v1, 0);
           if ( pRenderer->pRenderD3D )
           {
-            pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x118u, 0xD6u, 0x12u, v0, 0, UIMSG_ToggleBloodsplats, 0, 0, v1, 0);
-            pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x12Eu, 0xD6u, 0x12u, v0, 0, UIMSG_ToggleColoredLights, 0, 0, v1, 0);
-            pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x144u, 0xD6u, 0x12u, v0, 0, UIMSG_ToggleTint, 0, 0, v1, 0);
+            pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x118u, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleBloodsplats, 0, 0, v1, 0);
+            pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x12Eu, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleColoredLights, 0, 0, v1, 0);
+            pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x144u, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleTint, 0, 0, v1, 0);
           }
           if ( !pRenderer->bWindowMode )
           {
-            v0 = 1;
+            //v0 = 1;
             if ( GammaController::IsGammaSupported() )
             {
               pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(0x15u, 0xA1u, 0x10u, 0x10u, 1, 0, UIMSG_1A9, 4u, 0, v1, pIcons_LOD->GetTexture(uTextureID_507C20), 0);
@@ -742,7 +742,7 @@
             }
             v19 = (double)(signed int)uGammaPos * 0.1 + 0.6;
             pGame->pGammaController->Initialize(v19);
-            GUIWindow::Create(21, 161, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, v0);
+            GUIWindow::Create(21, 161, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, 1);
             pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0);
             continue;
           }
@@ -753,7 +753,7 @@
             {
               v21 = (double)(signed int)uGammaPos * 0.1 + 0.6;
               pGame->pGammaController->Initialize(v21);
-              GUIWindow::Create(213, 161, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, v0);
+              GUIWindow::Create(213, 161, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, 1);
               pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0);
               continue;
             }
@@ -782,7 +782,7 @@
             --uMusicVolimeMultiplier;
             if ( (char)uMusicVolimeMultiplier < 1 )
               uMusicVolimeMultiplier = 0;
-            GUIWindow::Create(243, 0xD8u, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, v0);
+            GUIWindow::Create(243, 0xD8u, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, 1);
             if ( uMusicVolimeMultiplier )
               pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f, 0);
             pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f);
@@ -793,7 +793,7 @@
             ++uMusicVolimeMultiplier;
             if ( (char)uMusicVolimeMultiplier > 9 )
               uMusicVolimeMultiplier = 9;
-            GUIWindow::Create(435, 0xD8u, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, v0);
+            GUIWindow::Create(435, 0xD8u, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, 1);
             if ( uMusicVolimeMultiplier )
               pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f, 0);
             pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f);
@@ -812,7 +812,7 @@
             --uSoundVolumeMultiplier;
             if ( (char)uSoundVolumeMultiplier < 1 )
               uSoundVolumeMultiplier = 0;
-            GUIWindow::Create(243, 162, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, v0);
+            GUIWindow::Create(243, 162, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, 1);
             pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f);
             pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0);
             continue;
@@ -822,10 +822,10 @@
             ++uSoundVolumeMultiplier;
             if ( (char)uSoundVolumeMultiplier > 8 )
               uSoundVolumeMultiplier = 9;
-            v168 = v0;
+            //v168 = 1;
             v24 = 435;
             //v154 = (int)pBtn_SliderRight;
-            GUIWindow::Create(v24, 0xA2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, v168);
+            GUIWindow::Create(v24, 0xA2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, 1);
             pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f);
             pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0);
             continue;
@@ -854,7 +854,7 @@
             --uVoicesVolumeMultiplier;
             if ( (char)uVoicesVolumeMultiplier < 1 )
               uVoicesVolumeMultiplier = 0;
-            GUIWindow::Create(243, 270, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, v0);
+            GUIWindow::Create(243, 270, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, 1);
             if ( !uVoicesVolumeMultiplier )
               continue;
             pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
@@ -865,7 +865,7 @@
             ++uVoicesVolumeMultiplier;
             if ( (char)uVoicesVolumeMultiplier > 8 )
               uVoicesVolumeMultiplier = 9;
-            GUIWindow::Create(435, 270, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, v0);
+            GUIWindow::Create(435, 270, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, 1);
             if ( !uVoicesVolumeMultiplier )
               continue;
             pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
@@ -911,7 +911,7 @@
           pGUIWindow_CurrentMenu->Release();
           pEventTimer->Resume();
           pCurrentScreen = SCREEN_GAME;
-          viewparams->bRedrawGameUI = v0;
+          viewparams->bRedrawGameUI = 1;
           stru_506E40.Release();
           continue;
         case UIMSG_OpenQuestBook:
@@ -980,7 +980,7 @@
               if ( dword_50CDC8 )
                 goto LABEL_232;
               CloseWindowBackground();
-              uMessageParam = v0;
+              uMessageParam = 1;
               goto LABEL_232;
             }
           }
@@ -991,22 +991,22 @@
               if ( dword_50CDC8 )
                 goto LABEL_232;
               CloseWindowBackground();
-              uMessageParam = v0;
+              uMessageParam = 1;
               goto LABEL_232;
             }
             if ( pCurrentScreen == SCREEN_HOUSE && !dword_50CDC8 && !dword_5C35C8 )
             {
               CloseWindowBackground();
               dword_5C35C8 = 0;
-              uMessageParam = v0;
+              uMessageParam = 1;
             }
           }
 LABEL_232:
           if ( !ptr_507BDC )
           {
             pRenderer->ClearZBuffer(0, 479);
-            viewparams->bRedrawGameUI = v0;
-            viewparams->field_48 = v0;
+            viewparams->bRedrawGameUI = 1;
+            viewparams->field_48 = 1;
             if ( pCurrentScreen )
             {
               if ( pCurrentScreen > SCREEN_67 )
@@ -1055,7 +1055,7 @@
                          back_to_game();
                         }
                        }
-                       if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 )
+                       if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
                        uActiveCharacter = pParty->GetNextActiveCharacter();
                        pGUIWindow_CurrentMenu->Release();
                        if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
@@ -1063,7 +1063,7 @@
                        pGUIWindow_CurrentMenu = 0;
                        pEventTimer->Resume();
                        pCurrentScreen = SCREEN_GAME;
-                       viewparams->bRedrawGameUI = v0;
+                       viewparams->bRedrawGameUI = 1;
                        pIcons_LOD->_4355F7();
                        continue;
                     case SCREEN_BOOKS:
@@ -1087,7 +1087,7 @@
                          back_to_game();
                         }
                       }
-                      if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 )
+                      if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
                         uActiveCharacter = pParty->GetNextActiveCharacter();
                       pGUIWindow_CurrentMenu->Release();
                       if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
@@ -1095,7 +1095,7 @@
                       pGUIWindow_CurrentMenu = 0;
                       pEventTimer->Resume();
                       pCurrentScreen = SCREEN_GAME;
-                      viewparams->bRedrawGameUI = v0;
+                      viewparams->bRedrawGameUI = 1;
                       pIcons_LOD->_4355F7();
                       continue;
                     case SCREEN_SAVEGAME:
@@ -1112,7 +1112,7 @@
                       pWindow2->Release();
                       pIcons_LOD->_4114F2();
                       pCurrentScreen = SCREEN_GAME;
-                      viewparams->bRedrawGameUI = v0;
+                      viewparams->bRedrawGameUI = 1;
                       pEventTimer->Resume();
                       continue;
                     case SCREEN_19:
@@ -1120,7 +1120,7 @@
                       pWindow2->Release();
                       pIcons_LOD->_4114F2();
                       pCurrentScreen = SCREEN_GAME;
-                      viewparams->bRedrawGameUI = v0;
+                      viewparams->bRedrawGameUI = 1;
                       pEventTimer->Resume();
                       continue;
                     case SCREEN_OPTIONS://Close
@@ -1137,19 +1137,19 @@
                       WriteWindowsRegistryInt("FlipOnExit", bFlipOnExit);
                       if ( !uTurnSpeed )
                       {
-                        v171 = 3;
-                        v30 = v171;
-                        v31 = "TurnDelta";
-                        WriteWindowsRegistryInt(v31, v30);
+                        //v171 = 3;
+                        //v30 = v171;
+                        //v31 = "TurnDelta";
+                        WriteWindowsRegistryInt("TurnDelta", 3);
                         stru_506E40.Release();
                         break;
                       }
                       if ( uTurnSpeed == 64 )
                       {
-                        v171 = 2;
-                        v30 = v171;
-                        v31 = "TurnDelta";
-                        WriteWindowsRegistryInt(v31, v30);
+                        //v171 = 2;
+                        //v30 = v171;
+                        //v31 = "TurnDelta";
+                        WriteWindowsRegistryInt("TurnDelta", 2);
                         stru_506E40.Release();
                         break;
                       }
@@ -1158,9 +1158,9 @@
                           stru_506E40.Release();
                           break;
                         }
-                      v30 = v0;
-                      v31 = "TurnDelta";
-                      WriteWindowsRegistryInt(v31, v30);
+                      //v30 = v0;
+                      //v31 = "TurnDelta";
+                      WriteWindowsRegistryInt("TurnDelta", 1);
                       stru_506E40.Release();
                       break;
                     case SCREEN_MENU:
@@ -1182,9 +1182,9 @@
                           stru_506E40.Release();
                           break;
                         }
-                      v30 = uGammaPos;
-                      v31 = "GammaPos";
-                      WriteWindowsRegistryInt(v31, v30);
+                      //v30 = uGammaPos;
+                      //v31 = "GammaPos";
+                      WriteWindowsRegistryInt("GammaPos", uGammaPos);
                       stru_506E40.Release();
                       break;
                     case SCREEN_KEYBOARD_OPTIONS://Return to game
@@ -1214,7 +1214,7 @@
                               if ( v197 )
                               {
                                 v34 = pKeyActionMap->GetActionVKey((enum InputAction)uAction);
-                                GUI_ReplaceHotkey(v34, LOBYTE(pPrevVirtualCidesMapping[uAction]), v0);
+                                GUI_ReplaceHotkey(v34, LOBYTE(pPrevVirtualCidesMapping[uAction]), 1);
                                 v197 = 0;
                               }
                               else
@@ -1223,8 +1223,8 @@
                                 GUI_ReplaceHotkey(v35, LOBYTE(pPrevVirtualCidesMapping[uAction]), 0);
                               }
                             }
-                            if ( uAction && uAction != 2 && uAction != 3 && uAction != v0 && uAction != 25 && uAction != 26 )
-                              pKeyToggleType = (KeyToggleType)v0;
+                            if ( uAction && uAction != 2 && uAction != 3 && uAction != 1 && uAction != 25 && uAction != 26 )
+                              pKeyToggleType = (KeyToggleType)1;
                             else
                               pKeyToggleType = (KeyToggleType)0;
                             pKeyActionMap->SetKeyMapping(uAction, pPrevVirtualCidesMapping[uAction], pKeyToggleType);
@@ -1254,7 +1254,7 @@
                       pIcons_LOD->_4114F2();
                       _506F18_num_hours_to_sleep = 0;
                       dword_506F14 = 0;
-                      dword_507B94 = v0;
+                      dword_507B94 = 1;
                       if ( pGUIWindow_Settings )
                       {
                         if ( pCurrentScreen == SCREEN_CHARACTERS )
@@ -1271,7 +1271,7 @@
                           back_to_game();
                          }
                        }
-                       if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 )
+                       if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
                         uActiveCharacter = pParty->GetNextActiveCharacter();
                        pGUIWindow_CurrentMenu->Release();
                        if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
@@ -1279,7 +1279,7 @@
                        pGUIWindow_CurrentMenu = 0;
                        pEventTimer->Resume();
                        pCurrentScreen = SCREEN_GAME;
-                       viewparams->bRedrawGameUI = v0;
+                       viewparams->bRedrawGameUI = 1;
                        pIcons_LOD->_4355F7();
                        continue;
                     case SCREEN_E:
@@ -1290,7 +1290,7 @@
                     case SCREEN_HOUSE:
                       if ( uDialogueType )
                         uDialogueType = 0;
-                      if ( uGameState == 2 )
+                      if ( uGameState == GAME_STATE_2 )
                       {
                         while ( sub_4BD8B5() )
                           ;
@@ -1301,7 +1301,7 @@
                           continue;
                       }
                       sub_4B1D27();
-                      pAudioPlayer->PlaySound((SoundID)(SOUND_EnteringAHouse|0x1), 814, 0, -1, 0, 0, 0, 0);
+                      pAudioPlayer->PlaySound(SOUND_7, 814, 0, -1, 0, 0, 0, 0);
                       pVideoPlayer->Unload();
                       pGUIWindow_CurrentMenu = window_SpeakInHouse;
                       if ( pGUIWindow_Settings )
@@ -1320,7 +1320,7 @@
                           back_to_game();
                         }
                       }
-                      if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 )
+                      if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
                         uActiveCharacter = pParty->GetNextActiveCharacter();
                       pGUIWindow_CurrentMenu->Release();
                       if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
@@ -1328,7 +1328,7 @@
                       pGUIWindow_CurrentMenu = 0;
                       pEventTimer->Resume();
                       pCurrentScreen = SCREEN_GAME;
-                      viewparams->bRedrawGameUI = v0;
+                      viewparams->bRedrawGameUI = 1;
                       pIcons_LOD->_4355F7();
                       continue;
                     case SCREEN_INPUT_BLV:
@@ -1340,7 +1340,7 @@
                         pParty->field_709 = 0;
                         LOBYTE(pNPCStats->pNewNPCData[dword_5B65CC].uFlags) &= 0x7Fu;
                         Party__CountHirelings();
-                        viewparams->bRedrawGameUI = v0;
+                        viewparams->bRedrawGameUI = 1;
                         dword_5B65CC = 0;
                       }
                       goto LABEL_317;
@@ -1350,7 +1350,7 @@
                         pParty->field_709 = 0;
                         LOBYTE(pNPCStats->pNewNPCData[dword_5B65CC].uFlags) &= 0x7Fu;
                         Party__CountHirelings();
-                        viewparams->bRedrawGameUI = v0;
+                        viewparams->bRedrawGameUI = 1;
                         dword_5B65CC = 0;
                       }
                       goto LABEL_317;
@@ -1390,7 +1390,7 @@
                           back_to_game();
                         }
                       }
-                      if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 )
+                      if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
                         uActiveCharacter = pParty->GetNextActiveCharacter();
                       pGUIWindow_CurrentMenu->Release();
                       if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
@@ -1398,7 +1398,7 @@
                       pGUIWindow_CurrentMenu = 0;
                       pEventTimer->Resume();
                       pCurrentScreen = SCREEN_GAME;
-                      viewparams->bRedrawGameUI = v0;
+                      viewparams->bRedrawGameUI = 1;
                       pIcons_LOD->_4355F7();
                       continue;
                   }
@@ -1418,7 +1418,7 @@
                       back_to_game();
                     }
                   }
-                  if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 )
+                  if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
                     uActiveCharacter = pParty->GetNextActiveCharacter();
                   pGUIWindow_CurrentMenu->Release();
                   if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
@@ -1426,7 +1426,7 @@
                   pGUIWindow_CurrentMenu = 0;
                   pEventTimer->Resume();
                   pCurrentScreen = SCREEN_GAME;
-                  viewparams->bRedrawGameUI = v0;
+                  viewparams->bRedrawGameUI = 1;
                   pIcons_LOD->_4355F7();
                   continue;
                 }
@@ -1452,7 +1452,7 @@
                   back_to_game();
                 }
               }
-              if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 )
+              if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
                 uActiveCharacter = pParty->GetNextActiveCharacter();
               pGUIWindow_CurrentMenu->Release();
               if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
@@ -1460,7 +1460,7 @@
               pGUIWindow_CurrentMenu = 0;
               pEventTimer->Resume();
               pCurrentScreen = SCREEN_GAME;
-              viewparams->bRedrawGameUI = v0;
+              viewparams->bRedrawGameUI = 1;
               pIcons_LOD->_4355F7();
               continue;
             }
@@ -1468,11 +1468,11 @@
             if ( !pGUIWindow_Settings )//Draw Menu
             {
               dword_6BE138 = -1;
-              GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_GameSettings, v0);
+              GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_GameSettings, 1);
               pEventTimer->Pause();
               pAudioPlayer->StopChannels(-1, -1);
               ++pIcons_LOD->uTexturePacksCount;
-              pCurrentScreen = v0;
+              pCurrentScreen = 1;
               if ( !pIcons_LOD->uNumPrevLoadedFiles )
                 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
               pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_OptionsButtons, 0, 0);
@@ -1483,26 +1483,26 @@
               uTextureID_Controls1 = pIcons_LOD->LoadTexture("controls1", TEXTURE_16BIT_PALETTE);
               uTextureID_Resume1 = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE);
               uTextureID_Quit1 = pIcons_LOD->LoadTexture("quit1", TEXTURE_16BIT_PALETTE);
-              pBtn_NewGame = pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x9Bu, 0xD6u, 0x28u, v0, 0, UIMSG_StartNewGame, 0, 0x4Eu,
+              pBtn_NewGame = pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x9Bu, 0xD6u, 0x28u, 1, 0, UIMSG_StartNewGame, 0, 0x4Eu,
                              pGlobalTXT_LocalizationStrings[614],// "New Game"
                              pIcons_LOD->GetTexture(uTextureID_New1), 0);
-              pBtn_SaveGame = pGUIWindow_CurrentMenu->CreateButton(0x13u, 0xD1u, 0xD6u, 0x28u, v0, 0, UIMSG_Game_OpenSaveGameDialog, 0, 0x53u,
+              pBtn_SaveGame = pGUIWindow_CurrentMenu->CreateButton(0x13u, 0xD1u, 0xD6u, 0x28u, 1, 0, UIMSG_Game_OpenSaveGameDialog, 0, 0x53u,
                              pGlobalTXT_LocalizationStrings[615],// "Save Game"
                              pIcons_LOD->GetTexture(uTextureID_Save1), 0);
-              pBtn_LoadGame = pGUIWindow_CurrentMenu->CreateButton(19, 263, 0xD6u, 0x28u, v0, 0, UIMSG_Game_OpenLoadGameDialog, 0, 0x4Cu,
+              pBtn_LoadGame = pGUIWindow_CurrentMenu->CreateButton(19, 263, 0xD6u, 0x28u, 1, 0, UIMSG_Game_OpenLoadGameDialog, 0, 0x4Cu,
                              pGlobalTXT_LocalizationStrings[616],// "Load Game"
                              pIcons_LOD->GetTexture(uTextureID_Load1), 0);
-              pBtn_GameControls = pGUIWindow_CurrentMenu->CreateButton(241, 155, 214, 40, v0, 0, UIMSG_Game_OpenOptionsDialog, 0, 0x43u,
+              pBtn_GameControls = pGUIWindow_CurrentMenu->CreateButton(241, 155, 214, 40, 1, 0, UIMSG_Game_OpenOptionsDialog, 0, 0x43u,
                              pGlobalTXT_LocalizationStrings[617],// ""Sound, Keyboard, Game Options:""
                              pIcons_LOD->GetTexture(uTextureID_Controls1), 0);
-              pBtn_QuitGame = pGUIWindow_CurrentMenu->CreateButton(241, 209, 214, 40, v0, 0, UIMSG_Quit, 0, 0x51u,
+              pBtn_QuitGame = pGUIWindow_CurrentMenu->CreateButton(241, 209, 214, 40, 1, 0, UIMSG_Quit, 0, 0x51u,
                              pGlobalTXT_LocalizationStrings[618],// "Quit"
                              pIcons_LOD->GetTexture(uTextureID_Quit1), 0);
-              pBtn_Resume = pGUIWindow_CurrentMenu->CreateButton(241, 263, 214, 40, v0, 0, UIMSG_GameMenu_ReturnToGame, 0, 0x52u,
+              pBtn_Resume = pGUIWindow_CurrentMenu->CreateButton(241, 263, 214, 40, 1, 0, UIMSG_GameMenu_ReturnToGame, 0, 0x52u,
                              pGlobalTXT_LocalizationStrings[619],// "Return to Game"
                              pIcons_LOD->GetTexture(uTextureID_Resume1), 0);
-              pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(6, v0, 0, 0);
-              viewparams->field_48 = v0;
+              pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(6, 1, 0, 0);
+              viewparams->field_48 = 1;
               stru_506E40.Release();
               uNumSeconds = (unsigned int)MakeScreenshot(155, 117);
               pRenderer->SavePCXImage("gamma.pcx", (char *)uNumSeconds, 155, 117);
@@ -1547,12 +1547,12 @@
         case UIMSG_TransitionUI_Confirm:
           if ( pMessageQueue_50CBD0->uNumMessages )
             pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
-          dword_50CDC8 = v0;
+          dword_50CDC8 = 1;
           sub_42FBDD();
           PlayHouseSound(uCurrentHouse_Animation, HouseSound_NotEnoughMoney_TrainingSuccessful);
           pVideoPlayer->Unload();
           DialogueEnding();
-          viewparams->bRedrawGameUI = v0;
+          viewparams->bRedrawGameUI = 1;
           if ( dword_59117C_teleportx | dword_591178_teleporty | dword_591174_teleportz | dword_591170_teleport_directiony | dword_59116C_teleport_directionx | dword_591168_teleport_speedz )
           {
             if ( dword_59117C_teleportx )
@@ -1599,7 +1599,7 @@
           else
           {
             start_event_seq_number = dword_5C341C;
-            EventProcessor(dword_5C3418, 0, v0);
+            EventProcessor(dword_5C3418, 0, 1);
           }
           start_event_seq_number = 0;
           if ( !_strcmpi(byte_6BE3B0, "d05.blv") )
@@ -1610,24 +1610,24 @@
           pVideoPlayer->Unload();
           DialogueEnding();
           start_event_seq_number = 0;
-          viewparams->bRedrawGameUI = v0;
+          viewparams->bRedrawGameUI = 1;
           continue;
         case UIMSG_CycleCharacters:
           v39 = GetAsyncKeyState(VK_SHIFT);
           uActiveCharacter = CycleCharacter(v39);
-          viewparams->bRedrawGameUI = v0;
+          viewparams->bRedrawGameUI = 1;
           continue;
         case UIMSG_OnTravelByFoot:
           if ( pMessageQueue_50CBD0->uNumMessages )
             pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
-          dword_50CDC8 = v0;
+          dword_50CDC8 = 1;
           sub_42FBDD();
           pNPCData4 = (NPCData *)GetTravelTime();
           strcpy(pOutdoor->pLevelFilename, pCurrentMapName);
           if ( bUnderwater != 1 && pParty->bFlying
-            || pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pOut, 20) != v0 )
-          {
-            viewparams->bRedrawGameUI = v0;
+            || pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pOut, 20) != 1 )
+          {
+            viewparams->bRedrawGameUI = 1;
 LABEL_387:
             CloseWindowBackground();
             if ( pParty->vPosition.x < -22528 )
@@ -1646,12 +1646,12 @@
           {
             pParty->field_6E4 = 0;
             pParty->field_6E0 = 0;
-            pCastSpellInfo->_427D48(v0);
+            pCastSpellInfo->_427D48(1);
             DialogueEnding();
             pEventTimer->Pause();
             pGameLoadingUI_ProgressBar->Initialize(GUIProgressBar::TYPE_Box);
             ++pGameLoadingUI_ProgressBar->uProgressMax;
-            SaveGame(v0, 0);
+            SaveGame(1, 0);
             pGameLoadingUI_ProgressBar->Progress();
             RestAndHeal(1440 * (signed int)pNPCData4);
             if ( pParty->uNumFoodRations )
@@ -1662,7 +1662,7 @@
                 pPlayer7 = pParty->pPlayers;
                 do
                 {
-                  pPlayer7->SetCondition(v0, 0);
+                  pPlayer7->SetCondition(1, 0);
                   ++pPlayer7;
                 }
                 while ( (signed int)pPlayer7 < (signed int)pParty->pHirelings );
@@ -1675,7 +1675,7 @@
               pPlayer8 = pParty->pPlayers;
               do
               {
-                pPlayer8->SetCondition(v0, 0);
+                pPlayer8->SetCondition(1, 0);
                 ++pPlayer8;
               }
               while ( (signed int)pPlayer8 < (signed int)pParty->pHirelings );
@@ -1701,7 +1701,7 @@
             }
             if ( !_strcmpi(pCurrentMapName, "out15.odm") || !_strcmpi(pCurrentMapName, "d47.blv") )
               bNoNPCHiring = 1;
-            v0 = 1;
+            //v0 = 1;
             PrepareToLoadODM(1u, (OutdoorCamera *)1);
             pAudioPlayer->SetMapEAX();
             bDialogueUI_InitializeActor_NPC_ID = 0;
@@ -1716,7 +1716,7 @@
             pCurrentScreen = SCREEN_GAME;
             pGameLoadingUI_ProgressBar->Release();
           }
-          viewparams->bRedrawGameUI = v0;
+          viewparams->bRedrawGameUI = 1;
           continue;
         case UIMSG_5B:
           goto LABEL_387;
@@ -1781,7 +1781,7 @@
           {
             if ( v45 != 6 )
               continue;
-            if ( uCurrentlyLoadedLevelType != v0 )
+            if ( uCurrentlyLoadedLevelType != 1 )
             {
               pODMFace = &pOutdoor->pBModels[v44 >> 9].pFaces[v46 & 0x3F];
               if ( !(pODMFace->uAttributes & 0x02000000) || !pODMFace->sCogTriggeredID )
@@ -1833,7 +1833,7 @@
           if ( unk_50C9A0 )
           {
             uActiveCharacter = uMessageParam;
-            viewparams->bRedrawGameUI = v0;
+            viewparams->bRedrawGameUI = 1;
           }
           else
           {
@@ -1864,12 +1864,12 @@
           }
           continue;
         case UIMSG_BF:
-          dword_50CDC8 = v0;
+          dword_50CDC8 = 1;
           sub_42FBDD();
-          SaveGame(v0, 0);
+          SaveGame(1, 0);
           strcpy(pCurrentMapName, pMapStats->pInfos[uHouse_ExitPic].pFilename);
-          dword_6BE364_game_settings_1 |= v0;
-          uGameState = 2;
+          dword_6BE364_game_settings_1 |= 1;
+          uGameState = GAME_STATE_2;
           //v53 = p2DEvents_minus1_::30[26 * (unsigned int)ptr_507BC0->ptr_1C];
           v53 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1]._quest_related;
           if ( v53 < 0 )
@@ -1895,7 +1895,7 @@
             *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
             ++pMessageQueue_50CBD0->uNumMessages;
           }*/
-          pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v0, 0);
+          pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
           continue;
 
         case UIMSG_OnCastTownPortal:
@@ -1943,7 +1943,7 @@
           sub_41C0B8_set_status_string(pTmpBuf);
           continue;
         case UIMSG_CloseAfterInstallBeacon:
-          dword_50CDC8 = v0;
+          dword_50CDC8 = 1;
           //goto LABEL_453;
           pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
           /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
@@ -1976,17 +1976,17 @@
           {
             if ( _strcmpi(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[HIWORD(pNPCData4->uProfession)]) )
             {
-              SaveGame(v0, 0);
+              SaveGame(1, 0);
               OnMapLeave();
               strcpy(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[HIWORD(pNPCData4->uProfession)]);
-              dword_6BE364_game_settings_1 |= v0;
-              uGameState = 2;
+              dword_6BE364_game_settings_1 |= 1;
+              uGameState = GAME_STATE_2;
               _5B65A8_npcdata_uflags_or_other = pNPCData4->uFlags;
               _5B65AC_npcdata_fame_or_other = pNPCData4->fame;
               _5B65B0_npcdata_rep_or_other = pNPCData4->rep;
               _5B65B4_npcdata_loword_house_or_other = LOWORD(pNPCData4->Location2D);
               _5B65B8_npcdata_hiword_house_or_other = HIWORD(pNPCData4->Location2D);
-              dword_5B65C0 = v0;
+              dword_5B65C0 = 1;
             }
             else
             {
@@ -1997,7 +1997,7 @@
               pParty->sRotationY = LOWORD(pNPCData4->Location2D);
               pParty->sRotationX = HIWORD(pNPCData4->Location2D);
             }
-            pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v0, 0);
+            pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
             /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
             {
               pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
@@ -2061,7 +2061,7 @@
                 if ( uMessageParam != 5 )
                 {
 LABEL_486:
-                  SaveGame(v0, 0);
+                  SaveGame(1, 0);
                   v64 = pMapStats->GetMapInfo(pCurrentMapName);
                   v65 = uMessageParam;
                   if ( v64 == TownPortalList[uMessageParam].uMapInfoID )
@@ -2075,12 +2075,12 @@
                   }
                   else
                   {
-                    SaveGame(v0, 0);
+                    SaveGame(1, 0);
                     OnMapLeave();
-                    dword_6BE364_game_settings_1 |= v0;
-                    uGameState = 2;
+                    dword_6BE364_game_settings_1 |= 1;
+                    uGameState = GAME_STATE_2;
                     strcpy(pCurrentMapName, pMapStats->pInfos[TownPortalList[uMessageParam].uMapInfoID].pFilename);
-                    dword_5B65C0 = v0;
+                    dword_5B65C0 = 1;
                     _5B65A8_npcdata_uflags_or_other = TownPortalList[uMessageParam].pos.x;
                     _5B65AC_npcdata_fame_or_other = TownPortalList[uMessageParam].pos.y;
                     _5B65B0_npcdata_rep_or_other = TownPortalList[uMessageParam].pos.z;
@@ -2091,7 +2091,7 @@
                   }
                   v67 = pGUIWindow_CurrentMenu->Hint;
                   if ( v67 )
-                    *((int *)v67 + 17) = v0;
+                    *((int *)v67 + 17) = 1;
                   else
                     pParty->pPlayers[(unsigned __int8)town_portal_caster_id].CanCastSpell(0x14u);
 //LABEL_434:
@@ -2103,7 +2103,7 @@
                     *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
                     ++pMessageQueue_50CBD0->uNumMessages;
                   }*/
-                  pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v0, 0);
+                  pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
                   continue;
                 }
                 v63 = 210;
@@ -2231,7 +2231,7 @@
           continue;
         case UIMSG_C4:
 			__debugbreak;
-          uGameState = 0;
+          uGameState = GAME_STATE_0;
           strcpy((char *)pKeyActionMap->pPressedKeysBuffer, "2");
           goto LABEL_524;
         case UIMSG_DD:
@@ -2247,7 +2247,7 @@
 //LABEL_90:
               v1 = "";
 //LABEL_91:
-              v0 = 1;
+              //v0 = 1;
               continue;
             }
             v71 = v70;
@@ -2268,11 +2268,11 @@
               {
                 strcpy(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[(int)pNPCData3]);
                 dword_6BE364_game_settings_1 |= 1u;
-                uGameState = 2;
+                uGameState = GAME_STATE_2;
                 OnMapLeave();
                 //goto LABEL_90;
                 v1 = "";
-                v0 = 1;
+                //v0 = 1;
                 continue;
               }
             }
@@ -2285,7 +2285,7 @@
               //goto LABEL_90;
             {
               v1 = "";
-              v0 = 1;
+              //v0 = 1;
               continue;
             }
             v74 = atoi(v216.pProperties[0]);
@@ -2304,7 +2304,7 @@
                 pParty->uFallStartY = v76;
                 //goto LABEL_90;
                 v1 = "";
-                v0 = 1;
+                //v0 = 1;
                 continue;
               }
             }
@@ -2326,7 +2326,7 @@
                       pParty->uFallStartY = v76;
                       //goto LABEL_90;
                       v1 = "";
-                      v0 = 1;
+                      //v0 = 1;
                       continue;
                     }
                   }
@@ -2339,7 +2339,7 @@
           ShowStatusBarString(v73, 6u);
           //goto LABEL_90;
           v1 = "";
-          v0 = 1;
+          //v0 = 1;
           continue;
         case UIMSG_CastQuickSpell:
           if ( bUnderwater == 1 )
@@ -2352,7 +2352,7 @@
             //goto LABEL_90;
           {
             v1 = "";
-            v0 = 1;
+            //v0 = 1;
             continue;
           }
           _42777D_CastSpell_UseWand_ShootArrow(pPlayer2->uQuickSpell, uActiveCharacter - 1, 0, 0, uActiveCharacter);
@@ -2376,7 +2376,7 @@
             //goto LABEL_90;
             {
             v1 = "";
-            v0 = 1;
+            //v0 = 1;
             continue;
           }
           v51 = pGUIWindow_Settings->ptr_1C;
@@ -2408,7 +2408,7 @@
             //goto LABEL_90;
           {
             v1 = "";
-            v0 = 1;
+            //v0 = 1;
             continue;
           }
           ptr_507BC8 = GUIWindow::Create(0, 0, 640, 480, WINDOW_68, uMessageParam, 0);
@@ -2420,10 +2420,10 @@
             //goto LABEL_90;
           {
             v1 = "";
-            v0 = 1;
+            //v0 = 1;
             continue;
           }
-          if ( pParty->bTurnBasedModeOn != v0 )
+          if ( pParty->bTurnBasedModeOn != 1 )
             //goto LABEL_569;
           {
             if ( pActors[uMessageParam].uAIState == 5 )
@@ -2432,11 +2432,11 @@
               Actor::StealFrom(uMessageParam);
             continue;
           }
-          if ( pTurnEngine->field_4 == v0 || pTurnEngine->field_4 == 3 )
+          if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3 )
             //goto LABEL_90;
           {
             v1 = "";
-            v0 = 1;
+            //v0 = 1;
             continue;
           }
           if ( !(pTurnEngine->field_18 & 2) )
@@ -2454,20 +2454,20 @@
             //goto LABEL_90;
           {
             v1 = "";
-            v0 = 1;
+            //v0 = 1;
             continue;
           }
-          if ( pParty->bTurnBasedModeOn != v0 )
+          if ( pParty->bTurnBasedModeOn != 1 )
             //goto LABEL_577;
           {
             _42ECB5_PlayerAttacksActor();
             continue;
           }
-          if ( pTurnEngine->field_4 == v0 || pTurnEngine->field_4 == 3 )
+          if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3 )
             //goto LABEL_90;
           {
             v1 = "";
-            v0 = 1;
+            //v0 = 1;
             continue;
           }
           if ( !(pTurnEngine->field_18 & 2) )
@@ -2486,7 +2486,7 @@
           }
           GUIWindow::Create(pButton_RestUI_Wait5Minutes->uX, pButton_RestUI_Wait5Minutes->uY, 0, 0, WINDOW_PressedButton2,
             (int)pButton_RestUI_Wait5Minutes, (int)pGlobalTXT_LocalizationStrings[238]);// "Wait 5 Minutes"
-          dword_506F14 = v0;
+          dword_506F14 = 1;
           _506F18_num_hours_to_sleep = 5;
           continue;
         case UIMSG_Wait1Hour:
@@ -2498,7 +2498,7 @@
           }
           GUIWindow::Create(pButton_RestUI_Wait1Hour->uX, pButton_RestUI_Wait1Hour->uY, 0, 0, WINDOW_PressedButton2,
             (int)pButton_RestUI_Wait1Hour, (int)pGlobalTXT_LocalizationStrings[239]);// "Wait 1 Hour"
-          dword_506F14 = v0;
+          dword_506F14 = 1;
           _506F18_num_hours_to_sleep = 60;
           continue;
         case UIMSG_RentRoom:
@@ -2523,7 +2523,7 @@
             continue;
           if ( sub_42F4DA() )
           {
-            if ( pParty->bTurnBasedModeOn == v0 )
+            if ( pParty->bTurnBasedModeOn == 1 )
             {
               ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!"
               continue;
@@ -2535,13 +2535,13 @@
             if ( !uActiveCharacter )
             {
               v1 = "";
-              v0 = 1;
+              //v0 = 1;
               continue;
             }
             pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0);
             continue;
           }
-          if ( pParty->bTurnBasedModeOn == v0 )
+          if ( pParty->bTurnBasedModeOn == 1 )
           {
             ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!"
             continue;
@@ -2551,7 +2551,7 @@
             RestUI_Initialize();
             continue;
           }
-          if ( pParty->bTurnBasedModeOn == v0 )
+          if ( pParty->bTurnBasedModeOn == 1 )
           {
             ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!"
             continue;
@@ -2563,7 +2563,7 @@
           if ( !uActiveCharacter )
           {
             v1 = "";
-            v0 = 1;
+            //v0 = 1;
             continue;
           }
           pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0);
@@ -2599,7 +2599,7 @@
               if ( v93 > v92 )
                 pNPCData4 = (NPCData *)((v93 > v92 + pMapInfo->EncM2percent) + 2);
               else
-                pNPCData4 = (NPCData *)v0;
+                pNPCData4 = (NPCData *)1;
               if ( !sub_45063B(pMapInfo, (int)pNPCData4) )
                 pNPCData4 = 0;
               if ( pNPCData4 )
@@ -2645,7 +2645,7 @@
           GUIWindow::Create(pButton_RestUI_WaitUntilDawn->uX, pButton_RestUI_WaitUntilDawn->uY, 0, 0, WINDOW_PressedButton2,
             (int)pButton_RestUI_WaitUntilDawn, (int)pGlobalTXT_LocalizationStrings[237]);// "Wait until Dawn"
           v97 = _494820_training_time(pParty->uCurrentHour);
-          dword_506F14 = v0;
+          dword_506F14 = 1;
           _506F18_num_hours_to_sleep = 60 * v97 - pParty->uCurrentMinute;
           continue;
         case UIMSG_HintSelectRemoveQuickSpellBtn:
@@ -2683,7 +2683,7 @@
           }
           sprintfex(pTmpBuf, v161, v178);
           sub_41C0B8_set_status_string(pTmpBuf);
-          v0 = 1;
+          //v0 = 1;
           continue;
         case UIMSG_ClickInstallRemoveQuickSpellBtn:
           GUIWindow::Create(pBtn_InstallRemoveSpell->uX, pBtn_InstallRemoveSpell->uY, 0, 0, WINDOW_PressedButton2, (int)pBtn_InstallRemoveSpell, 0);
@@ -2775,7 +2775,7 @@
                 {
                   pGUIWindow_CurrentMenu->Release();
                   pEventTimer->Resume();
-                  viewparams->bRedrawGameUI = v0;
+                  viewparams->bRedrawGameUI = 1;
                   pCurrentScreen = SCREEN_GAME;
                   pIcons_LOD->_4114F2();
                   v103 = quick_spell_at_page + 11 * player->lastOpenedSpellbookPage;
@@ -2803,7 +2803,7 @@
 
         case UIMSG_92:
           if ( pTurnEngine->field_4 != 3 )
-            _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 133, v0, 0);
+            _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 133, 1, 0);
           continue;
         case UIMSG_SpellBookWindow:
           if ( pTurnEngine->field_4 == 3 )
@@ -2827,7 +2827,7 @@
                 pEventTimer->Pause();
                 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_SpellBook, 0, 0);
                 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0);
-                viewparams->field_48 = v0;
+                viewparams->field_48 = 1;
                 continue;
               }
               if ( pCurrentScreen != SCREEN_REST
@@ -2841,7 +2841,7 @@
                 pEventTimer->Pause();
                 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_SpellBook, 0, 0);
                 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0);
-                viewparams->field_48 = v0;
+                viewparams->field_48 = 1;
                 continue;
               }
             }
@@ -2856,13 +2856,13 @@
           if ( !pIcons_LOD->uNumPrevLoadedFiles )
             pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
           GUIWindow::Create(0x230u, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_QuickReference, 0);
-          viewparams->bRedrawGameUI = v0;
+          viewparams->bRedrawGameUI = 1;
           pEventTimer->Pause();
           pAudioPlayer->StopChannels(-1, -1);
           pCurrentScreen = SCREEN_QUICK_REFERENCE;
           pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_QuickReference, 5, 0);
           papredoll_dbrds[2] = pIcons_LOD->LoadTexture("BUTTEXI1", TEXTURE_16BIT_PALETTE);
-          pBtn_ExitCancel = pGUIWindow_CurrentMenu->CreateButton(0x187u, 0x13Cu, 0x4Bu, 0x21u, v0, 0, UIMSG_Escape, 0, 0,
+          pBtn_ExitCancel = pGUIWindow_CurrentMenu->CreateButton(0x187u, 0x13Cu, 0x4Bu, 0x21u, 1, 0, UIMSG_Escape, 0, 0,
                          pGlobalTXT_LocalizationStrings[79],// "Exit"
                          pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0); //, v179);
           continue;
@@ -2872,7 +2872,7 @@
             pGUIWindow_CurrentMenu->Release();
             pEventTimer->Resume();
             pCurrentScreen = SCREEN_GAME;
-            viewparams->bRedrawGameUI = v0;
+            viewparams->bRedrawGameUI = 1;
           }
           stru_506E40.Release();
           uNumSeconds = (unsigned int)MakeScreenshot(155, 117);
@@ -2891,20 +2891,20 @@
           pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
           continue;
         case UIMSG_C0:
-          dword_50651C = v0;
+          dword_50651C = 1;
           if ( pMouse->GetCursorPos(&v211)->y > 178 )
             dword_50651C = -1;
           continue;
         case UIMSG_ClickAwardsUpBtn:
           GUIWindow::Create(pBtn_Up->uX, pBtn_Up->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pBtn_Up, 0);
-          dword_506548 = v0;
+          dword_506548 = 1;
           continue;
         case UIMSG_ClickAwardsDownBtn:
           GUIWindow::Create(pBtn_Down->uX, pBtn_Down->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pBtn_Down, 0);
-          dword_506544 = v0;
+          dword_506544 = 1;
           continue;
         case UIMSG_ChangeDetaliz:
-          bRingsShownInCharScreen ^= v0;
+          bRingsShownInCharScreen ^= 1;
           pCharacterScreen_DetalizBtn->Release();
           pCharacterScreen_DollBtn->Release();
           if ( bRingsShownInCharScreen )
@@ -2921,11 +2921,11 @@
             v123 = 300;
             v121 = 600;
           }
-          pCharacterScreen_DetalizBtn = pGUIWindow_CurrentMenu->CreateButton(v121, v123, v125, v128, v0, 0, UIMSG_ChangeDetaliz, 0, 0,
+          pCharacterScreen_DetalizBtn = pGUIWindow_CurrentMenu->CreateButton(v121, v123, v125, v128, 1, 0, UIMSG_ChangeDetaliz, 0, 0,
                          pGlobalTXT_LocalizationStrings[64],// "Detail Toggle"
                          0);
-          pCharacterScreen_DollBtn = pGUIWindow_CurrentMenu->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, v0, 0, UIMSG_ClickPaperdoll, 0, 0, v1, 0);
-          viewparams->bRedrawGameUI = v0;
+          pCharacterScreen_DollBtn = pGUIWindow_CurrentMenu->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, UIMSG_ClickPaperdoll, 0, 0, v1, 0);
+          viewparams->bRedrawGameUI = 1;
           continue;
         case UIMSG_ClickPaperdoll:
           OnPaperdollLeftClick();
@@ -2989,53 +2989,53 @@
             default:
               continue;
             case 11:
-              dword_506548 = v0;
+              dword_506548 = 1;
               continue;
             case 10:
-              dword_506544 = v0;
+              dword_506544 = 1;
               continue;
             case 0:
               pButton = pBtn_Book_1;
-              dword_506544 = v0;
+              dword_506544 = 1;
               break;
             case 1:
               pButton = pBtn_Book_2;
-              dword_506548 = v0;
+              dword_506548 = 1;
               break;
             case 2:
-              dword_506540 = v0;
+              dword_506540 = 1;
               if ( dword_506364 )
                 continue;
               pButton = pBtn_Book_3;
               break;
             case 3:
-              dword_50653C = v0;
+              dword_50653C = 1;
               if ( dword_506364 )
                 continue;
               pButton = pBtn_Book_4;
               break;
             case 4:
-              dword_506538 = v0;
+              dword_506538 = 1;
               if ( dword_506364 )
                 continue;
               pButton = pBtn_Book_5;
               break;
             case 5:
-              dword_506534 = v0;
+              dword_506534 = 1;
               if ( dword_506364 )
                 continue;
               pButton = pBtn_Book_6;
               break;
             case 6:
               pButton = pBtn_Autonotes_Misc;
-              dword_506530 = v0;
+              dword_506530 = 1;
               break;
             case 7:
               pButton = pBtn_Autonotes_Instructors;
-              dword_50652C = v0;
+              dword_50652C = 1;
               break;
           }
-          GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, v0);
+          GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, 1);
           continue;
         case UIMSG_SelectCharacter:
           if ( pMessageQueue_50CBD0->uNumMessages )
@@ -3059,7 +3059,7 @@
           {
             pNPCData4 = (NPCData *)((char *)pNPCData4 - 12);
           }
-          if ( pParty->uCurrentHour < 0xC || (uNumSeconds = v0, pParty->uCurrentHour >= 0x18) )
+          if ( pParty->uCurrentHour < 0xC || (uNumSeconds = 1, pParty->uCurrentHour >= 0x18) )
             uNumSeconds = 0;
           sprintf(pTmpBuf, "%d:%02d%s %s %d %s %d", pNPCData4, pParty->uCurrentMinute, aAMPMNames[uNumSeconds], aDayNames[pParty->uDaysPlayed % 7],
             7 * pParty->uCurrentMonthWeek + pParty->uDaysPlayed % 7 + 1, aMonthNames[pParty->uCurrentMonth], pParty->uCurrentYear);
@@ -3127,7 +3127,7 @@
           }
           if ( pMessageQueue_50CBD0->pMessages[0].field_8 )
           {
-            pMessageQueue_50CBD0->uNumMessages = v0;
+            pMessageQueue_50CBD0->uNumMessages = 1;
             pMessageQueue_50CBD0->AddMessage(UIMSG_E, 0, 0);
             /*v115 = v0;
             pMessageQueue_50CBD0->uNumMessages = v0;
@@ -3435,7 +3435,7 @@
           if ( PlayerCreation_ComputeAttributeBonus() || !PlayerCreation_Chose4Skills() )
             GameUI_Footer_TimeLeft = GetTickCount() + 4000;
           else
-            uGameState = 6;
+            uGameState = GAME_STATE_6;
           break;
         case UIMSG_PlayerCreationClickReset:
           GUIWindow::Create(527, 431, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnReset, 0);
@@ -3459,7 +3459,7 @@
           pGUIWindow_CurrentMenu->ptr_1C = v3;
           break;
         case UIMSG_ChangeGameState:
-          uGameState = 1;
+          uGameState = GAME_FINISHED;
           break;
         case UIMSG_11:
           pMouse->SetCursorBitmap("MICON2");