diff GUI/UI/UIPopup.cpp @ 2541:a902abdfc7f2

1. Renamed class Game to class Engine. 2. Separated game logic as state of FSM from game logic as engine. 3. Found out that many UI screen initializers were optimized away, intially they all returned newly created window as separate object like it is done in CharacterUI_Initialize.
author a.parshin
date Sun, 10 May 2015 01:29:11 +0200
parents 1bcadc6dd203
children c674d547cc7c
line wrap: on
line diff
--- a/GUI/UI/UIPopup.cpp	Sat May 09 12:55:58 2015 +0200
+++ b/GUI/UI/UIPopup.cpp	Sun May 10 01:29:11 2015 +0200
@@ -3,16 +3,17 @@
 #include <crtdbg.h>
 
 #define _CRT_SECURE_NO_WARNINGS
+
+#include "Engine/Engine.h"
+
 #include "UIPopup.h"
 #include "Books\UIMapBook.h"
 #include "UIShops.h"
-#include "..\../Engine/MM7.h"
 
 #include "..\../IO/Mouse.h"
 
 #include "..\../Engine/Graphics/Sprites.h"
 #include "..\../Engine/Graphics/Vis.h"
-#include "..\../Engine/Game.h"
 #include "..\../GUI/GUIWindow.h"
 #include "..\../GUI/GUIFont.h"
 #include "..\../Engine/Party.h"
@@ -26,8 +27,6 @@
 #include "..\../Engine/Graphics/PaletteManager.h"
 #include "..\../Engine/Timer.h"
 #include "..\../Engine/texts.h"
-
-#include "..\../Engine/mm7_data.h"
 #include "..\../Engine/Events.h"
 
 static char static_sub_417BB5_out_string[1200]; // static to a file, not sub actually
@@ -1301,7 +1300,7 @@
   unsigned int pX; // [sp+70h] [bp-8h]@3
   unsigned int pY; // [sp+74h] [bp-4h]@3
 
-  if ( pCurrentScreen == SCREEN_VIDEO || GetCurrentMenuID() == MENU_MAIN )
+  if ( current_screen_type == SCREEN_VIDEO || GetCurrentMenuID() == MENU_MAIN )
     return;
   if ( _this )
   {
@@ -1336,7 +1335,7 @@
   }
 
   pEventTimer->Pause();
-  switch(pCurrentScreen)
+  switch(current_screen_type)
   {
     case SCREEN_CASTING:
     {
@@ -1432,7 +1431,7 @@
           popup_window.uFrameX = pX + 30;
         popup_window.uFrameY = 40;
         //if ( pRenderer->pRenderD3D )
-          v5 = pGame->pVisInstance->get_picked_object_zbuf_val();
+          v5 = pEngine->pVisInstance->get_picked_object_zbuf_val();
         /*else
           v5 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]];*/
         if (PID_TYPE((unsigned __int16)v5) == OBJECT_Actor)
@@ -1479,7 +1478,7 @@
     case SCREEN_E:
     case SCREEN_CHEST_INVENTORY:
     {
-      if ( (signed int)pX > 467 && pCurrentScreen != SCREEN_E )
+      if ( (signed int)pX > 467 && current_screen_type != SCREEN_E )
         Inventory_ItemPopupAndAlchemy();
       else if ( (signed int)pY >= 345 )
         break;