comparison 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
comparison
equal deleted inserted replaced
2540:abc6a9d079b9 2541:a902abdfc7f2
1 #define _CRTDBG_MAP_ALLOC 1 #define _CRTDBG_MAP_ALLOC
2 #include <stdlib.h> 2 #include <stdlib.h>
3 #include <crtdbg.h> 3 #include <crtdbg.h>
4 4
5 #define _CRT_SECURE_NO_WARNINGS 5 #define _CRT_SECURE_NO_WARNINGS
6
7 #include "Engine/Engine.h"
8
6 #include "UIPopup.h" 9 #include "UIPopup.h"
7 #include "Books\UIMapBook.h" 10 #include "Books\UIMapBook.h"
8 #include "UIShops.h" 11 #include "UIShops.h"
9 #include "..\../Engine/MM7.h"
10 12
11 #include "..\../IO/Mouse.h" 13 #include "..\../IO/Mouse.h"
12 14
13 #include "..\../Engine/Graphics/Sprites.h" 15 #include "..\../Engine/Graphics/Sprites.h"
14 #include "..\../Engine/Graphics/Vis.h" 16 #include "..\../Engine/Graphics/Vis.h"
15 #include "..\../Engine/Game.h"
16 #include "..\../GUI/GUIWindow.h" 17 #include "..\../GUI/GUIWindow.h"
17 #include "..\../GUI/GUIFont.h" 18 #include "..\../GUI/GUIFont.h"
18 #include "..\../Engine/Party.h" 19 #include "..\../Engine/Party.h"
19 #include "..\../Media/Audio/AudioPlayer.h" 20 #include "..\../Media/Audio/AudioPlayer.h"
20 #include "..\../Engine/LOD.h" 21 #include "..\../Engine/LOD.h"
24 #include "..\../Engine/Objects/ObjectList.h" 25 #include "..\../Engine/Objects/ObjectList.h"
25 #include "..\../Engine/Objects/Chest.h" 26 #include "..\../Engine/Objects/Chest.h"
26 #include "..\../Engine/Graphics/PaletteManager.h" 27 #include "..\../Engine/Graphics/PaletteManager.h"
27 #include "..\../Engine/Timer.h" 28 #include "..\../Engine/Timer.h"
28 #include "..\../Engine/texts.h" 29 #include "..\../Engine/texts.h"
29
30 #include "..\../Engine/mm7_data.h"
31 #include "..\../Engine/Events.h" 30 #include "..\../Engine/Events.h"
32 31
33 static char static_sub_417BB5_out_string[1200]; // static to a file, not sub actually 32 static char static_sub_417BB5_out_string[1200]; // static to a file, not sub actually
34 33
35 34
1299 GUIWindow popup_window; // [sp+4h] [bp-74h]@32 1298 GUIWindow popup_window; // [sp+4h] [bp-74h]@32
1300 struct tagPOINT Point; // [sp+60h] [bp-18h]@6 1299 struct tagPOINT Point; // [sp+60h] [bp-18h]@6
1301 unsigned int pX; // [sp+70h] [bp-8h]@3 1300 unsigned int pX; // [sp+70h] [bp-8h]@3
1302 unsigned int pY; // [sp+74h] [bp-4h]@3 1301 unsigned int pY; // [sp+74h] [bp-4h]@3
1303 1302
1304 if ( pCurrentScreen == SCREEN_VIDEO || GetCurrentMenuID() == MENU_MAIN ) 1303 if ( current_screen_type == SCREEN_VIDEO || GetCurrentMenuID() == MENU_MAIN )
1305 return; 1304 return;
1306 if ( _this ) 1305 if ( _this )
1307 { 1306 {
1308 pX = _this->x; 1307 pX = _this->x;
1309 pY = _this->y; 1308 pY = _this->y;
1334 } 1333 }
1335 } 1334 }
1336 } 1335 }
1337 1336
1338 pEventTimer->Pause(); 1337 pEventTimer->Pause();
1339 switch(pCurrentScreen) 1338 switch(current_screen_type)
1340 { 1339 {
1341 case SCREEN_CASTING: 1340 case SCREEN_CASTING:
1342 { 1341 {
1343 Inventory_ItemPopupAndAlchemy(); 1342 Inventory_ItemPopupAndAlchemy();
1344 break; 1343 break;
1430 popup_window.uFrameX = pX - 350; 1429 popup_window.uFrameX = pX - 350;
1431 if ( (signed int)pX <= 320 ) 1430 if ( (signed int)pX <= 320 )
1432 popup_window.uFrameX = pX + 30; 1431 popup_window.uFrameX = pX + 30;
1433 popup_window.uFrameY = 40; 1432 popup_window.uFrameY = 40;
1434 //if ( pRenderer->pRenderD3D ) 1433 //if ( pRenderer->pRenderD3D )
1435 v5 = pGame->pVisInstance->get_picked_object_zbuf_val(); 1434 v5 = pEngine->pVisInstance->get_picked_object_zbuf_val();
1436 /*else 1435 /*else
1437 v5 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]];*/ 1436 v5 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]];*/
1438 if (PID_TYPE((unsigned __int16)v5) == OBJECT_Actor) 1437 if (PID_TYPE((unsigned __int16)v5) == OBJECT_Actor)
1439 { 1438 {
1440 /*if ( pRenderer->uNumSceneBegins ) 1439 /*if ( pRenderer->uNumSceneBegins )
1477 } 1476 }
1478 case SCREEN_CHARACTERS: 1477 case SCREEN_CHARACTERS:
1479 case SCREEN_E: 1478 case SCREEN_E:
1480 case SCREEN_CHEST_INVENTORY: 1479 case SCREEN_CHEST_INVENTORY:
1481 { 1480 {
1482 if ( (signed int)pX > 467 && pCurrentScreen != SCREEN_E ) 1481 if ( (signed int)pX > 467 && current_screen_type != SCREEN_E )
1483 Inventory_ItemPopupAndAlchemy(); 1482 Inventory_ItemPopupAndAlchemy();
1484 else if ( (signed int)pY >= 345 ) 1483 else if ( (signed int)pY >= 345 )
1485 break; 1484 break;
1486 else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 100 )//2DEvent - CharacerScreenStats 1485 else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 100 )//2DEvent - CharacerScreenStats
1487 CharacterUI_StatsTab_ShowHint(); 1486 CharacterUI_StatsTab_ShowHint();