diff Game.cpp @ 2225:080fd5a5433d

Merge
author Grumpy7
date Wed, 19 Feb 2014 22:30:39 +0100
parents c2eeeb991a87 744ed51880ed
children c4f87fb3cfee
line wrap: on
line diff
--- a/Game.cpp	Wed Feb 19 22:26:10 2014 +0100
+++ b/Game.cpp	Wed Feb 19 22:30:39 2014 +0100
@@ -154,9 +154,7 @@
   v4 = viewparams->bRedrawGameUI;
   GameUI_Footer();
   if (!viewparams->bRedrawGameUI)
-  {
     GameUI_DrawRightPanelItems();
-  }
   else
   {
     GameUI_DrawRightPanelFrames();
@@ -185,7 +183,7 @@
   GameUI_DrawPortraits(v4);
   GameUI_DrawLifeManaBars();
   GameUI_DrawCharacterSelectionFrame();
-  if ( sub_44100D() )
+  if ( _44100D_should_alter_right_panel() )
     GameUI_DrawRightPanel();
   if ( !pVideoPlayer->AnyMovieLoaded() )
   {
@@ -258,9 +256,9 @@
   _unused_5B5924_is_travel_ui_drawn = false;
   if (v4)
     pMouse->bRedraw = true;
-  pMouse->_469EA4();
+  pMouse->ReadCursorWithItem();
   pMouse->DrawCursor();
-  pMouse->_469E1C();
+  pMouse->Activate();
   pRenderer->EndScene();
   pRenderer->Present();
   pParty->uFlags &= ~2;
@@ -526,14 +524,8 @@
 {
   for (uint i = 0; i < uNumBloodsplats; ++i)
   {
-    pBloodsplatContainer->AddBloodsplat(
-        pBloodsplats[i].x,
-        pBloodsplats[i].y,
-        pBloodsplats[i].z,
-        pBloodsplats[i].radius,
-        pBloodsplats[i].r,
-        pBloodsplats[i].g,
-        pBloodsplats[i].b);
+    pBloodsplatContainer->AddBloodsplat(pBloodsplats[i].x, pBloodsplats[i].y, pBloodsplats[i].z,
+        pBloodsplats[i].radius, pBloodsplats[i].r, pBloodsplats[i].g, pBloodsplats[i].b);
    }
 }
 
@@ -546,15 +538,8 @@
   for( int i=0; i<uNumStationaryLights; ++i ) 
       {
        pLight=&pStationaryLights[i];
-       pStationaryLightsStack->AddLight(
-           pLight->vPosition.x, 
-           pLight->vPosition.y,
-           pLight->vPosition.z,
-           pLight->flt_18,
-           pLight->vRGBColor.x,
-           pLight->vRGBColor.y,
-           pLight->vRGBColor.z,
-           _4E94D0_light_type);
+       pStationaryLightsStack->AddLight(pLight->vPosition.x, pLight->vPosition.y, pLight->vPosition.z,
+           pLight->flt_18, pLight->vRGBColor.x, pLight->vRGBColor.y, pLight->vRGBColor.z, _4E94D0_light_type);
       }
 }
 // 4E94D0: using guessed type char _4E94D0_light_type;
@@ -584,11 +569,8 @@
 //----- (0044F07B) --------------------------------------------------------
 bool Game::_44F07B()
 {
-  if (!pKeyboardInstance->IsKeyBeingHeld(VK_SHIFT) &&
-      !pKeyboardInstance->IsKeyBeingHeld(VK_LSHIFT) &&
-      !pKeyboardInstance->IsKeyBeingHeld(VK_LSHIFT) ||
-
-      (pKeyboardInstance->WasKeyPressed(VK_F11) == 0 &&
+  if (!pKeyboardInstance->IsKeyBeingHeld(VK_SHIFT) && !pKeyboardInstance->IsKeyBeingHeld(VK_LSHIFT) &&
+      !pKeyboardInstance->IsKeyBeingHeld(VK_LSHIFT) || (pKeyboardInstance->WasKeyPressed(VK_F11) == 0 &&
        pKeyboardInstance->WasKeyPressed(VK_F11)))
     return true;
   return false;
@@ -601,21 +583,21 @@
   //double v2; // st7@2
   float depth; // ST00_4@9
   //bool result; // eax@9
-  unsigned int v5; // eax@14
+  //unsigned int v5; // eax@14
   __int64 v6; // kr00_8@21
-  unsigned int y; // [sp+4h] [bp-24h]@2
-  unsigned int x; // [sp+8h] [bp-20h]@2
+  //unsigned int y; // [sp+4h] [bp-24h]@2
+  //unsigned int x; // [sp+8h] [bp-20h]@2
   Vis_SelectionFilter *v10; // [sp+10h] [bp-18h]@2
   Vis_SelectionFilter *v11; // [sp+14h] [bp-14h]@2
-  POINT a2; // [sp+20h] [bp-8h]@1
+  POINT cursor; // [sp+20h] [bp-8h]@1
 
   //v1 = this;
   ++qword_5C6DF0;
   pParticleEngine->UpdateParticles();
-  pMouseInstance->GetCursorPos(&a2);
+  pMouseInstance->GetCursorPos(&cursor);
 
-  x = a2.y;
-  y = a2.x;
+  //x = cursor.y;
+  //y = cursor.x;
   if ( sub_4637E0_is_there_popup_onscreen() )
   {
     v11 = &vis_face_filter;
@@ -638,7 +620,7 @@
   }
   //depth = v2;
 
-  PickMouse(depth, y, x, false, v10, v11);
+  PickMouse(depth, cursor.x, cursor.y, false, v10, v11);
   pLightmapBuilder->std__vector_000004_size = 0;
   pLightmapBuilder->std__vector_183808_size = 0;
   pDecalBuilder->std__vector_pDecals_size = 0;
@@ -649,10 +631,7 @@
     if ( uFlags & GAME_FLAGS_1_DRAW_BLV_DEBUGS)
       pStru10Instance->bDoNotDrawPortalFrustum = false;
     if ( /*pRenderer->pRenderD3D &&*/ uCurrentlyLoadedLevelType == LEVEL_Outdoor)
-    {
-      v5 = GetLevelFogColor();
-      pRenderer->uFogColor = v5 & 0xFFFFFF;
-    }
+      pRenderer->uFogColor = GetLevelFogColor() & 0xFFFFFF;
     if (uFlags & 0x0400)
       uFlags2 |= 0x01;
     /*if ( !pRenderer->pRenderD3D && uCurrentlyLoadedLevelType == LEVEL_Outdoor && pMobileLightsStack->uNumLightsActive )
@@ -665,7 +644,7 @@
       uFlags2 |= v6;
     if (uNumStationaryLights_in_pStationaryLightsStack != pStationaryLightsStack->uNumLightsActive )
     {
-      uFlags2 |= 1u;
+      uFlags2 |= 1;
       uNumStationaryLights_in_pStationaryLightsStack = pStationaryLightsStack->uNumLightsActive;
     }
     _44E904();
@@ -767,9 +746,7 @@
       v6 = floorf(a3b + 0.5f);
     }
     else
-    {
       v6 = 0;
-    }
     if ( a4 >= v6 )
     {
       a4a = (1.0 - fSaturation) * a2a;
@@ -783,19 +760,13 @@
         result = floorf(a4b + 0.5f);
       }
       else
-      {
         result = 0;
-      }
     }
     else
-    {
       result = a4;
-    }
   }
   else
-  {
     result = -1;
-  }
   return result;
 }
 
@@ -846,9 +817,7 @@
       v6 = floorf(v13 + 0.5f);
     }
     else
-    {
       v6 = 0;
-    }
     if ( a4 >= v6 )
     {
       v14 = (1.0 - fSaturation) * v11;
@@ -861,19 +830,13 @@
         result = floorf(v15 + 0.5f);
       }
       else
-      {
         result = 0;
-      }
     }
     else
-    {
       result = a4;
-    }
   }
   else
-  {
     result = -1;
-  }
   return result;
 }
 
@@ -1008,9 +971,7 @@
       v7 = 0.0;
   }
   else
-  {
     v7 = 1.0;
-  }
   //if ( pRenderer->pRenderD3D )
     fSaturation = v7;
   //else
@@ -1526,7 +1487,7 @@
           pIcons_LOD->RemoveTexturesPackFromTextureList();
           pGUIWindow_CurrentMenu->Release();
           pCurrentScreen = SCREEN_OPTIONS;
-          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_8, 0, 0);
+          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_8, 0, 0);
           continue;
         case UIMSG_ArrowUp:
           --pSaveListPosition;
@@ -1618,7 +1579,7 @@
           options_menu_skin.uTextureID_ShowDamage     = pIcons_LOD->LoadTexture("option02", TEXTURE_16BIT_PALETTE);
           options_menu_skin.uTextureID_WalkSound      = pIcons_LOD->LoadTexture("option01", TEXTURE_16BIT_PALETTE);
 
-          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Options, 0, 0);
+          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Options, 0, 0);
           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,
@@ -1677,7 +1638,7 @@
           uTextureID_Optkb[2] = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE);
           uTextureID_Optkb[3] = pIcons_LOD->LoadTexture("optkb_1", TEXTURE_16BIT_PALETTE);
           uTextureID_Optkb[4] = pIcons_LOD->LoadTexture("optkb_2", TEXTURE_16BIT_PALETTE);
-          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_KeyMappingOptions, 0, 0);
+          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_KeyMappingOptions, 0, 0);
           pGUIWindow_CurrentMenu->CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, 1, 0, UIMSG_Escape, 0, 0, "", 0);
           pGUIWindow_CurrentMenu->CreateButton(19u, 0x12Eu, 0x6Cu, 0x14u, 1, 0, UIMSG_SelectKeyPage1, 0, 0, "", 0);
           pGUIWindow_CurrentMenu->CreateButton(127u, 0x12Eu, 0x6Cu, 0x14u, 1, 0, UIMSG_SelectKeyPage2, 0, 0, "", 0);
@@ -1778,7 +1739,7 @@
           not_available_bloodsplats_texture_id = pIcons_LOD->LoadTexture("opvdG-bs", TEXTURE_16BIT_PALETTE);
           not_available_us_colored_lights_texture_id = pIcons_LOD->LoadTexture("opvdG-cl", TEXTURE_16BIT_PALETTE);
           not_available_tinting_texture_id = pIcons_LOD->LoadTexture("opvdG-tn", TEXTURE_16BIT_PALETTE);
-          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_VideoOptions, 0, 0);
+          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_VideoOptions, 0, 0);
           pGUIWindow_CurrentMenu->CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, 1, 0, UIMSG_Escape, 0, 0, "", 0);
           //if ( pRenderer->pRenderD3D )
           {
@@ -1992,7 +1953,7 @@
             pGUIWindow_CurrentMenu->Release();
           pEventTimer->Pause();
           pAudioPlayer->StopChannels(-1, -1);
-          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_Book, uMessage, 0);
+          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0);
           pBooksWindow = GUIWindow::Create(493u, 355u, 0, 0, WINDOW_BooksWindow, (int)pBtn_Quests, 0);
           bFlashQuestBook = 0;
           continue;
@@ -2003,7 +1964,7 @@
             pGUIWindow_CurrentMenu->Release();
           pEventTimer->Pause();
           pAudioPlayer->StopChannels(-1, -1);
-          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_Book, uMessage, 0);
+          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0);
           pBooksWindow = GUIWindow::Create(527u, 353u, 0, 0, WINDOW_BooksWindow, (int)pBtn_Autonotes, 0);
           bFlashAutonotesBook = 0;
           continue;
@@ -2016,7 +1977,7 @@
           viewparams->sViewCenterX = pParty->vPosition.x;
           viewparams->sViewCenterY = pParty->vPosition.y;
           pAudioPlayer->StopChannels(-1, -1);
-          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0);
+          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0);
           pBooksWindow = GUIWindow::Create(546, 353, 0, 0, WINDOW_BooksWindow, (int)pBtn_Maps, 0);
           continue;
         case UIMSG_OpenCalendar:
@@ -2026,7 +1987,7 @@
             pGUIWindow_CurrentMenu->Release();
           pEventTimer->Pause();
           pAudioPlayer->StopChannels(-1, -1);
-          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0);
+          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0);
           pBooksWindow = GUIWindow::Create(570, 354, 0, 0, WINDOW_BooksWindow, (int)pBtn_Calendar, 0);
           continue;
         case UIMSG_OpenHistoryBook:
@@ -2036,7 +1997,7 @@
             pGUIWindow_CurrentMenu->Release();
           pEventTimer->Pause();
           pAudioPlayer->StopChannels(-1, -1);
-          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0);
+          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0);
           pBooksWindow = GUIWindow::Create(0x258u, 0x169u, 0, 0, WINDOW_BooksWindow, (int)pBtn_History, 0);
           bFlashHistoryBook = 0;
           continue;
@@ -2083,9 +2044,7 @@
                   if ( pGUIWindow_Settings )
                   {
                     if ( pCurrentScreen == SCREEN_CHARACTERS )
-                    {
                       pMouse->SetCursorBitmap("MICON2");
-                    }
                     else
                     {
                       pGUIWindow_Settings->Release();
@@ -2136,18 +2095,16 @@
                       }
                       if ( pGUIWindow_Settings )
                       {
-                       if ( pCurrentScreen == SCREEN_CHARACTERS )
-                       {
-                        pMouse->SetCursorBitmap("MICON2");
-                       }
-                       else
-                       {
-                         pGUIWindow_Settings->Release();
-                         pGUIWindow_Settings = 0;
-                         pMouse->SetCursorBitmap("MICON1");
-                         GameUI_Footer_TimeLeft = 0;
-                         _50C9A0_IsEnchantingInProgress = 0;
-                         back_to_game();
+                        if ( pCurrentScreen == SCREEN_CHARACTERS )
+                          pMouse->SetCursorBitmap("MICON2");
+                        else
+                        {
+                          pGUIWindow_Settings->Release();
+                          pGUIWindow_Settings = 0;
+                          pMouse->SetCursorBitmap("MICON1");
+                          GameUI_Footer_TimeLeft = 0;
+                          _50C9A0_IsEnchantingInProgress = 0;
+                          back_to_game();
                         }
                        }
                        if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
@@ -2169,17 +2126,15 @@
                       if ( pGUIWindow_Settings )
                       {
                         if ( pCurrentScreen == SCREEN_CHARACTERS )
-                        {
-                         pMouse->SetCursorBitmap("MICON2");
-                        }
+                          pMouse->SetCursorBitmap("MICON2");
                         else
                         {
-                         pGUIWindow_Settings->Release();
-                         pGUIWindow_Settings = 0;
-                         pMouse->SetCursorBitmap("MICON1");
-                         GameUI_Footer_TimeLeft = 0;
-                         _50C9A0_IsEnchantingInProgress = 0;
-                         back_to_game();
+                          pGUIWindow_Settings->Release();
+                          pGUIWindow_Settings = 0;
+                          pMouse->SetCursorBitmap("MICON1");
+                          GameUI_Footer_TimeLeft = 0;
+                          _50C9A0_IsEnchantingInProgress = 0;
+                          back_to_game();
                         }
                       }
                       if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
@@ -2290,8 +2245,7 @@
 
                           memset(&uTextureID_Optkb, 0, 0x14u);
                           pIcons_LOD->SyncLoadedFilesCount();
-                          uAction = 0;
-                          do
+                          for ( uAction = 0; uAction < 28; ++uAction )
                           {
                             v33 = pKeyActionMap->GetActionVKey((enum InputAction)uAction);
                             if ( v33 != pPrevVirtualCidesMapping[uAction] )
@@ -2313,9 +2267,7 @@
                             else
                               pKeyToggleType = TOGGLE_Continuously;
                             pKeyActionMap->SetKeyMapping(uAction, pPrevVirtualCidesMapping[uAction], pKeyToggleType);
-                            ++uAction;
                           }
-                          while ( uAction < 28 );
                           pKeyActionMap->StoreMappings();
                           stru_506E40.Release();
                           break;
@@ -2347,9 +2299,7 @@
                       if ( pGUIWindow_Settings )
                       {
                         if ( pCurrentScreen == SCREEN_CHARACTERS )
-                        {
                           pMouse->SetCursorBitmap("MICON2");
-                        }
                         else
                         {
                           pGUIWindow_Settings->Release();
@@ -2358,7 +2308,7 @@
                           GameUI_Footer_TimeLeft = 0;
                           _50C9A0_IsEnchantingInProgress = 0;
                           back_to_game();
-                         }
+                        }
                       }
                       if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
                         uActiveCharacter = pParty->GetNextActiveCharacter();
@@ -2397,9 +2347,7 @@
                       if ( pGUIWindow_Settings )
                       {
                         if ( pCurrentScreen == SCREEN_CHARACTERS )
-                        {
                           pMouse->SetCursorBitmap("MICON2");
-                        }
                         else
                         {
                           pGUIWindow_Settings->Release();
@@ -2481,9 +2429,7 @@
                       if ( pGUIWindow_Settings )
                       {
                         if ( pCurrentScreen == SCREEN_CHARACTERS )
-                        {
                           pMouse->SetCursorBitmap("MICON2");
-                        }
                         else
                         {
                           pGUIWindow_Settings->Release();
@@ -2509,9 +2455,7 @@
                       if ( pGUIWindow_Settings )
                       {
                         if ( pCurrentScreen == SCREEN_CHARACTERS )
-                        {
                           pMouse->SetCursorBitmap("MICON2");
-                        }
                         else
                         {
                           pGUIWindow_Settings->Release();
@@ -2537,9 +2481,7 @@
                   if ( pGUIWindow_Settings )
                   {
                     if ( pCurrentScreen == SCREEN_CHARACTERS )
-                    {
                       pMouse->SetCursorBitmap("MICON2");
-                    }
                     else
                     {
                       pGUIWindow_Settings->Release();
@@ -2569,9 +2511,7 @@
               if ( pGUIWindow_Settings )
               {
                 if ( pCurrentScreen == SCREEN_CHARACTERS )
-                {
                   pMouse->SetCursorBitmap("MICON2");
-                }
                 else
                 {
                   pGUIWindow_Settings->Release();
@@ -2606,7 +2546,7 @@
               if ( !pIcons_LOD->uNumPrevLoadedFiles )
                 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
 
-              pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_OptionsButtons, 0, 0);
+              pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_OptionsButtons, 0, 0);
               uTextureID_Options = pIcons_LOD->LoadTexture("options", TEXTURE_16BIT_PALETTE);
               uTextureID_New1 = pIcons_LOD->LoadTexture("new1", TEXTURE_16BIT_PALETTE);
               uTextureID_Load1 = pIcons_LOD->LoadTexture("load1", TEXTURE_16BIT_PALETTE);
@@ -3024,12 +2964,12 @@
 
         case UIMSG_OnCastTownPortal:
           pAudioPlayer->StopChannels(-1, -1);
-          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, WINDOW_TownPortal, (char *)uMessageParam);
+          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, WINDOW_TownPortal, (char *)uMessageParam);
         continue;
 
         case UIMSG_OnCastLloydsBeacon:
           pAudioPlayer->StopChannels(-1, -1);
-          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, WINDOW_LloydsBeacon, 0);
+          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, WINDOW_LloydsBeacon, 0);
         continue;
 
         case UIMSG_LloydsBeacon_FlippingBtn:
@@ -3473,7 +3413,7 @@
 			__debugbreak();
           if ( !uActiveCharacter || pCurrentScreen )
             continue;
-          ptr_507BC8 = GUIWindow::Create(0, 0, 640, 480, WINDOW_68, uMessageParam, 0);
+          ptr_507BC8 = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_68, uMessageParam, 0);
           pCurrentScreen = SCREEN_19;
           pEventTimer->Pause();
           continue;
@@ -3845,7 +3785,7 @@
                 GUIWindow::Create(476, 450, 0, 0, WINDOW_PressedButton2, (int)pBtn_CastSpell, 0);
                 pCurrentScreen = SCREEN_SPELL_BOOK;
                 pEventTimer->Pause();
-                pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_SpellBook, 0, 0);
+                pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_SpellBook, 0, 0);
                 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0);
                 viewparams->field_48 = 1;
                 continue;
@@ -3857,7 +3797,7 @@
                 GUIWindow::Create(476, 450, 0, 0, WINDOW_PressedButton2, (int)pBtn_CastSpell, 0);
                 pCurrentScreen = SCREEN_SPELL_BOOK;
                 pEventTimer->Pause();
-                pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_SpellBook, 0, 0);
+                pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_SpellBook, 0, 0);
                 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0);
                 viewparams->field_48 = 1;
                 continue;
@@ -3878,7 +3818,7 @@
           pEventTimer->Pause();
           pAudioPlayer->StopChannels(-1, -1);
           pCurrentScreen = SCREEN_QUICK_REFERENCE;
-          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_QuickReference, 5, 0);
+          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_QuickReference, 5, 0);
           papredoll_dbrds[2] = pIcons_LOD->LoadTexture("BUTTEXI1", TEXTURE_16BIT_PALETTE);
           pBtn_ExitCancel = pGUIWindow_CurrentMenu->CreateButton(0x187u, 0x13Cu, 0x4Bu, 0x21u, 1, 0, UIMSG_Escape, 0, 0,
                          pGlobalTXT_LocalizationStrings[79],// "Exit"