diff IO/Mouse.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/IO/Mouse.cpp	Sat May 09 12:55:58 2015 +0200
+++ b/IO/Mouse.cpp	Sun May 10 01:29:11 2015 +0200
@@ -4,18 +4,17 @@
 
 #define _CRT_SECURE_NO_WARNINGS
 
-#include "Engine/mm7_data.h"
+#include "Engine/Engine.h"
+
 #include "Mouse.h"
 #include "Engine/Party.h"
 #include "Engine/LOD.h"
-#include "Engine/Game.h"
 
 #include "Engine/TurnEngine/TurnEngine.h"
 #include "Engine/Graphics/Viewport.h"
 #include "GUI/GUIWindow.h"
 #include "Engine/Graphics/Vis.h"
 #include "Engine/Objects/Actor.h"
-#include "Engine/MM7.h"
 #include "Media/Audio/AudioPlayer.h"
 
 
@@ -60,9 +59,9 @@
   if ( !this->bInitialized || !pName )
     return;
   if ( _stricmp("MICON2", pName) )//если кусор не мишень
-    pGame->uFlags2 &= 0xFFFFFFEF;
+    pEngine->uFlags2 &= 0xFFFFFFEF;
   else
-    pGame->uFlags2 |= 0x10;
+    pEngine->uFlags2 |= 0x10;
   if ( _stricmp(this->pCurrentCursorName, pName) )
     strcpy(this->pCurrentCursorName, pName);
   ClearCursor();
@@ -444,7 +443,7 @@
   unsigned int pX; // [sp+14h] [bp-8h]@7
   unsigned int pY; // [sp+18h] [bp-4h]@7
 
-  if ( pCurrentScreen == SCREEN_VIDEO || sub_4637E0_is_there_popup_onscreen() )
+  if ( current_screen_type == SCREEN_VIDEO || sub_4637E0_is_there_popup_onscreen() )
     return;
   if ( pGUIWindow2 && pGUIWindow2->ptr_1C == (void *)33 )
   {
@@ -467,7 +466,7 @@
 
   extern bool _507B98_ctrl_pressed;
   x = pX;
-  if ( GetCurrentMenuID() != -1 || pCurrentScreen != SCREEN_GAME || !_507B98_ctrl_pressed // stealing cursor
+  if ( GetCurrentMenuID() != -1 || current_screen_type != SCREEN_GAME || !_507B98_ctrl_pressed // stealing cursor
       || (signed int)pX < (signed int)pViewport->uViewportTL_X || (signed int)pX > (signed int)pViewport->uViewportBR_X
       || (signed int)pY < (signed int)pViewport->uViewportTL_Y || (signed int)pY > (signed int)pViewport->uViewportBR_Y)
   {
@@ -536,7 +535,7 @@
   }
   y = pY;
   //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]];*/
 
@@ -615,7 +614,7 @@
         v12 = pWindowList[v3].field_34;
         if ( pWindowList[v3].pCurrentPosActiveItem - pWindowList[v3].pStartingPosActiveItem - v12 >= 0 )
         {
-          v8 = pCurrentScreen == SCREEN_PARTY_CREATION;
+          v8 = current_screen_type == SCREEN_PARTY_CREATION;
           pWindowList[v3].pCurrentPosActiveItem -= v12;
           if ( v8 )
           {
@@ -646,7 +645,7 @@
         v7 = pWindowList[v3].pCurrentPosActiveItem + pWindowList[v3].field_34;
         if ( v7 < pWindowList[v3].pNumPresenceButton + pWindowList[v3].pStartingPosActiveItem )
         {
-          v8 = pCurrentScreen == SCREEN_PARTY_CREATION;
+          v8 = current_screen_type == SCREEN_PARTY_CREATION;
           pWindowList[v3].pCurrentPosActiveItem = v7;
           if ( v8 )
           {