annotate Game/Game.cpp @ 2547:fed97f15d1e1

* SaveLoad * QuickReference * Modal * Character
author a.parshin
date Tue, 12 May 2015 01:45:31 +0200
parents 4087cbc62706
children 87e5590d034b
rev   line source
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1 #include "Engine/Engine.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2 #include "Engine/Party.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3 #include "Engine/LOD.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
4 #include "Engine/Events.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
5 #include "Engine/Timer.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
6 #include "Engine/texts.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
7 #include "Engine/SaveLoad.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
8 #include "Engine/Registry.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
9 #include "Engine/Objects/Actor.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
10 #include "Engine/Objects/Chest.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
11 #include "Engine/Objects/ObjectList.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
12 #include "Engine/Objects/SpriteObject.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
13 #include "Engine/Graphics/IRender.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
14 #include "Engine/Graphics/Viewport.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
15 #include "Engine/Graphics/Outdoor.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
16 #include "Engine/Graphics/Overlays.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
17 #include "Engine/Graphics/Sprites.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
18 #include "Engine/Graphics/Vis.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
19 #include "Engine/Graphics/PaletteManager.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
20 #include "Engine/Graphics/DecalBuilder.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
21 #include "Engine/Graphics/Level/Decoration.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
22 #include "Engine/Tables/FrameTableInc.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
23 #include "Engine/TurnEngine/TurnEngine.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
24 #include "Engine/Spells/CastSpellInfo.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
25
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
26 #include "IO/Keyboard.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
27 #include "IO/Mouse.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
28
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
29 #include "Arcomage/Arcomage.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
30
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
31 #include "Media/Audio/AudioPlayer.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
32 #include "Media/Audio/AIL.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
33
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
34 #include "GUI/GUIWindow.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
35 #include "GUI/GUIProgressBar.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
36 #include "GUI/UI/UIHouses.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
37 #include "GUI/UI/UIShops.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
38 #include "GUI/UI/UIPartyCreation.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
39 #include "GUI/UI/UIGame.h"
2547
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
40 #include "GUI/UI/UICharacter.h"
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
41 #include "GUI/UI/UIQuickReference.h"
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
42 #include "GUI/UI/UISaveLoad.h"
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
43 #include "GUI/UI/UIModal.h"
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
44
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
45 #include "Game/Game.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
46
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
47
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
48 void DoThatMessageThing()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
49 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
50 if (pMessageQueue_50CBD0->uNumMessages)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
51 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
52 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
53
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
54
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
55
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
56 void Game_StartDialogue(unsigned int actor_id)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
57 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
58 if (uActiveCharacter)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
59 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
60 viewparams->field_48 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
61
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
62 DoThatMessageThing();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
63
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
64 dword_5B65D0_dialogue_actor_npc_id = pActors[actor_id].sNPC_ID;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
65 GameUI_InitializeDialogue(&pActors[actor_id], true);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
66 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
67 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
68
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
69 void Game_StartHirelingDialogue(unsigned int hireling_id)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
70 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
71 if (bNoNPCHiring || current_screen_type != 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
72 return;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
73
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
74 DoThatMessageThing();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
75
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
76 uint hireling_slot = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
77 for (uint i = 0; i < 2; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
78 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
79 if (pParty->pHirelings[i].pName)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
80 pTmpBuf[hireling_slot++] = i;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
81 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
82
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
83 for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
84 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
85 NPCData *npc = &pNPCStats->pNewNPCData[i];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
86 if (npc->Hired()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
87 && (!pParty->pHirelings[0].pName || strcmp(npc->pName, pParty->pHirelings[0].pName))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
88 && (!pParty->pHirelings[1].pName || strcmp(npc->pName, pParty->pHirelings[1].pName)))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
89 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
90 pTmpBuf[hireling_slot++] = i + 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
91 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
92 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
93
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
94 if ((signed int)hireling_id + (signed int)pParty->hirelingScrollPosition < hireling_slot)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
95 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
96 Actor actor;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
97 memset(&actor, 0, sizeof(actor));
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
98 actor.sNPC_ID += -1 - pParty->hirelingScrollPosition - hireling_id;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
99 GameUI_InitializeDialogue(&actor, true);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
100 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
101 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
102
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
103
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
104 void Game_StartNewGameWhilePlaying(bool force_start)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
105 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
106 if (dword_6BE138 == 124 || force_start)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
107 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
108 pIcons_LOD->SyncLoadedFilesCount();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
109 pIcons_LOD->RemoveTexturesPackFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
110 DoThatMessageThing();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
111 pGUIWindow_CurrentMenu->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
112 uGameState = GAME_STATE_NEWGAME_OUT_GAMEMENU;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
113 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
114 viewparams->bRedrawGameUI = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
115 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
116 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
117 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
118 ShowStatusBarString(pGlobalTXT_LocalizationStrings[201], 2);// "Are you sure? Click again to start a New Game"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
119 pAudioPlayer->PlaySound(SOUND_quest, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
120 dword_6BE138 = 124;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
121 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
122 stru_506E40.Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
123 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
124
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
125 void Game_QuitGameWhilePlaying(bool force_quit)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
126 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
127 if (dword_6BE138 == 132 || force_quit)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
128 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
129 pIcons_LOD->SyncLoadedFilesCount();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
130 pIcons_LOD->RemoveTexturesPackFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
131 DoThatMessageThing();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
132 pGUIWindow_CurrentMenu->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
133 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
134 viewparams->bRedrawGameUI = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
135 pAudioPlayer->PlaySound(SOUND_WoodDoorClosing, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
136 uGameState = GAME_STATE_GAME_QUITTING_TO_MAIN_MENU;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
137 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
138 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
139 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
140 ShowStatusBarString(pGlobalTXT_LocalizationStrings[82], 2);// "Are you sure? Click again to quit"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
141 pAudioPlayer->PlaySound(SOUND_quest, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
142 dword_6BE138 = 132;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
143 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
144 stru_506E40.Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
145 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
146
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
147 void Game_OpenLoadGameDialog()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
148 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
149 pIcons_LOD->SyncLoadedFilesCount();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
150 pIcons_LOD->RemoveTexturesPackFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
151 DoThatMessageThing();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
152 pGUIWindow_CurrentMenu->Release();
2547
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
153
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
154 //LoadUI_Load(1);
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
155 pGUIWindow_CurrentMenu = new GUIWindow_Load(true);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
156 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
157
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
158
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
159
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
160 //----- (004304E7) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
161 void Game_EventLoop()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
162 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
163 unsigned int v2; // edx@7
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
164 Actor *pActor; // ecx@13
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
165 int v4; // ecx@18
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
166 unsigned int v10; // ecx@73
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
167 int v14; // eax@98
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
168 int v18; // eax@106
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
169 float v19; // ST64_4@121
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
170 float v21; // ST64_4@126
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
171 float v22; // ST64_4@127
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
172 unsigned int v24; // ecx@149
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
173 GUIWindow *pWindow2; // ecx@248
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
174 bool pKeyBindingFlag; // eax@269
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
175 unsigned int v33; // eax@277
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
176 int v37; // eax@341
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
177 int v38; // eax@358
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
178 SHORT v39; // ax@365
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
179 char *v41; // eax@380
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
180 int v42; // eax@396
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
181 signed int v44; // eax@398
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
182 int v45; // edx@398
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
183 signed int v46; // ecx@398
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
184 char v47; // zf@399
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
185 char v48; // zf@405
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
186 BLVFace *pBLVFace; // ecx@410
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
187 ODMFace *pODMFace; // ecx@412
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
188 CastSpellInfo *pSpellInfo; // ecx@415
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
189 __int16 v53; // ax@431
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
190 int v54; // eax@432
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
191 int v55; // ecx@432
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
192 int v56; // edx@432
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
193 int v57; // eax@432
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
194 Player *pPlayer; // edx@442
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
195 unsigned int pMapNum; // eax@445
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
196 signed int v60; // ST64_4@459
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
197 __int16 v63; // dx@479
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
198 unsigned int v64; // eax@486
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
199 int v65; // ecx@486
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
200 int v66; // eax@488
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
201 char *v67; // eax@489
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
202 __int16 v68; // dx@498
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
203 char *v69; // eax@512
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
204 int v70; // eax@525
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
205 int v71; // edi@527
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
206 NPCData *pNPCData3; // esi@527
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
207 char *v73; // ecx@533
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
208 signed int v74; // edi@535
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
209 int v75; // eax@535
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
210 int v76; // esi@535
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
211 int v77; // eax@537
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
212 Player *pPlayer2; // ecx@549
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
213 signed int v81; // eax@552
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
214 signed int v83; // ecx@554
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
215 signed int v84; // ecx@554
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
216 GUIButton *pButton; // eax@578
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
217 unsigned int v86; // eax@583
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
218 const char *v87; // ecx@595
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
219 const char *v88; // ecx@596
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
220 unsigned int v90; // eax@602
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
221 int v91; // edx@605
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
222 int v92; // eax@605
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
223 int v93; // edx@605
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
224 int pPlayerNum; // edx@611
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
225 int v95; // eax@611
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
226 unsigned int v97; // eax@624
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
227 int v98; // eax@636
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
228 int v103; // eax@671
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
229 Player *pPlayer4; // ecx@718
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
230 int v105; // eax@718
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
231 Player *pPlayer5; // ST78_4@758
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
232 unsigned int v107; // eax@758
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
233 unsigned int v108; // eax@758
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
234 unsigned int v115; // eax@764
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
235 int v116; // eax@776
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
236 unsigned int v118; // eax@785
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
237 unsigned int v119; // ecx@786
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
238 unsigned int v121; // [sp-28h] [bp-624h]@711
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
239 unsigned int v123; // [sp-24h] [bp-620h]@711
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
240 unsigned int v125; // [sp-20h] [bp-61Ch]@711
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
241 int v127; // [sp-1Ch] [bp-618h]@107
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
242 unsigned int v128; // [sp-1Ch] [bp-618h]@711
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
243 GUIButton *pButton2; // [sp-4h] [bp-600h]@59
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
244 const char *v161; // [sp-4h] [bp-600h]@637
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
245 KeyToggleType pKeyToggleType; // [sp+0h] [bp-5FCh]@287
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
246 char *v173; // [sp+0h] [bp-5FCh]@444
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
247 char *v174; // [sp+0h] [bp-5FCh]@449
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
248 const char *v177; // [sp+0h] [bp-5FCh]@629
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
249 char *v178; // [sp+0h] [bp-5FCh]@637
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
250 signed int thisb; // [sp+14h] [bp-5E8h]@272
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
251 Player *pPlayer7; // [sp+14h] [bp-5E8h]@373
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
252 Player *pPlayer8; // [sp+14h] [bp-5E8h]@377
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
253 char *pMapName; // [sp+14h] [bp-5E8h]@445
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
254 Player *pPlayer9; // [sp+14h] [bp-5E8h]@455
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
255 int thisg; // [sp+14h] [bp-5E8h]@467
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
256 int thish; // [sp+14h] [bp-5E8h]@528
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
257 signed int thisi; // [sp+14h] [bp-5E8h]@535
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
258 MapInfo *pMapInfo; // [sp+14h] [bp-5E8h]@604
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
259 Player *pPlayer10; // [sp+14h] [bp-5E8h]@641
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
260 int uMessageParam; // [sp+18h] [bp-5E4h]@7
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
261 int uAction; // [sp+1Ch] [bp-5E0h]@18
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
262 NPCData *pNPCData4; // [sp+20h] [bp-5DCh]@23
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
263 unsigned int uNumSeconds; // [sp+24h] [bp-5D8h]@18
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
264 char v197; // [sp+2Bh] [bp-5D1h]@101
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
265 enum UIMessageType uMessage; // [sp+2Ch] [bp-5D0h]@7
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
266 unsigned int v199; // [sp+30h] [bp-5CCh]@7
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
267 char *v200; // [sp+34h] [bp-5C8h]@518
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
268 POINT v202; // [sp+40h] [bp-5BCh]@141
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
269 POINT a2; // [sp+48h] [bp-5B4h]@127
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
270 POINT v205; // [sp+58h] [bp-5A4h]@171
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
271 POINT v207; // [sp+68h] [bp-594h]@155
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
272 POINT v211; // [sp+88h] [bp-574h]@704
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
273 int v213; // [sp+98h] [bp-564h]@385
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
274 char pLevelName[32]; // [sp+9Ch] [bp-560h]@380
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
275 char pOut[32]; // [sp+BCh] [bp-540h]@370
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
276 FrameTableTxtLine v216; // [sp+DCh] [bp-520h]@524
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
277 int v217[9]; // [sp+158h] [bp-4A4h]@652
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
278 FrameTableTxtLine v218; // [sp+17Ch] [bp-480h]@524
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
279 char a1[64]; // [sp+1F8h] [bp-404h]@467
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
280 char Str2[128]; // [sp+238h] [bp-3C4h]@527
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
281 Actor actor; // [sp+2B8h] [bp-344h]@4
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
282 int currHour;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
283
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
284 dword_50CDC8 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
285 if (!pEventTimer->bPaused)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
286 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
287 pParty->sEyelevel = pParty->uDefaultEyelevel;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
288 pParty->uPartyHeight = pParty->uDefaultPartyHeight;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
289 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
290 if (bDialogueUI_InitializeActor_NPC_ID)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
291 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
292 //Actor::Actor(&actor);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
293 memset(&actor, 0, 0x344u);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
294 dword_5B65D0_dialogue_actor_npc_id = bDialogueUI_InitializeActor_NPC_ID;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
295 actor.sNPC_ID = bDialogueUI_InitializeActor_NPC_ID;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
296 GameUI_InitializeDialogue(&actor, false);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
297 bDialogueUI_InitializeActor_NPC_ID = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
298 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
299 if (pMessageQueue_50CBD0->uNumMessages)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
300 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
301 //v1 = "";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
302 while (2)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
303 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
304 if (!pMessageQueue_50CBD0->uNumMessages)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
305 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
306
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
307 pMessageQueue_50CBD0->PopMessage(&uMessage, &uMessageParam, (int *)&v199);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
308 switch (uMessage)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
309 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
310 case UIMSG_ChangeGameState:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
311 uGameState = GAME_FINISHED;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
312 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
313 case UIMSG_PlayArcomage:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
314 BackToHouseMenu();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
315 pArcomageGame->bGameInProgress = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
316 ArcomageGame::PrepareArcomage();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
317 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
318
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
319 case UIMSG_StartNPCDialogue: Game_StartDialogue(uMessageParam); continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
320 case UIMSG_StartHireling1Dialogue:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
321 case UIMSG_StartHireling2Dialogue: Game_StartHirelingDialogue(uMessage - UIMSG_StartHireling1Dialogue); continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
322 case UIMSG_BuyInShop_Identify_Repair: UIShop_Buy_Identify_Repair(); continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
323 case UIMSG_ClickNPCTopic: ClickNPCTopic(uMessageParam); continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
324 case UIMSG_SelectShopDialogueOption: OnSelectShopDialogueOption(uMessageParam); continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
325 case UIMSG_SelectNPCDialogueOption: OnSelectNPCDialogueOption((DIALOGUE_TYPE)uMessageParam); continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
326 case UIMSG_ClickHouseNPCPortrait: _4B4224_UpdateNPCTopics(uMessageParam); continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
327 case UIMSG_StartNewGame: Game_StartNewGameWhilePlaying(uMessageParam); continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
328 case UIMSG_Game_OpenLoadGameDialog: Game_OpenLoadGameDialog(); continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
329 case UIMSG_Quit: Game_QuitGameWhilePlaying(uMessageParam); continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
330 case UIMSG_80:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
331 __debugbreak();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
332 pIcons_LOD->SyncLoadedFilesCount();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
333 pIcons_LOD->RemoveTexturesPackFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
334 pGUIWindow_CurrentMenu->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
335 current_screen_type = SCREEN_OPTIONS;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
336 __debugbreak();//pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_8, 0, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
337 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
338 case UIMSG_ArrowUp:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
339 --pSaveListPosition;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
340 if (pSaveListPosition < 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
341 pSaveListPosition = 0;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
342 new OnButtonClick2(215, 199, 17, 17, (int)pBtnArrowUp, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
343 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
344 case UIMSG_DownArrow:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
345 ++pSaveListPosition;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
346 if (pSaveListPosition >= uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
347 pSaveListPosition = uMessageParam - 1;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
348 new OnButtonClick2(215, 323, 17, 17, (int)pBtnDownArrow, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
349 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
350 case UIMSG_Cancel:
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
351 new OnCancel(350, 302, 106, 42, (int)pBtnCancel, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
352 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
353 case UIMSG_SaveLoadBtn:
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
354 new OnSaveLoad(241, 302, 106, 42, (int)pBtnLoadSlot, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
355 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
356 case UIMSG_SelectLoadSlot:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
357 if (pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
358 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
359 if (current_screen_type != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != pSaveListPosition + uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
360 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
361 v10 = pSaveListPosition + uMessageParam;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
362 if (dword_6BE138 == pSaveListPosition + uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
363 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
364 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_SaveLoadBtn, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
365 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_LoadGame, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
366 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
367 uLoadGameUI_SelectedSlot = v10;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
368 dword_6BE138 = v10;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
369 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
370 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
371 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
372 pKeyActionMap->EnterText(0, 19, pGUIWindow_CurrentMenu);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
373 if (strcmp(pSavegameHeader[uLoadGameUI_SelectedSlot].pName, pGlobalTXT_LocalizationStrings[72]))// "Empty"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
374 strcpy(pKeyActionMap->pPressedKeysBuffer, pSavegameHeader[uLoadGameUI_SelectedSlot].pName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
375 pKeyActionMap->uNumKeysPressed = strlen(pKeyActionMap->pPressedKeysBuffer);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
376 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
377 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
378 case UIMSG_LoadGame:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
379 if (pSavegameUsedSlots[uLoadGameUI_SelectedSlot])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
380 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
381 LoadGame(uLoadGameUI_SelectedSlot);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
382 uGameState = GAME_STATE_LOADING_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
383 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
384 stru_506E40.Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
385 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
386 case UIMSG_SaveGame:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
387 if (pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
388 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
389 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
390 strcpy((char *)&pSavegameHeader[uLoadGameUI_SelectedSlot], pKeyActionMap->pPressedKeysBuffer);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
391 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
392 DoSavegame(uLoadGameUI_SelectedSlot);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
393 stru_506E40.Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
394 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
395 case UIMSG_Game_OpenSaveGameDialog:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
396 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
397 pGUIWindow_CurrentMenu->Release();
2547
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
398 pGUIWindow_CurrentMenu = new GUIWindow_Save(); //SaveUI_Load(current_screen_type = SCREEN_SAVEGAME);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
399 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
400 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
401 case UIMSG_Game_OpenOptionsDialog://Open
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
402 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
403 DoThatMessageThing();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
404
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
405 pGUIWindow_CurrentMenu->Release();
2546
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
406 pGUIWindow_CurrentMenu = new GUIWindow_GameOptions();//GameMenuUI_Options_Load();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
407
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
408 viewparams->field_48 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
409 current_screen_type = SCREEN_OPTIONS;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
410
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
411 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
412 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
413
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
414 case UIMSG_OpenKeyMappingOptions://Open
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
415 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
416 DoThatMessageThing();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
417
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
418 pGUIWindow_CurrentMenu->Release();
2546
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
419 pGUIWindow_CurrentMenu = new GUIWindow_GameKeyBindings();//GameMenuUI_OptionsKeymapping_Load();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
420
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
421 viewparams->field_48 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
422 current_screen_type = SCREEN_KEYBOARD_OPTIONS;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
423
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
424 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
425 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
426
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
427 case UIMSG_ChangeKeyButton:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
428 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
429 if (uGameMenuUI_CurentlySelectedKeyIdx != -1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
430 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
431 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
432 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
433 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
434 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
435 uGameMenuUI_CurentlySelectedKeyIdx = uMessageParam;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
436 if (KeyboardPageNum != 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
437 uGameMenuUI_CurentlySelectedKeyIdx += 14;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
438 pKeyActionMap->EnterText(0, 1, pGUIWindow_CurrentMenu);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
439 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
440 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
441 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
442
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
443 case UIMSG_ResetKeyMapping:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
444 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
445 v197 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
446 pKeyActionMap->SetDefaultMapping();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
447 for (uint i = 0; i < 28; i++)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
448 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
449 if (pKeyActionMap->GetActionVKey((enum InputAction)i) != pPrevVirtualCidesMapping[i])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
450 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
451 if (v197)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
452 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
453 GUI_ReplaceHotkey(LOBYTE(pPrevVirtualCidesMapping[i]), pKeyActionMap->GetActionVKey((enum InputAction)i), 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
454 v197 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
455 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
456 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
457 GUI_ReplaceHotkey(LOBYTE(pPrevVirtualCidesMapping[i]), pKeyActionMap->GetActionVKey((enum InputAction)i), 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
458 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
459 pPrevVirtualCidesMapping[i] = pKeyActionMap->GetActionVKey((enum InputAction)i);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
460 GameMenuUI_InvaligKeyBindingsFlags[i] = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
461 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
462 pAudioPlayer->PlaySound(SOUND_chimes, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
463 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
464 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
465
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
466 case UIMSG_SelectKeyPage1:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
467 KeyboardPageNum = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
468 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
469 case UIMSG_SelectKeyPage2:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
470 KeyboardPageNum = 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
471 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
472
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
473 case UIMSG_OpenVideoOptions:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
474 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
475 DoThatMessageThing();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
476
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
477 pGUIWindow_CurrentMenu->Release();
2546
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
478 pGUIWindow_CurrentMenu = new GUIWindow_GameVideoOptions();//GameMenuUI_OptionsVideo_Load();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
479 viewparams->field_48 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
480 current_screen_type = SCREEN_VIDEO_OPTIONS;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
481
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
482 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
483 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
484
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
485 case UIMSG_1A9:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
486 __debugbreak();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
487 if (uMessageParam == 4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
488 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
489 //--uGammaPos;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
490 if ((uGammaPos-- - 1) < 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
491 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
492 uGammaPos = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
493 pAudioPlayer->PlaySound(SOUND_ClickMovingSelector, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
494 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
495 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
496 v19 = (double)(signed int)uGammaPos * 0.1 + 0.6;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
497 //pEngine->pGammaController->Initialize(v19);
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
498 new OnButtonClick2(21, 161, 0, 0, (int)pBtn_SliderLeft, (char *)1);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
499 pAudioPlayer->PlaySound(SOUND_ClickMovingSelector, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
500 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
501 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
502 if (uMessageParam == 5)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
503 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
504 ++uGammaPos;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
505 if ((signed int)uGammaPos <= 9)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
506 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
507 v21 = (double)(signed int)uGammaPos * 0.1 + 0.6;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
508 //pEngine->pGammaController->Initialize(v21);
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
509 new OnButtonClick2(213, 161, 0, 0, (int)pBtn_SliderRight, (char *)1);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
510 pAudioPlayer->PlaySound(SOUND_ClickMovingSelector, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
511 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
512 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
513 uGammaPos = 9;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
514 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
515 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
516 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
517 uGammaPos = (pMouse->GetCursorPos(&a2)->x - 42) / 17;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
518 v22 = (double)(signed int)uGammaPos * 0.1 + 0.6;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
519 //pEngine->pGammaController->Initialize(v22);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
520 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
521 pAudioPlayer->PlaySound(SOUND_ClickMovingSelector, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
522 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
523 case UIMSG_ToggleBloodsplats:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
524 pEngine->ToggleFlags2(0x20u);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
525 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
526 case UIMSG_ToggleColoredLights:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
527 pRenderer->ToggleColoredLights();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
528 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
529 case UIMSG_ToggleTint:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
530 pRenderer->ToggleTint();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
531 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
532 case UIMSG_ChangeMusicVolume:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
533 extern bool use_music_folder;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
534 if (uMessageParam == 4)//-
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
535 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
536 --uMusicVolimeMultiplier;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
537 if ((char)uMusicVolimeMultiplier < 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
538 uMusicVolimeMultiplier = 0;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
539 new OnButtonClick2(243, 216, 0, 0, (int)pBtn_SliderLeft, (char *)1);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
540 if (uMusicVolimeMultiplier)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
541 pAudioPlayer->PlaySound(SOUND_hurp, -1, 0, -1, 0, 0, pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
542
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
543 if (use_music_folder)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
544 alSourcef(mSourceID, AL_GAIN, pSoundVolumeLevels[uMusicVolimeMultiplier]);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
545 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
546 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
547
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
548 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
549 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
550 if (uMessageParam == 5)//+
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
551 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
552 ++uMusicVolimeMultiplier;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
553 if ((char)uMusicVolimeMultiplier > 9)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
554 uMusicVolimeMultiplier = 9;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
555 new OnButtonClick2(435, 216, 0, 0, (int)pBtn_SliderRight, (char *)1);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
556 if (uMusicVolimeMultiplier)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
557 pAudioPlayer->PlaySound(SOUND_hurp, -1, 0, -1, 0, 0, pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
558 if (use_music_folder)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
559 alSourcef(mSourceID, AL_GAIN, pSoundVolumeLevels[uMusicVolimeMultiplier]);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
560 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
561 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
562 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
563 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
564 uMusicVolimeMultiplier = (pMouse->GetCursorPos(&v202)->x - 263) / 17;//for mouse
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
565 if ((char)uMusicVolimeMultiplier > 9)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
566 uMusicVolimeMultiplier = 9;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
567 if (uMusicVolimeMultiplier)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
568 pAudioPlayer->PlaySound(SOUND_hurp, -1, 0, -1, 0, 0, pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
569 if (use_music_folder)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
570 alSourcef(mSourceID, AL_GAIN, pSoundVolumeLevels[uMusicVolimeMultiplier]);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
571 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
572 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
573 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
574 case UIMSG_ChangeSoundVolume:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
575 if (uMessageParam == 4)//reduce sound level button left
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
576 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
577 --uSoundVolumeMultiplier;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
578 if ((char)uSoundVolumeMultiplier < 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
579 uSoundVolumeMultiplier = 0;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
580 new OnButtonClick2(243, 162, 0, 0, (int)pBtn_SliderLeft, (char *)1);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
581 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
582 pAudioPlayer->PlaySound(SOUND_church, -1, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
583 int v = AIL_redbook_volume(pAudioPlayer->hAILRedbook);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
584 //v = v+1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
585 if (v)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
586 __debugbreak();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
587 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
588 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
589 if (uMessageParam == 5)//Increase sound level button right
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
590 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
591 ++uSoundVolumeMultiplier;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
592 if ((char)uSoundVolumeMultiplier > 8)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
593 uSoundVolumeMultiplier = 9;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
594 //v168 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
595 v24 = 435;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
596 //v154 = (int)pBtn_SliderRight;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
597 new OnButtonClick2(v24, 162, 0, 0, (int)pBtn_SliderRight, (char *)1);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
598 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
599 pAudioPlayer->PlaySound(SOUND_church, -1, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
600 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
601 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
602 uSoundVolumeMultiplier = (pMouse->GetCursorPos(&v207)->x - 263) / 17;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
603 if ((char)uSoundVolumeMultiplier > 8)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
604 uSoundVolumeMultiplier = 9;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
605 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
606 pAudioPlayer->PlaySound(SOUND_church, -1, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
607 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
608 case UIMSG_ToggleFlipOnExit:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
609 bFlipOnExit = bFlipOnExit == 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
610 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
611 case UIMSG_ToggleAlwaysRun:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
612 bAlwaysRun = bAlwaysRun == 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
613 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
614 case UIMSG_ToggleWalkSound:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
615 bWalkSound = bWalkSound == 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
616 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
617 case UIMSG_ToggleShowDamage:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
618 bShowDamage = bShowDamage == 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
619 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
620 case UIMSG_ChangeVoiceVolume:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
621 if (uMessageParam == 4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
622 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
623 --uVoicesVolumeMultiplier;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
624 if ((char)uVoicesVolumeMultiplier < 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
625 uVoicesVolumeMultiplier = 0;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
626 new OnButtonClick2(243, 270, 0, 0, (int)pBtn_SliderLeft, (char *)1);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
627 if (!uVoicesVolumeMultiplier)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
628 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
629 pAudioPlayer->PlaySound(SOUND_hf445a, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
630 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
631 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
632 if (uMessageParam == 5)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
633 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
634 ++uVoicesVolumeMultiplier;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
635 if ((char)uVoicesVolumeMultiplier > 8)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
636 uVoicesVolumeMultiplier = 9;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
637 new OnButtonClick2(435, 270, 0, 0, (int)pBtn_SliderRight, (char *)1);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
638 if (!uVoicesVolumeMultiplier)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
639 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
640 pAudioPlayer->PlaySound(SOUND_hf445a, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
641 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
642 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
643 uVoicesVolumeMultiplier = (pMouse->GetCursorPos(&v205)->x - 263) / 17;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
644 if ((char)uVoicesVolumeMultiplier > 8)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
645 uVoicesVolumeMultiplier = 9;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
646 if (!uVoicesVolumeMultiplier)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
647 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
648 pAudioPlayer->PlaySound(SOUND_hf445a, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
649 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
650 case UIMSG_SetTurnSpeed:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
651 if (uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
652 pParty->sRotationY = uMessageParam * pParty->sRotationY / uMessageParam;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
653 uTurnSpeed = uMessageParam;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
654 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
655
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
656 case UIMSG_SetGraphicsMode:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
657 /*if ( !bUseLoResSprites )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
658 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
659 byte_6BE388_graphicsmode = uMessageParam;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
660 MM7Initialization();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
661 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
662 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
663 if ( uMessageParam )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
664 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
665 if ( uMessageParam == 1 )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
666 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
667 byte_6BE388_graphicsmode = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
668 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
669 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
670 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
671 if ( uMessageParam != 2 )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
672 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
673 byte_6BE388_graphicsmode = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
674 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
675 MM7Initialization();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
676 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
677 }*/
2547
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
678 pModalWindow = new GUIWindow_Modal(pNPCTopics[453].pText, UIMSG_0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
679 __debugbreak(); // Nomad: graphicsmode as it was now removed
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
680 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
681
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
682 case UIMSG_GameMenu_ReturnToGame:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
683 pGUIWindow_CurrentMenu->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
684 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
685 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
686 viewparams->bRedrawGameUI = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
687 stru_506E40.Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
688 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
689 case UIMSG_OpenQuestBook:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
690 DoThatMessageThing();
2542
a.parshin
parents: 2541
diff changeset
691 if (current_screen_type != SCREEN_GAME)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
692 pGUIWindow_CurrentMenu->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
693 pEventTimer->Pause();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
694 pAudioPlayer->StopChannels(-1, -1);
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
695 pGUIWindow_CurrentMenu = new GUIWindow_Book(0, 0, window->GetWidth(), window->GetHeight(), uMessage, 0);
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
696 pBooksWindow = new GUIWindow_BooksWindow(493u, 355u, 0, 0, (int)pBtn_Quests, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
697 bFlashQuestBook = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
698 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
699 case UIMSG_OpenAutonotes:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
700 DoThatMessageThing();
2542
a.parshin
parents: 2541
diff changeset
701 if (current_screen_type != SCREEN_GAME)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
702 pGUIWindow_CurrentMenu->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
703 pEventTimer->Pause();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
704 pAudioPlayer->StopChannels(-1, -1);
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
705 pGUIWindow_CurrentMenu = new GUIWindow_Book(0, 0, window->GetWidth(), window->GetHeight(), uMessage, 0);
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
706 pBooksWindow = new GUIWindow_BooksWindow(527u, 353u, 0, 0, (int)pBtn_Autonotes, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
707 bFlashAutonotesBook = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
708 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
709 case UIMSG_OpenMapBook:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
710 DoThatMessageThing();
2542
a.parshin
parents: 2541
diff changeset
711 if (current_screen_type != SCREEN_GAME)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
712 pGUIWindow_CurrentMenu->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
713 pEventTimer->Pause();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
714 viewparams->sViewCenterX = pParty->vPosition.x;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
715 viewparams->sViewCenterY = pParty->vPosition.y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
716 pAudioPlayer->StopChannels(-1, -1);
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
717 pGUIWindow_CurrentMenu = new GUIWindow_Book(0, 0, window->GetWidth(), window->GetHeight(), uMessage, 0);
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
718 pBooksWindow = new GUIWindow_BooksWindow(546, 353, 0, 0, (int)pBtn_Maps, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
719 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
720 case UIMSG_OpenCalendar:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
721 DoThatMessageThing();
2542
a.parshin
parents: 2541
diff changeset
722 if (current_screen_type != SCREEN_GAME)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
723 pGUIWindow_CurrentMenu->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
724 pEventTimer->Pause();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
725 pAudioPlayer->StopChannels(-1, -1);
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
726 pGUIWindow_CurrentMenu = new GUIWindow_Book(0, 0, window->GetWidth(), window->GetHeight(), uMessage, 0);
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
727 pBooksWindow = new GUIWindow_BooksWindow(570, 354, 0, 0, (int)pBtn_Calendar, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
728 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
729 case UIMSG_OpenHistoryBook:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
730 DoThatMessageThing();
2542
a.parshin
parents: 2541
diff changeset
731 if (current_screen_type != SCREEN_GAME)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
732 pGUIWindow_CurrentMenu->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
733 pEventTimer->Pause();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
734 pAudioPlayer->StopChannels(-1, -1);
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
735 pGUIWindow_CurrentMenu = new GUIWindow_Book(0, 0, window->GetWidth(), window->GetHeight(), uMessage, 0);
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
736 pBooksWindow = new GUIWindow_BooksWindow(0x258u, 0x169u, 0, 0, (int)pBtn_History, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
737 bFlashHistoryBook = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
738 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
739 case UIMSG_Escape:// нажатие Escape and return to game
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
740 back_to_game();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
741 DoThatMessageThing();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
742 switch (current_screen_type)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
743 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
744 case SCREEN_E:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
745 __debugbreak();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
746 case SCREEN_NPC_DIALOGUE:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
747 case SCREEN_CHEST:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
748 case SCREEN_CHEST_INVENTORY:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
749 case SCREEN_CHANGE_LOCATION:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
750 case SCREEN_INPUT_BLV:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
751 case SCREEN_QUICK_REFERENCE:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
752 if (dword_50CDC8)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
753 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
754 CloseWindowBackground();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
755 uMessageParam = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
756 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
757 case SCREEN_HOUSE:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
758 if (!dword_50CDC8)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
759 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
760 CloseWindowBackground();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
761 uMessageParam = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
762 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
763 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
764 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
765 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
766 if (!pModalWindow)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
767 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
768 pRenderer->ClearZBuffer(0, 479);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
769 viewparams->bRedrawGameUI = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
770 viewparams->field_48 = 1;
2542
a.parshin
parents: 2541
diff changeset
771 if (current_screen_type != SCREEN_GAME)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
772 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
773 if (current_screen_type > SCREEN_67)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
774 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
775 if (current_screen_type == SCREEN_QUICK_REFERENCE)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
776 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
777 pIcons_LOD->RemoveTexturesPackFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
778 if (pGUIWindow_Settings)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
779 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
780 if (current_screen_type == SCREEN_CHARACTERS)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
781 pMouse->SetCursorBitmap("MICON2");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
782 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
783 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
784 pGUIWindow_Settings->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
785 pGUIWindow_Settings = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
786 pMouse->SetCursorBitmap("MICON1");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
787 GameUI_Footer_TimeLeft = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
788 _50C9A0_IsEnchantingInProgress = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
789 back_to_game();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
790 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
791 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
792 if ((signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
793 uActiveCharacter = pParty->GetNextActiveCharacter();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
794 pGUIWindow_CurrentMenu->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
795 if (pGUIWindow_CurrentMenu == window_SpeakInHouse)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
796 window_SpeakInHouse = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
797 pGUIWindow_CurrentMenu = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
798 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
799 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
800 viewparams->bRedrawGameUI = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
801 pIcons_LOD->RemoveTexturesFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
802 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
803 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
804 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
805 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
806 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
807 if (current_screen_type < SCREEN_64)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
808 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
809 switch (current_screen_type)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
810 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
811 case SCREEN_CASTING:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
812 pIcons_LOD->RemoveTexturesPackFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
813 if (some_active_character)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
814 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
815 uActiveCharacter = some_active_character;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
816 uActiveCharacter = pParty->GetNextActiveCharacter();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
817 some_active_character = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
818 if (pParty->bTurnBasedModeOn)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
819 pTurnEngine->ApplyPlayerAction();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
820 _50C9D0_AfterEnchClickEventId = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
821 _50C9D4_AfterEnchClickEventSecondParam = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
822 _50C9D8_AfterEnchClickEventTimeout = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
823 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
824 if (ptr_50C9A4_ItemToEnchant && ptr_50C9A4_ItemToEnchant->uItemID)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
825 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
826 LOBYTE(ptr_50C9A4_ItemToEnchant->uAttributes) &= 0xFu;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
827 _50C9A8_item_enchantment_timer = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
828 ptr_50C9A4_ItemToEnchant = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
829 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
830 if (pGUIWindow_Settings)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
831 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
832 if (current_screen_type == SCREEN_CHARACTERS)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
833 pMouse->SetCursorBitmap("MICON2");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
834 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
835 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
836 pGUIWindow_Settings->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
837 pGUIWindow_Settings = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
838 pMouse->SetCursorBitmap("MICON1");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
839 GameUI_Footer_TimeLeft = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
840 _50C9A0_IsEnchantingInProgress = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
841 back_to_game();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
842 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
843 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
844 if ((signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
845 uActiveCharacter = pParty->GetNextActiveCharacter();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
846 pGUIWindow_CurrentMenu->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
847 if (pGUIWindow_CurrentMenu == window_SpeakInHouse)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
848 window_SpeakInHouse = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
849 pGUIWindow_CurrentMenu = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
850 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
851 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
852 viewparams->bRedrawGameUI = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
853 pIcons_LOD->RemoveTexturesFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
854 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
855 case SCREEN_BOOKS:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
856 pBooksWindow->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
857 //crt_deconstruct_ptr_6A0118();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
858 pBooksWindow = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
859 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
860 if (pGUIWindow_Settings)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
861 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
862 if (current_screen_type == SCREEN_CHARACTERS)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
863 pMouse->SetCursorBitmap("MICON2");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
864 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
865 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
866 pGUIWindow_Settings->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
867 pGUIWindow_Settings = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
868 pMouse->SetCursorBitmap("MICON1");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
869 GameUI_Footer_TimeLeft = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
870 _50C9A0_IsEnchantingInProgress = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
871 back_to_game();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
872 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
873 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
874 if ((signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
875 uActiveCharacter = pParty->GetNextActiveCharacter();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
876 pGUIWindow_CurrentMenu->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
877 if (pGUIWindow_CurrentMenu == window_SpeakInHouse)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
878 window_SpeakInHouse = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
879 pGUIWindow_CurrentMenu = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
880 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
881 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
882 viewparams->bRedrawGameUI = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
883 pIcons_LOD->RemoveTexturesFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
884 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
885 case SCREEN_SAVEGAME:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
886 case SCREEN_LOADGAME:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
887 pIcons_LOD->RemoveTexturesPackFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
888 //crt_deconstruct_ptr_6A0118();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
889 stru_506E40.Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
890 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
891 case SCREEN_CHEST_INVENTORY:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
892 current_screen_type = SCREEN_CHEST;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
893 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
894 case SCREEN_CHEST:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
895 pWindow2 = pChestWindow;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
896 pWindow2->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
897 pIcons_LOD->RemoveTexturesPackFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
898 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
899 viewparams->bRedrawGameUI = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
900 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
901 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
902 case SCREEN_19:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
903 __debugbreak();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
904 pWindow2 = ptr_507BC8;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
905 pWindow2->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
906 pIcons_LOD->RemoveTexturesPackFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
907 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
908 viewparams->bRedrawGameUI = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
909 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
910 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
911 case SCREEN_OPTIONS://Close
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
912 options_menu_skin.Relaease();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
913 pIcons_LOD->SyncLoadedFilesCount();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
914 WriteWindowsRegistryInt("soundflag", (char)uSoundVolumeMultiplier);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
915 WriteWindowsRegistryInt("musicflag", (char)uMusicVolimeMultiplier);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
916 WriteWindowsRegistryInt("CharVoices", (char)uVoicesVolumeMultiplier);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
917 WriteWindowsRegistryInt("WalkSound", bWalkSound);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
918 WriteWindowsRegistryInt("ShowDamage", bShowDamage);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
919 //WriteWindowsRegistryInt("graphicsmode", (unsigned __int8)byte_6BE388_graphicsmode);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
920 WriteWindowsRegistryInt("valAlwaysRun", bAlwaysRun);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
921 WriteWindowsRegistryInt("FlipOnExit", bFlipOnExit);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
922 if (!uTurnSpeed)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
923 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
924 WriteWindowsRegistryInt("TurnDelta", 3);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
925 stru_506E40.Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
926 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
927 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
928 if (uTurnSpeed == 64)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
929 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
930 WriteWindowsRegistryInt("TurnDelta", 2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
931 stru_506E40.Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
932 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
933 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
934 if (uTurnSpeed != 128)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
935 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
936 stru_506E40.Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
937 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
938 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
939 WriteWindowsRegistryInt("TurnDelta", 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
940 stru_506E40.Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
941 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
942 case SCREEN_MENU:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
943 pIcons_LOD->SyncLoadedFilesCount();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
944 pIcons_LOD->RemoveTexturesPackFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
945 pIcons_LOD->SyncLoadedFilesCount();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
946 pIcons_LOD->RemoveTexturesPackFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
947 stru_506E40.Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
948 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
949 case SCREEN_VIDEO_OPTIONS:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
950 //if ( pRenderer->pRenderD3D )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
951 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
952 WriteWindowsRegistryInt("Colored Lights", pRenderer->bUseColoredLights);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
953 WriteWindowsRegistryInt("Tinting", pRenderer->bTinting);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
954 WriteWindowsRegistryInt("Bloodsplats", (LOBYTE(pEngine->uFlags2) >> 5) & 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
955 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
956
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
957 stru_506E40.Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
958 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
959
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
960 case SCREEN_KEYBOARD_OPTIONS://Return to game
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
961 v197 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
962 pKeyBindingFlag = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
963 for (uint i = 0; i < 28; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
964 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
965 if (GameMenuUI_InvaligKeyBindingsFlags[i])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
966 pKeyBindingFlag = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
967 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
968 if (!pKeyBindingFlag)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
969 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
970 for (uint i = 0; i < 5; i++)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
971 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
972 if (uTextureID_Optkb[i])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
973 pIcons_LOD->pTextures[uTextureID_Optkb[i]].Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
974 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
975 memset(&uTextureID_Optkb, 0, 20);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
976 pIcons_LOD->SyncLoadedFilesCount();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
977 for (uint i = 0; i < 28; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
978 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
979 if (pKeyActionMap->GetActionVKey((enum InputAction)i) != pPrevVirtualCidesMapping[i])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
980 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
981 if (v197)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
982 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
983 GUI_ReplaceHotkey(pKeyActionMap->GetActionVKey((enum InputAction)i), LOBYTE(pPrevVirtualCidesMapping[i]), 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
984 v197 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
985 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
986 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
987 GUI_ReplaceHotkey(pKeyActionMap->GetActionVKey((enum InputAction)i), LOBYTE(pPrevVirtualCidesMapping[i]), 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
988 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
989 if (i > 3 && i != 25 && i != 26)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
990 pKeyToggleType = TOGGLE_OneTimePress;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
991 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
992 pKeyToggleType = TOGGLE_Continuously;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
993 pKeyActionMap->SetKeyMapping(i, pPrevVirtualCidesMapping[i], pKeyToggleType);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
994 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
995 pKeyActionMap->StoreMappings();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
996 stru_506E40.Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
997 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
998 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
999 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1000 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1001 case SCREEN_REST://close rest screen
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
1002 if (_506F14_resting_stage)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1003 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1004 Rest(_506F18_num_minutes_to_sleep);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1005 pParty->pPlayers[3].SetAsleep(false);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1006 pParty->pPlayers[2].SetAsleep(false);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1007 pParty->pPlayers[1].SetAsleep(false);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1008 pParty->pPlayers[0].SetAsleep(false);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1009 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1010 pTexture_RestUI_CurrentSkyFrame->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1011 pTexture_RestUI_CurrentHourglassFrame->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1012 pTexture_RestUI_CurrentHourglassFrame = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1013 pTexture_RestUI_CurrentSkyFrame = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1014 pIcons_LOD->SyncLoadedFilesCount();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1015 pIcons_LOD->RemoveTexturesPackFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1016 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1017 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1018 pOutdoor->UpdateSunlightVectors();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1019 pOutdoor->UpdateFog();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1020 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1021 _506F18_num_minutes_to_sleep = 0;
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
1022 _506F14_resting_stage = 0;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1023 if (pGUIWindow_Settings)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1024 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1025 if (current_screen_type == SCREEN_CHARACTERS)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1026 pMouse->SetCursorBitmap("MICON2");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1027 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1028 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1029 pGUIWindow_Settings->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1030 pGUIWindow_Settings = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1031 pMouse->SetCursorBitmap("MICON1");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1032 GameUI_Footer_TimeLeft = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1033 _50C9A0_IsEnchantingInProgress = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1034 back_to_game();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1035 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1036 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1037 if ((signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1038 uActiveCharacter = pParty->GetNextActiveCharacter();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1039 pGUIWindow_CurrentMenu->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1040 if (pGUIWindow_CurrentMenu == window_SpeakInHouse)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1041 window_SpeakInHouse = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1042 pGUIWindow_CurrentMenu = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1043 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1044 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1045 viewparams->bRedrawGameUI = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1046 pIcons_LOD->RemoveTexturesFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1047 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1048 case SCREEN_E:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1049 __debugbreak();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1050 pGUIWindow_CurrentMenu->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1051 current_screen_type = SCREEN_HOUSE;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1052 pIcons_LOD->RemoveTexturesPackFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1053 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1054 case SCREEN_HOUSE:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1055 if (uDialogueType)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1056 uDialogueType = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1057 if (uGameState == GAME_STATE_CHANGE_LOCATION)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1058 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1059 while (HouseDialogPressCloseBtn())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1060 ;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1061 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1062 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1063 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1064 if (HouseDialogPressCloseBtn())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1065 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1066 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1067 GetHouseGoodbyeSpeech();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1068 pAudioPlayer->PlaySound(SOUND_WoodDoorClosing, 814, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1069 pMediaPlayer->Unload();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1070 pGUIWindow_CurrentMenu = window_SpeakInHouse;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1071 if (pGUIWindow_Settings)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1072 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1073 if (current_screen_type == SCREEN_CHARACTERS)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1074 pMouse->SetCursorBitmap("MICON2");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1075 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1076 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1077 pGUIWindow_Settings->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1078 pGUIWindow_Settings = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1079 pMouse->SetCursorBitmap("MICON1");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1080 GameUI_Footer_TimeLeft = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1081 _50C9A0_IsEnchantingInProgress = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1082 back_to_game();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1083 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1084 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1085 if ((signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1086 uActiveCharacter = pParty->GetNextActiveCharacter();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1087 pGUIWindow_CurrentMenu->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1088 if (pGUIWindow_CurrentMenu == window_SpeakInHouse)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1089 window_SpeakInHouse = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1090 pGUIWindow_CurrentMenu = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1091 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1092 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1093 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1094 pIcons_LOD->RemoveTexturesFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1095 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1096 case SCREEN_INPUT_BLV://click escape
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1097 if (uCurrentHouse_Animation == 153)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1098 PlayHouseSound(0x99u, HouseSound_Greeting_2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1099 pMediaPlayer->Unload();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1100 if (npcIdToDismissAfterDialogue)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1101 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1102 pParty->hirelingScrollPosition = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1103 LOBYTE(pNPCStats->pNewNPCData[npcIdToDismissAfterDialogue].uFlags) &= 0x7Fu;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1104 pParty->CountHirelings();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1105 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1106 npcIdToDismissAfterDialogue = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1107 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1108 DialogueEnding();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1109 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1110 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1111 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1112 case SCREEN_NPC_DIALOGUE://click escape
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1113 if (npcIdToDismissAfterDialogue)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1114 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1115 pParty->hirelingScrollPosition = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1116 LOBYTE(pNPCStats->pNewNPCData[npcIdToDismissAfterDialogue].uFlags) &= 0x7Fu;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1117 pParty->CountHirelings();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1118 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1119 npcIdToDismissAfterDialogue = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1120 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1121 //goto LABEL_317;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1122 DialogueEnding();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1123 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1124 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1125 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1126 case SCREEN_BRANCHLESS_NPC_DIALOG://click escape
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1127 memset(GameUI_Footer_TimedString.data(), 0, 0xC8u);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1128 sub_4452BB();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1129 DialogueEnding();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1130 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1131 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1132 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1133 case SCREEN_CHANGE_LOCATION://click escape
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1134 if (pParty->vPosition.x < -22528)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1135 pParty->vPosition.x = -22528;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1136 if (pParty->vPosition.x > 22528)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1137 pParty->vPosition.x = 22528;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1138 if (pParty->vPosition.y < -22528)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1139 pParty->vPosition.y = -22528;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1140 if (pParty->vPosition.y > 22528)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1141 pParty->vPosition.y = 22528;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1142 DialogueEnding();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1143 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1144 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1145 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1146 case SCREEN_VIDEO:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1147 pMediaPlayer->Unload();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1148 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1149 case SCREEN_CHARACTERS:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1150 CharacterUI_ReleaseButtons();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1151 ReleaseAwardsScrollBar();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1152 pIcons_LOD->RemoveTexturesPackFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1153 if (pGUIWindow_Settings)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1154 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1155 if (current_screen_type == SCREEN_CHARACTERS)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1156 pMouse->SetCursorBitmap("MICON2");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1157 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1158 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1159 pGUIWindow_Settings->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1160 pGUIWindow_Settings = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1161 pMouse->SetCursorBitmap("MICON1");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1162 GameUI_Footer_TimeLeft = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1163 _50C9A0_IsEnchantingInProgress = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1164 back_to_game();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1165 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1166 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1167 if ((signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1168 uActiveCharacter = pParty->GetNextActiveCharacter();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1169 pGUIWindow_CurrentMenu->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1170 if (pGUIWindow_CurrentMenu == window_SpeakInHouse)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1171 window_SpeakInHouse = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1172 pGUIWindow_CurrentMenu = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1173 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1174 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1175 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1176 pIcons_LOD->RemoveTexturesFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1177 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1178 default:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1179 if (pGUIWindow_Settings)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1180 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1181 if (current_screen_type == SCREEN_CHARACTERS)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1182 pMouse->SetCursorBitmap("MICON2");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1183 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1184 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1185 pGUIWindow_Settings->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1186 pGUIWindow_Settings = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1187 pMouse->SetCursorBitmap("MICON1");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1188 GameUI_Footer_TimeLeft = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1189 _50C9A0_IsEnchantingInProgress = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1190 back_to_game();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1191 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1192 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1193 if ((signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1194 uActiveCharacter = pParty->GetNextActiveCharacter();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1195 pGUIWindow_CurrentMenu->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1196 if (pGUIWindow_CurrentMenu == window_SpeakInHouse)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1197 window_SpeakInHouse = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1198 pGUIWindow_CurrentMenu = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1199 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1200 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1201 viewparams->bRedrawGameUI = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1202 pIcons_LOD->RemoveTexturesFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1203 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1204 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1205 if (pGUIWindow_Settings)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1206 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1207 if (current_screen_type == SCREEN_CHARACTERS)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1208 pMouse->SetCursorBitmap("MICON2");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1209 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1210 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1211 pGUIWindow_Settings->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1212 pGUIWindow_Settings = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1213 pMouse->SetCursorBitmap("MICON1");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1214 GameUI_Footer_TimeLeft = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1215 _50C9A0_IsEnchantingInProgress = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1216 back_to_game();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1217 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1218 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1219 if ((signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1220 uActiveCharacter = pParty->GetNextActiveCharacter();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1221 pGUIWindow_CurrentMenu->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1222 if (pGUIWindow_CurrentMenu == window_SpeakInHouse)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1223 window_SpeakInHouse = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1224 pGUIWindow_CurrentMenu = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1225 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1226 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1227 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1228 pIcons_LOD->RemoveTexturesFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1229 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1230 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1231 CharacterUI_ReleaseButtons();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1232 ReleaseAwardsScrollBar();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1233 pIcons_LOD->RemoveTexturesPackFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1234 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1235 if (pGUIWindow_Settings)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1236 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1237 if (current_screen_type == SCREEN_CHARACTERS)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1238 pMouse->SetCursorBitmap("MICON2");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1239 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1240 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1241 pGUIWindow_Settings->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1242 pGUIWindow_Settings = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1243 pMouse->SetCursorBitmap("MICON1");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1244 GameUI_Footer_TimeLeft = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1245 _50C9A0_IsEnchantingInProgress = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1246 back_to_game();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1247 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1248 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1249 if ((signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1250 uActiveCharacter = pParty->GetNextActiveCharacter();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1251 pGUIWindow_CurrentMenu->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1252 if (pGUIWindow_CurrentMenu == window_SpeakInHouse)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1253 window_SpeakInHouse = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1254 pGUIWindow_CurrentMenu = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1255 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1256 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1257 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1258 pIcons_LOD->RemoveTexturesFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1259 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1260 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1261 if (!pGUIWindow_Settings)//Draw Menu
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1262 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1263 dword_6BE138 = -1;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
1264 new OnButtonClick2(0x25Au, 0x1C2u, 0, 0, (int)pBtn_GameSettings, (char *)1);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1265 pEventTimer->Pause();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1266 pAudioPlayer->StopChannels(-1, -1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1267 current_screen_type = SCREEN_MENU;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1268
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1269 ++pIcons_LOD->uTexturePacksCount;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1270 if (!pIcons_LOD->uNumPrevLoadedFiles)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1271 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1272
2546
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
1273 pGUIWindow_CurrentMenu = new GUIWindow_GameMenu();
2542
a.parshin
parents: 2541
diff changeset
1274
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1275 viewparams->field_48 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1276
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1277 stru_506E40.Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1278 pRenderer->SaveScreenshot("gamma.pcx", 155, 117);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1279 stru_506E40.LoadPCXFile("gamma.pcx", 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1280
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1281 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1282 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1283 pGUIWindow_Settings->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1284 pGUIWindow_Settings = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1285 pMouse->SetCursorBitmap("MICON1");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1286 GameUI_Footer_TimeLeft = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1287 _50C9A0_IsEnchantingInProgress = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1288 back_to_game();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1289 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1290 }
2547
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
1291 pModalWindow->Release();
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
1292 pModalWindow = nullptr;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1293 continue;
2542
a.parshin
parents: 2541
diff changeset
1294
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1295 case UIMSG_ScrollNPCPanel://Right and Left button for NPCPanel
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1296 if (uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1297 {
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
1298 new OnButtonClick2(626, 179, 0, 0, (int)pBtn_NPCRight, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1299 v37 = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + (unsigned __int8)pParty->field_70A - 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1300 if (pParty->hirelingScrollPosition < v37)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1301 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1302 ++pParty->hirelingScrollPosition;//??? maybe number of the first cell???
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1303 if (pParty->hirelingScrollPosition >= v37)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1304 pParty->hirelingScrollPosition = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + pParty->field_70A - 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1305 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1306 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1307 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1308 {
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
1309 new OnButtonClick2(469, 179, 0, 0, (int)pBtn_NPCLeft, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1310 /*if ( pParty->field_709 )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1311 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1312 --pParty->field_709;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1313 if ( pParty->field_709 < 1 )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1314 pParty->field_709 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1315 }*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1316 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1317 GameUI_DrawHiredNPCs();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1318 continue;
2542
a.parshin
parents: 2541
diff changeset
1319
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1320 case UIMSG_TransitionUI_Confirm:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1321 DoThatMessageThing();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1322 dword_50CDC8 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1323 sub_42FBDD();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1324 PlayHouseSound(uCurrentHouse_Animation, HouseSound_NotEnoughMoney_TrainingSuccessful);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1325
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1326 if (pMovie_Track)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1327 pMediaPlayer->Unload();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1328 DialogueEnding();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1329 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1330 if (dword_59117C_teleportx | dword_591178_teleporty | dword_591174_teleportz | dword_591170_teleport_directiony | dword_59116C_teleport_directionx | dword_591168_teleport_speedz)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1331 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1332 if (dword_59117C_teleportx)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1333 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1334 pParty->vPosition.x = dword_59117C_teleportx;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1335 _5B65A8_npcdata_uflags_or_other = dword_59117C_teleportx;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1336 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1337 if (dword_591178_teleporty)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1338 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1339 pParty->vPosition.y = dword_591178_teleporty;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1340 _5B65AC_npcdata_fame_or_other = dword_591178_teleporty;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1341 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1342 if (dword_591174_teleportz)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1343 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1344 pParty->vPosition.z = dword_591174_teleportz;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1345 _5B65B0_npcdata_rep_or_other = dword_591174_teleportz;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1346 pParty->uFallStartY = dword_591174_teleportz;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1347 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1348 if (dword_591170_teleport_directiony)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1349 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1350 pParty->sRotationY = dword_591170_teleport_directiony;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1351 _5B65B4_npcdata_loword_house_or_other = dword_591170_teleport_directiony;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1352 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1353 if (dword_59116C_teleport_directionx)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1354 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1355 pParty->sRotationX = dword_59116C_teleport_directionx;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1356 _5B65B8_npcdata_hiword_house_or_other = dword_59116C_teleport_directionx;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1357 v38 = dword_591168_teleport_speedz;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1358 pParty->uFallSpeed = dword_591168_teleport_speedz;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1359 dword_5B65BC = dword_591168_teleport_speedz;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1360 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1361 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1362 v38 = dword_5B65BC;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1363 if (*dword_591164_teleport_map_name != 48)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1364 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1365 pGameLoadingUI_ProgressBar->uType = (GUIProgressBar::Type)2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1366 dword_5B65C0 = _5B65A8_npcdata_uflags_or_other | _5B65AC_npcdata_fame_or_other | _5B65B0_npcdata_rep_or_other | _5B65B4_npcdata_loword_house_or_other | _5B65B8_npcdata_hiword_house_or_other | v38;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1367 OnMapLeave();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1368 Transition_StopSound_Autosave(dword_591164_teleport_map_name, MapStartPoint_Party);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1369 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1370 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1371 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1372 EventProcessor(dword_5C3418, 0, 1, dword_5C341C);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1373 if (!_stricmp(byte_6BE3B0.data(), "d05.blv"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1374 pParty->uTimePlayed += 1474560i64;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1375 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1376 case UIMSG_TransitionWindowCloseBtn:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1377 CloseWindowBackground();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1378 pMediaPlayer->Unload();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1379 DialogueEnding();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1380 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1381 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1382 case UIMSG_CycleCharacters:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1383 v39 = GetAsyncKeyState(VK_SHIFT);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1384 uActiveCharacter = CycleCharacter(v39);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1385 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1386 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1387 case UIMSG_OnTravelByFoot:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1388 DoThatMessageThing();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1389 dword_50CDC8 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1390 sub_42FBDD();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1391 //pNPCData4 = (NPCData *)GetTravelTime();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1392 strcpy(pOutdoor->pLevelFilename, pCurrentMapName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1393 if (bUnderwater != 1 && pParty->bFlying
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1394 || pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pOut, 20) != 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1395 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1396 viewparams->bRedrawGameUI = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1397 CloseWindowBackground();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1398 if (pParty->vPosition.x < -22528)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1399 pParty->vPosition.x = -22528;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1400 if (pParty->vPosition.x > 22528)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1401 pParty->vPosition.x = 22528;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1402 if (pParty->vPosition.y < -22528)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1403 pParty->vPosition.y = -22528;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1404 if (pParty->vPosition.y > 22528)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1405 pParty->vPosition.y = 22528;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1406 DialogueEnding();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1407 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1408 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1409 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1410 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1411 pParty->field_6E4 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1412 pParty->field_6E0 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1413 CastSpellInfoHelpers::_427D48();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1414 DialogueEnding();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1415 pEventTimer->Pause();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1416 pGameLoadingUI_ProgressBar->Initialize(GUIProgressBar::TYPE_Box);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1417 ++pGameLoadingUI_ProgressBar->uProgressMax;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1418 SaveGame(1, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1419 pGameLoadingUI_ProgressBar->Progress();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1420 RestAndHeal(1440 * (signed int)GetTravelTime());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1421 if (pParty->uNumFoodRations)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1422 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1423 pParty->RestAndHeal();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1424 if (((pParty->uNumFoodRations - (signed int)GetTravelTime()) & 0x80000000u) != 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1425 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1426 pPlayer7 = pParty->pPlayers.data();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1427 do
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1428 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1429 pPlayer7->SetCondition(1, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1430 ++pPlayer7;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1431 } while ((signed int)pPlayer7 < (signed int)pParty->pHirelings.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1432 ++pParty->days_played_without_rest;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1433 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1434 Party::TakeFood((unsigned int)GetTravelTime());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1435 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1436 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1437 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1438 pPlayer8 = pParty->pPlayers.data();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1439 do
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1440 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1441 pPlayer8->SetCondition(1, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1442 ++pPlayer8;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1443 } while ((signed int)pPlayer8 < (signed int)pParty->pHirelings.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1444 ++pParty->days_played_without_rest;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1445 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1446 pPaletteManager->ResetNonLocked();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1447 pSpriteFrameTable->ResetSomeSpriteFlags();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1448 strcpy(pCurrentMapName, pOut);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1449 strcpy(pLevelName, pCurrentMapName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1450 v41 = strtok(pLevelName, ".");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1451 strcpy(pLevelName, v41);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1452 Level_LoadEvtAndStr(pLevelName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1453 pDecalBuilder->Reset(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1454 LoadLevel_InitializeLevelEvt();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1455 uLevelMapStatsID = pMapStats->GetMapInfo(pCurrentMapName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1456 bUnderwater = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1457 bNoNPCHiring = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1458 pEngine->uFlags2 &= 0xFFFFFFF7u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1459 if (Is_out15odm_underwater())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1460 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1461 bUnderwater = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1462 pEngine->uFlags2 |= 8u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1463 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1464 if (!_stricmp(pCurrentMapName, "out15.odm") || !_stricmp(pCurrentMapName, "d47.blv"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1465 bNoNPCHiring = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1466 PrepareToLoadODM(1u, (ODMRenderParams *)1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1467 pAudioPlayer->SetMapEAX();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1468 bDialogueUI_InitializeActor_NPC_ID = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1469 OnMapLoad();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1470 pOutdoor->SetFog();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1471 TeleportToStartingPoint(uLevel_StartingPointType);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1472 pParty->vPosition.z = GetTerrainHeightsAroundParty2(pParty->vPosition.x, pParty->vPosition.y, &v213, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1473 pParty->uFallStartY = pParty->vPosition.z;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1474 _461103_load_level_sub();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1475 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1476 viewparams->bRedrawGameUI = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1477 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1478 pGameLoadingUI_ProgressBar->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1479 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1480 viewparams->bRedrawGameUI = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1481 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1482 case UIMSG_CHANGE_LOCATION_ClickCencelBtn:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1483 CloseWindowBackground();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1484 if (pParty->vPosition.x < -22528)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1485 pParty->vPosition.x = -22528;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1486 if (pParty->vPosition.x > 22528)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1487 pParty->vPosition.x = 22528;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1488 if (pParty->vPosition.y < -22528)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1489 pParty->vPosition.y = -22528;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1490 if (pParty->vPosition.y > 22528)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1491 pParty->vPosition.y = 22528;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1492 DialogueEnding();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1493 current_screen_type = SCREEN_GAME;
2542
a.parshin
parents: 2541
diff changeset
1494 viewparams->bRedrawGameUI = true;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1495 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1496 case UIMSG_CastSpell_Telekinesis:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1497 //if ( pRenderer->pRenderD3D )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1498 LOWORD(v42) = pEngine->pVisInstance->get_picked_object_zbuf_val();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1499 /*else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1500 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1501 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v210);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1502 pPoint = pMouse->GetCursorPos(&v208);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1503 v42 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint->y]];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1504 }*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1505 v44 = (unsigned __int16)v42;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1506 v45 = PID_TYPE(v44);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1507 uNumSeconds = v44;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1508 v46 = PID_ID(v44);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1509 if (v45 == 3)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1510 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1511 v47 = pActors[v46].uAIState == Dead;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1512 if (!v47)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1513 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1514 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1515 pSpellInfo->uFlags &= ~0x40u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1516 pSpellInfo->uPlayerID_2 = uMessageParam;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1517 pSpellInfo->spell_target_pid = v44;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1518 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1519 pGUIWindow_Settings->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1520 pGUIWindow_Settings = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1521 pMouse->SetCursorBitmap("MICON1");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1522 GameUI_Footer_TimeLeft = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1523 _50C9A0_IsEnchantingInProgress = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1524 back_to_game();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1525 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1526 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1527 if (v45 == 2)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1528 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1529 v47 = (pObjectList->pObjects[pSpriteObjects[v46].uObjectDescID].uFlags & 0x10) == 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1530 if (!v47)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1531 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1532 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1533 pSpellInfo->uFlags &= ~0x40u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1534 pSpellInfo->uPlayerID_2 = uMessageParam;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1535 pSpellInfo->spell_target_pid = v44;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1536 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1537 pGUIWindow_Settings->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1538 pGUIWindow_Settings = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1539 pMouse->SetCursorBitmap("MICON1");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1540 GameUI_Footer_TimeLeft = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1541 _50C9A0_IsEnchantingInProgress = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1542 back_to_game();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1543 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1544 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1545 if (v45 == 5)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1546 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1547 v48 = pLevelDecorations[v46].uEventID == 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1548 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1549 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1550 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1551 if (v45 != 6)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1552 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1553 if (uCurrentlyLoadedLevelType != 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1554 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1555 pODMFace = &pOutdoor->pBModels[v44 >> 9].pFaces[v46 & 0x3F];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1556 if (!pODMFace->Clickable() || !pODMFace->sCogTriggeredID)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1557 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1558 v44 = uNumSeconds;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1559 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1560 pSpellInfo->uFlags &= ~0x40u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1561 pSpellInfo->uPlayerID_2 = uMessageParam;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1562 pSpellInfo->spell_target_pid = v44;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1563 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1564 pGUIWindow_Settings->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1565 pGUIWindow_Settings = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1566 pMouse->SetCursorBitmap("MICON1");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1567 GameUI_Footer_TimeLeft = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1568 _50C9A0_IsEnchantingInProgress = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1569 back_to_game();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1570 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1571 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1572 pBLVFace = &pIndoor->pFaces[v46];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1573 if (!pBLVFace->Clickable())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1574 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1575 v48 = pIndoor->pFaceExtras[pBLVFace->uFaceExtraID].uEventID == 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1576 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1577 if (v48)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1578 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1579 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1580 pSpellInfo->uFlags &= ~0x40u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1581 pSpellInfo->uPlayerID_2 = uMessageParam;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1582 pSpellInfo->spell_target_pid = v44;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1583 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1584 pGUIWindow_Settings->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1585 pGUIWindow_Settings = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1586 pMouse->SetCursorBitmap("MICON1");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1587 GameUI_Footer_TimeLeft = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1588 _50C9A0_IsEnchantingInProgress = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1589 back_to_game();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1590 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1591 case UIMSG_CastSpell_Character_Big_Improvement://Preservation and blessing, treatment paralysis, hand hammers(individual upgrade)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1592 case UIMSG_CastSpell_Character_Small_Improvement://Fate, cure
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1593 case UIMSG_HiredNPC_CastSpell:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1594 DoThatMessageThing();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1595 if (_50C9A0_IsEnchantingInProgress)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1596 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1597 uActiveCharacter = uMessageParam;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1598 viewparams->bRedrawGameUI = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1599 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1600 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1601 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1602 if (pGUIWindow_Settings)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1603 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1604 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1605 switch (uMessage)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1606 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1607 case UIMSG_CastSpell_Character_Big_Improvement:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1608 pSpellInfo->uFlags &= ~0x02u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1609 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1610 case UIMSG_CastSpell_Character_Small_Improvement:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1611 pSpellInfo->uFlags &= ~0x0100u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1612 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1613 case UIMSG_HiredNPC_CastSpell:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1614 pSpellInfo->uFlags &= ~0x0200u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1615 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1616 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1617 pSpellInfo->uPlayerID_2 = uMessageParam;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1618 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1619 pGUIWindow_Settings->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1620 pGUIWindow_Settings = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1621 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1622 pMouse->SetCursorBitmap("MICON1");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1623 GameUI_Footer_TimeLeft = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1624 _50C9A0_IsEnchantingInProgress = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1625 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1626 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1627 continue;
2542
a.parshin
parents: 2541
diff changeset
1628
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1629 case UIMSG_BF:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1630 __debugbreak();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1631 dword_50CDC8 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1632 sub_42FBDD();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1633 SaveGame(1, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1634 strcpy(pCurrentMapName, pMapStats->pInfos[uHouse_ExitPic].pFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1635 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1636 uGameState = GAME_STATE_CHANGE_LOCATION;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1637 //v53 = p2DEvents_minus1_::30[26 * (unsigned int)ptr_507BC0->ptr_1C];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1638 v53 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1]._quest_related;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1639 if (v53 < 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1640 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1641 v54 = abs(v53) - 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1642 _5B65B8_npcdata_hiword_house_or_other = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1643 dword_5B65BC = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1644 v55 = dword_4E4560[v54];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1645 _5B65AC_npcdata_fame_or_other = dword_4E4578[v54];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1646 v56 = dword_4E4590[v54];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1647 v57 = dword_4E45A8[v54];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1648 _5B65A8_npcdata_uflags_or_other = v55;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1649 _5B65B4_npcdata_loword_house_or_other = v57;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1650 _5B65B0_npcdata_rep_or_other = v56;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1651 dword_5B65C0 = v55 | _5B65AC_npcdata_fame_or_other | v56 | v57;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1652 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1653 HouseDialogPressCloseBtn();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1654 //goto LABEL_434;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1655 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1656 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1657 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1658 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1659 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1660 ++pMessageQueue_50CBD0->uNumMessages;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1661 }*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1662 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 1, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1663 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1664
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1665 case UIMSG_OnCastTownPortal:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1666 pAudioPlayer->StopChannels(-1, -1);
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
1667 pGUIWindow_CurrentMenu = new GUIWindow_Book(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_TownPortal, (char *)uMessageParam);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1668 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1669
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1670 case UIMSG_OnCastLloydsBeacon:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1671 pAudioPlayer->StopChannels(-1, -1);
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
1672 pGUIWindow_CurrentMenu = new GUIWindow_Book(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_LloydsBeacon, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1673 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1674
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1675 case UIMSG_LloydsBeacon_FlippingBtn:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1676 bRecallingBeacon = uMessageParam;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1677 v127 = uMessageParam + 204;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1678 pAudioPlayer->PlaySound((SoundID)v127, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1679 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1680 case UIMSG_HintBeaconSlot:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1681 if (!pGUIWindow_CurrentMenu)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1682 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1683 pPlayer = pPlayers[_506348_current_lloyd_playerid + 1];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1684 uNumSeconds = (unsigned int)&pPlayer->pInstalledBeacons[uMessageParam];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1685 if (bRecallingBeacon)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1686 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1687 if (!*((int *)&pSavegameThumbnails[10 * uMessageParam].pPixels))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1688 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1689 v173 = pMapStats->pInfos[pMapStats->sub_410D99_get_map_index(pPlayer->pInstalledBeacons[uMessageParam].SaveFileID)].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1690 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[474], v173);// "Recall to %s"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1691 GameUI_SetFooterString(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1692 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1693 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1694 pMapNum = pMapStats->GetMapInfo(pCurrentMapName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1695 pMapName = "Not in Map Stats";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1696 if (pMapNum)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1697 pMapName = pMapStats->pInfos[pMapNum].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1698 if (!*((int *)&pSavegameThumbnails[10 * uMessageParam].pPixels) || !pMapNum)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1699 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1700 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[476], pMapName);// "Set to %s"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1701 GameUI_SetFooterString(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1702 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1703 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1704 v174 = pMapStats->pInfos[pMapStats->sub_410D99_get_map_index(*(short *)(uNumSeconds + 26))].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1705 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[475], (unsigned int)pMapName, v174);// "Set %s over %s"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1706 GameUI_SetFooterString(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1707 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1708 case UIMSG_CloseAfterInstallBeacon:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1709 dword_50CDC8 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1710 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1711 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1712 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1713 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1714 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1715 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1716 ++pMessageQueue_50CBD0->uNumMessages;*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1717 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1718 case UIMSG_InstallBeacon:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1719 pPlayer9 = pPlayers[_506348_current_lloyd_playerid + 1];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1720 if (!pPlayer9->pInstalledBeacons[uMessageParam].uBeaconTime && bRecallingBeacon)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1721 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1722 byte_506360 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1723 pPlayer9->CanCastSpell(uRequiredMana);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1724 if (pParty->bTurnBasedModeOn)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1725 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1726 v60 = sRecoveryTime;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1727 pParty->pTurnBasedPlayerRecoveryTimes[_506348_current_lloyd_playerid] = sRecoveryTime;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1728 pPlayer9->SetRecoveryTime(v60);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1729 pTurnEngine->ApplyPlayerAction();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1730 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1731 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1732 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1733 pPlayer9->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333));
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1734 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1735 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[lloyds_beacon_spell_id], 0, 0, -1, 0, lloyds_beacon_sound_id, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1736 if (bRecallingBeacon)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1737 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1738 if (_stricmp(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID]))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1739 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1740 SaveGame(1, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1741 OnMapLeave();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1742 strcpy(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID]);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1743 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1744 uGameState = GAME_STATE_CHANGE_LOCATION;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1745 _5B65A8_npcdata_uflags_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1746 _5B65AC_npcdata_fame_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1747 _5B65B0_npcdata_rep_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1748 _5B65B4_npcdata_loword_house_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1749 _5B65B8_npcdata_hiword_house_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1750 dword_5B65C0 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1751 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1752 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1753 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1754 pParty->vPosition.x = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1755 pParty->vPosition.y = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1756 pParty->vPosition.z = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1757 pParty->uFallStartY = pParty->vPosition.z;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1758 pParty->sRotationY = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1759 pParty->sRotationX = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1760 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1761 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 1, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1762 pBooksWindow->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1763 pGUIWindow_CurrentMenu->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1764 pBooksWindow = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1765 pGUIWindow_CurrentMenu = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1766 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1767 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1768 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1769 sprintf(a1, "data\\lloyd%d%d.pcx", _506348_current_lloyd_playerid + 1, uMessageParam + 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1770 pRenderer->SaveScreenshot(a1, 92, 68);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1771 LoadThumbnailLloydTexture(uMessageParam, _506348_current_lloyd_playerid + 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1772 pPlayer9->pInstalledBeacons[uMessageParam].uBeaconTime = pParty->uTimePlayed + (signed __int64)((double)(lloyds_beacon_spell_level << 7) * 0.033333335);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1773 pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X = pParty->vPosition.x;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1774 pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y = pParty->vPosition.y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1775 pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z = pParty->vPosition.z;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1776 pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X = LOWORD(pParty->sRotationY);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1777 pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y = LOWORD(pParty->sRotationX);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1778 if ((signed int)pGames_LOD->uNumSubDirs / 2 <= 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1779 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1780 for (thisg = 0; thisg < (signed int)pGames_LOD->uNumSubDirs / 2; ++thisg)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1781 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1782 if (!_stricmp(pGames_LOD->pSubIndices[thisg].pFilename, pCurrentMapName))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1783 pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID = thisg;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1784 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1785 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1786 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1787 case UIMSG_ClickTownInTP:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1788 if (uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1789 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1790 switch (uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1791 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1792 case 1:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1793 v63 = 208;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1794 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1795 case 2:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1796 v63 = 207;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1797 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1798 case 3:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1799 v63 = 211;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1800 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1801 case 4:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1802 v63 = 209;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1803 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1804 default:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1805 if (uMessageParam != 5)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1806 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1807 LABEL_486:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1808 SaveGame(1, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1809 v64 = pMapStats->GetMapInfo(pCurrentMapName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1810 v65 = uMessageParam;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1811 if (v64 == TownPortalList[uMessageParam].uMapInfoID)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1812 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1813 pParty->vPosition.x = TownPortalList[v65].pos.x;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1814 pParty->vPosition.y = TownPortalList[v65].pos.y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1815 pParty->vPosition.z = TownPortalList[v65].pos.z;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1816 pParty->uFallStartY = pParty->vPosition.z;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1817 pParty->sRotationY = TownPortalList[v65].rot_y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1818 pParty->sRotationX = TownPortalList[v65].rot_x;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1819 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1820 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1821 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1822 SaveGame(1, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1823 OnMapLeave();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1824 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1825 uGameState = GAME_STATE_CHANGE_LOCATION;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1826 strcpy(pCurrentMapName, pMapStats->pInfos[TownPortalList[uMessageParam].uMapInfoID].pFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1827 dword_5B65C0 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1828 _5B65A8_npcdata_uflags_or_other = TownPortalList[uMessageParam].pos.x;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1829 _5B65AC_npcdata_fame_or_other = TownPortalList[uMessageParam].pos.y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1830 _5B65B0_npcdata_rep_or_other = TownPortalList[uMessageParam].pos.z;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1831 v66 = TownPortalList[uMessageParam].rot_x;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1832 _5B65B4_npcdata_loword_house_or_other = TownPortalList[uMessageParam].rot_y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1833 _5B65B8_npcdata_hiword_house_or_other = v66;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1834 Actor::InitializeActors();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1835 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1836 v67 = (char*)pGUIWindow_CurrentMenu->Hint;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1837 if (v67)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1838 *((int *)v67 + 17) = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1839 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1840 pParty->pPlayers[(unsigned __int8)town_portal_caster_id].CanCastSpell(0x14u);
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
1841
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1842 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 1, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1843 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1844 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1845 v63 = 210;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1846 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1847 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1848 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1849 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1850 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1851 v63 = 206;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1852 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1853 if (!(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v63))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1854 return;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1855 goto LABEL_486;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1856 case UIMSG_HintTownPortal:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1857 if (uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1858 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1859 switch (uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1860 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1861 case 1:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1862 v68 = 208;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1863 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1864 case 2:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1865 v68 = 207;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1866 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1867 case 3:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1868 v68 = 211;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1869 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1870 case 4:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1871 v68 = 209;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1872 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1873 default:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1874 if (uMessageParam != 5)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1875 //goto LABEL_506;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1876 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1877 if (uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1878 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1879 switch (uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1880 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1881 case 1:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1882 v69 = pMapStats->pInfos[4].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1883 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1884 case 2:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1885 v69 = pMapStats->pInfos[3].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1886 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1887 case 3:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1888 v69 = pMapStats->pInfos[10].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1889 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1890 case 4:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1891 v69 = pMapStats->pInfos[7].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1892 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1893 default:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1894 if (uMessageParam != 5)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1895 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1896 __debugbreak(); // warning C4700: uninitialized local variable 'v200' used
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1897 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v200);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1898 GameUI_SetFooterString(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1899 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1900 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1901 v69 = pMapStats->pInfos[8].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1902 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1903 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1904 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1905 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1906 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1907 v69 = pMapStats->pInfos[21].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1908 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1909 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v69);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1910 GameUI_SetFooterString(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1911 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1912 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1913 v68 = 210;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1914 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1915 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1916 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1917 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1918 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1919 v68 = 206;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1920 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1921 if (!(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v68))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1922 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1923 pRenderer->DrawTextureRGB(0, 0x160u, pTexture_StatusBar);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1924 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1925 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1926 //LABEL_506:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1927 if (uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1928 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1929 switch (uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1930 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1931 case 1:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1932 v69 = pMapStats->pInfos[4].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1933 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1934 case 2:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1935 v69 = pMapStats->pInfos[3].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1936 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1937 case 3:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1938 v69 = pMapStats->pInfos[10].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1939 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1940 case 4:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1941 v69 = pMapStats->pInfos[7].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1942 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1943 default:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1944 if (uMessageParam != 5)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1945 //goto LABEL_519;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1946 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1947 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v200);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1948 GameUI_SetFooterString(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1949 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1950 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1951 v69 = pMapStats->pInfos[8].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1952 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1953 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1954 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1955 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1956 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1957 v69 = pMapStats->pInfos[21].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1958 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1959 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v69);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1960 GameUI_SetFooterString(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1961 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1962 case UIMSG_ShowFinalWindow:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1963 sprintfex(pFinalMessage.data(), "%s\n \n%s\n \n%s", pGlobalTXT_LocalizationStrings[151],// "Congratulations Adventurer."
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1964 pGlobalTXT_LocalizationStrings[118],// "We hope that you've enjoyed playing Might and Magic VII as much as we did making it. We have saved this screen as MM7_WIN.PCX in your MM7 directory. You can print it out as proof of your accomplishment."
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1965 pGlobalTXT_LocalizationStrings[167]);// "- The Might and Magic VII Development Team."
2547
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
1966 pModalWindow = new GUIWindow_Modal(pFinalMessage.data(), UIMSG_OnFinalWindowClose);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1967 uGameState = GAME_STATE_FINAL_WINDOW;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1968 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1969 case UIMSG_OnFinalWindowClose:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1970 __debugbreak();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1971 uGameState = GAME_STATE_PLAYING;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1972 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, "2");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1973 __debugbreak(); // missed break/continue?
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1974 case UIMSG_DD:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1975 __debugbreak();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1976 sprintf(pTmpBuf.data(), "%s", pKeyActionMap->pPressedKeysBuffer);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1977 memcpy(&v216, txt_file_frametable_parser(pKeyActionMap->pPressedKeysBuffer, &v218), sizeof(v216));
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1978 if (v216.uPropCount == 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1979 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1980 pNPCData4 = (NPCData *)((signed int)pGames_LOD->uNumSubDirs / 2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1981 v70 = atoi(v216.pProperties[0]);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1982 if (v70 <= 0 || v70 >= 77)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1983 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1984 v71 = v70;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1985 strcpy(Str2, pMapStats->pInfos[v70].pFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1986 pNPCData3 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1987 if ((signed int)pNPCData4 > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1988 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1989 thish = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1990 do
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1991 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1992 if (!_stricmp(pGames_LOD->pSubIndices[thish].pFilename, Str2))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1993 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1994 ++thish;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1995 pNPCData3 = (NPCData *)((char *)pNPCData3 + 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1996 } while ((signed int)pNPCData3 < (signed int)pNPCData4);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1997 if ((signed int)pNPCData3 < (signed int)pNPCData4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1998 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1999 strcpy(pCurrentMapName, pGames_LOD->pSubIndices[(int)pNPCData3].pFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2000 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2001 uGameState = GAME_STATE_CHANGE_LOCATION;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2002 OnMapLeave();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2003 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2004 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2005 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2006 sprintf(Str2, "No map found for %s", pMapStats->pInfos[v71].pName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2007 v73 = Str2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2008 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2009 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2010 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2011 if (v216.uPropCount != 3)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2012 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2013 v74 = atoi(v216.pProperties[0]);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2014 thisi = atoi(v216.pProperties[1]);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2015 v75 = atoi(v216.pProperties[2]);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2016 v76 = v75;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2017 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2018 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2019 if (pIndoor->GetSector(v74, thisi, v75))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2020 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2021 v77 = thisi;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2022 pParty->vPosition.x = v74;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2023 pParty->vPosition.y = v77;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2024 pParty->vPosition.z = v76;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2025 pParty->uFallStartY = v76;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2026 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2027 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2028 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2029 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2030 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2031 if (v74 > -32768)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2032 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2033 if (v74 < 32768)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2034 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2035 v77 = thisi;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2036 if (thisi > -32768)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2037 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2038 if (thisi < 32768 && v76 >= 0 && v76 < 10000)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2039 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2040 pParty->vPosition.x = v74;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2041 pParty->vPosition.y = v77;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2042 pParty->vPosition.z = v76;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2043 pParty->uFallStartY = v76;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2044 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2045 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2046 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2047 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2048 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2049 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2050 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2051 v73 = "Can't jump to that location!";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2052 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2053 ShowStatusBarString(v73, 6);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2054 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2055 case UIMSG_CastQuickSpell:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2056 if (bUnderwater == 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2057 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2058 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2059 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2060 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2061 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2062 if (!uActiveCharacter || (pPlayer2 = pPlayers[uActiveCharacter], pPlayer2->uTimeToRecovery))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2063 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2064 _42777D_CastSpell_UseWand_ShootArrow(pPlayer2->uQuickSpell, uActiveCharacter - 1, 0, 0, uActiveCharacter);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2065 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2066 case UIMSG_CastSpell_Monster_Improvement:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2067 case UIMSG_CastSpell_Shoot_Monster://FireBlow, Lightning, Ice Lightning, Swarm,
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2068 //if ( pRenderer->pRenderD3D )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2069 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2070 v81 = pEngine->pVisInstance->get_picked_object_zbuf_val();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2071 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2072 /*else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2073 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2074 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v206);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2075 pPoint2 = pMouse->GetCursorPos(&v201);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2076 v81 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint2->y]];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2077 }*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2078 v83 = v81;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2079 v44 = (unsigned __int16)v81;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2080 v84 = v83 >> 16;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2081 if (PID_TYPE(v44) != 3 || v84 >= 5120)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2082 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2083 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2084 if (uMessage == UIMSG_CastSpell_Shoot_Monster)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2085 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2086 pSpellInfo->uFlags &= ~0x08;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2087 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2088 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2089 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2090 if (uMessage == UIMSG_CastSpell_Monster_Improvement)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2091 pSpellInfo->uFlags &= ~0x0100u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2092 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2093 pSpellInfo->uFlags &= ~0x0200u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2094 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2095 pSpellInfo->uPlayerID_2 = uMessageParam;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2096 pSpellInfo->spell_target_pid = v44;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2097 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2098 pGUIWindow_Settings->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2099 pGUIWindow_Settings = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2100 pMouse->SetCursorBitmap("MICON1");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2101 GameUI_Footer_TimeLeft = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2102 _50C9A0_IsEnchantingInProgress = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2103 back_to_game();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2104 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2105 case UIMSG_1C:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2106 __debugbreak();
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2107 if (!uActiveCharacter || current_screen_type != SCREEN_GAME)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2108 continue;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2109 __debugbreak();//ptr_507BC8 = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_68, uMessageParam, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2110 current_screen_type = SCREEN_19;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2111 pEventTimer->Pause();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2112 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2113 case UIMSG_STEALFROMACTOR:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2114 if (!uActiveCharacter)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2115 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2116 if (pParty->bTurnBasedModeOn != 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2117 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2118 if (pActors[uMessageParam].uAIState == 5)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2119 pActors[uMessageParam].LootActor();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2120 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2121 Actor::StealFrom(uMessageParam);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2122 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2123 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2124 if (pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_MOVEMENT)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2125 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2126 if (!(pTurnEngine->field_18 & TE_HAVE_PENDING_ACTIONS))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2127 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2128 if (pActors[uMessageParam].uAIState == 5)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2129 pActors[uMessageParam].LootActor();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2130 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2131 Actor::StealFrom(uMessageParam);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2132 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2133 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2134
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2135 case UIMSG_Attack:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2136 if (!uActiveCharacter)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2137 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2138 if (pParty->bTurnBasedModeOn != 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2139 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2140 Player::_42ECB5_PlayerAttacksActor();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2141 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2142 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2143 if (pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_MOVEMENT)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2144 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2145 if (!(pTurnEngine->field_18 & TE_HAVE_PENDING_ACTIONS))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2146 Player::_42ECB5_PlayerAttacksActor();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2147 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2148 case UIMSG_ExitRest:
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2149 new OnCancel(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, (int)pButton_RestUI_Exit, pGlobalTXT_LocalizationStrings[81]);// "Exit Rest"
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2150 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2151 case UIMSG_Wait5Minutes:
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2152 if (_506F14_resting_stage == 2)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2153 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2154 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2155 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2156 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2157 }
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2158 new OnButtonClick2(pButton_RestUI_Wait5Minutes->uX, pButton_RestUI_Wait5Minutes->uY, 0, 0,
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2159 (int)pButton_RestUI_Wait5Minutes, pGlobalTXT_LocalizationStrings[238]);// "Wait 5 Minutes"
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2160 _506F14_resting_stage = 1;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2161 _506F18_num_minutes_to_sleep = 5;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2162 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2163 case UIMSG_Wait1Hour:
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2164 if (_506F14_resting_stage == 2)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2165 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2166 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2167 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2168 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2169 }
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2170 new OnButtonClick2(pButton_RestUI_Wait1Hour->uX, pButton_RestUI_Wait1Hour->uY, 0, 0,
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2171 (int)pButton_RestUI_Wait1Hour, pGlobalTXT_LocalizationStrings[239]);// "Wait 1 Hour"
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2172 _506F14_resting_stage = 1;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2173 _506F18_num_minutes_to_sleep = 60;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2174 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2175 case UIMSG_RentRoom:
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2176 _506F14_resting_stage = 2;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2177
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2178 PrepareToLoadRestUI();
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2179 current_screen_type = SCREEN_REST;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2180 pGUIWindow_CurrentMenu = RestUI_Load();
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2181
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2182 v86 = 60 * (_494820_training_time(pParty->uCurrentHour) + 1) - pParty->uCurrentMinute;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2183 _506F18_num_minutes_to_sleep = v86;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2184 if (uMessageParam == 111 || uMessageParam == 114 || uMessageParam == 116) // 107 = Emerald Isle tavern
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2185 _506F18_num_minutes_to_sleep = v86 + 12 * 60;
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2186 _506F14_resting_stage = 2;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2187 pParty->RestAndHeal();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2188 pParty->days_played_without_rest = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2189 pParty->pPlayers[3].SetAsleep(1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2190 pParty->pPlayers[2].SetAsleep(1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2191 pParty->pPlayers[1].SetAsleep(1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2192 pParty->pPlayers[0].SetAsleep(1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2193 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2194 case UIMSG_RestWindow:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2195 DoThatMessageThing();
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2196 if (current_screen_type != SCREEN_GAME)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2197 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2198 if (CheckActors_proximity())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2199 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2200 if (pParty->bTurnBasedModeOn == 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2201 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2202 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2203 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2204 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2205 v88 = pGlobalTXT_LocalizationStrings[480];// "There are hostile enemies near!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2206 if (pParty->uFlags & 0x88)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2207 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2208 ShowStatusBarString(v88, 2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2209 if (!uActiveCharacter)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2210 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2211 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2212 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2213 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2214 if (pParty->bTurnBasedModeOn == 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2215 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2216 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2217 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2218 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2219 if (!(pParty->uFlags & 0x88))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2220 {
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2221 PrepareToLoadRestUI();
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2222 current_screen_type = SCREEN_REST;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2223 pGUIWindow_CurrentMenu = RestUI_Load();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2224 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2225 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2226 if (pParty->bTurnBasedModeOn == 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2227 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2228 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2229 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2230 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2231 v88 = pGlobalTXT_LocalizationStrings[480];// "There are hostile enemies near!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2232 if (pParty->uFlags & 0x88)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2233 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!"
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2234 ShowStatusBarString(v88, 2);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2235 if (!uActiveCharacter)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2236 continue;
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2237 pPlayers[uActiveCharacter]->PlaySound(SPEECH_CantRestHere, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2238 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2239 case UIMSG_Rest8Hour:
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2240 if (_506F14_resting_stage != 0)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2241 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2242 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2243 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2244 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2245 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2246 if (pParty->uNumFoodRations < uRestUI_FoodRequiredToRest)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2247 {
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2248 ShowStatusBarString(pGlobalTXT_LocalizationStrings[482], 2);// "You don't have enough food to rest"
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2249 if (uActiveCharacter && pPlayers[uActiveCharacter]->CanAct())
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2250 pPlayers[uActiveCharacter]->PlaySound(SPEECH_108, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2251 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2252 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2253 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2254 pParty->pPlayers[3].pConditions[Condition_Sleep] = pParty->uTimePlayed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2255 pParty->pPlayers[2].pConditions[Condition_Sleep] = pParty->uTimePlayed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2256 pParty->pPlayers[1].pConditions[Condition_Sleep] = pParty->uTimePlayed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2257 pParty->pPlayers[0].pConditions[Condition_Sleep] = pParty->uTimePlayed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2258 v90 = pMapStats->GetMapInfo(pCurrentMapName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2259 if (!v90)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2260 v90 = rand() % (signed int)pMapStats->uNumMaps + 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2261 pMapInfo = &pMapStats->pInfos[v90];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2262 if (rand() % 100 + 1 <= pMapInfo->Encounter_percent)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2263 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2264 v91 = rand() % 100;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2265 v92 = pMapInfo->EncM1percent;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2266 v93 = v91 + 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2267 if (v93 > v92)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2268 pNPCData4 = (NPCData *)((v93 > v92 + pMapInfo->EncM2percent) + 2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2269 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2270 pNPCData4 = (NPCData *)1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2271 if (!_45063B_spawn_some_monster(pMapInfo, (int)pNPCData4))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2272 pNPCData4 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2273 if (pNPCData4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2274 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2275 pPlayerNum = rand() % 4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2276 pParty->pPlayers[pPlayerNum].pConditions[Condition_Sleep] = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2277 v95 = rand();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2278 Rest(v95 % 6 + 60);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2279 _506F18_num_minutes_to_sleep = 0;
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2280 _506F14_resting_stage = 0;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2281
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2282 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2283 ShowStatusBarString(pGlobalTXT_LocalizationStrings[481], 2);// "Encounter!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2284 pAudioPlayer->PlaySound(SOUND_encounter, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2285 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2286 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2287 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2288 Party::TakeFood(uRestUI_FoodRequiredToRest);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2289 _506F18_num_minutes_to_sleep = 480;
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2290 _506F14_resting_stage = 2;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2291 pParty->RestAndHeal();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2292 pParty->days_played_without_rest = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2293 pParty->pPlayers[3].SetAsleep(1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2294 pParty->pPlayers[2].SetAsleep(1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2295 pParty->pPlayers[1].SetAsleep(1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2296 pParty->pPlayers[0].SetAsleep(1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2297 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2298 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2299 case UIMSG_AlreadyResting:
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2300 if (_506F14_resting_stage == 2)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2301 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2302 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2303 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2304 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2305 }
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2306 new OnButtonClick2(pButton_RestUI_WaitUntilDawn->uX, pButton_RestUI_WaitUntilDawn->uY, 0, 0,
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2307 (int)pButton_RestUI_WaitUntilDawn, pGlobalTXT_LocalizationStrings[237]);// "Wait until Dawn"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2308 v97 = _494820_training_time(pParty->uCurrentHour);
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2309 _506F14_resting_stage = 1;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2310 _506F18_num_minutes_to_sleep = 60 * v97 - pParty->uCurrentMinute;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2311 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2312 case UIMSG_HintSelectRemoveQuickSpellBtn:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2313 if (quick_spell_at_page && byte_506550)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2314 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2315 v173 = pSpellStats->pInfos[quick_spell_at_page + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2316 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[483], v173);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2317 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2318 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2319 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2320 if (pPlayers[uActiveCharacter]->uQuickSpell)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2321 v177 = pGlobalTXT_LocalizationStrings[584];// "Click here to remove your Quick Spell"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2322 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2323 v177 = pGlobalTXT_LocalizationStrings[484];// "Select a spell then click here to set a QuickSpell"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2324 strcpy(pTmpBuf.data(), v177);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2325 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2326 GameUI_SetFooterString(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2327 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2328 case UIMSG_SPellbook_ShowHightlightedSpellInfo:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2329 if (!uActiveCharacter || (uNumSeconds = (unsigned int)pPlayers[uActiveCharacter],
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2330 !*(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + 6734) + uMessageParam + 402)))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2331 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2332 if (sub_4637E0_is_there_popup_onscreen())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2333 dword_507B00_spell_info_to_draw_in_popup = uMessageParam + 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2334 v98 = *(char *)(uNumSeconds + 6734);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2335 if (quick_spell_at_page - 1 == uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2336 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2337 v178 = pSpellStats->pInfos[uMessageParam + 11 * v98 + 1].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2338 v161 = pGlobalTXT_LocalizationStrings[485];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2339 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2340 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2341 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2342 v178 = pSpellStats->pInfos[uMessageParam + 11 * v98 + 1].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2343 v161 = pGlobalTXT_LocalizationStrings[486];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2344 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2345 sprintfex(pTmpBuf.data(), v161, v178);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2346 GameUI_SetFooterString(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2347 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2348 case UIMSG_ClickInstallRemoveQuickSpellBtn:
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2349 new OnButtonClick2(pBtn_InstallRemoveSpell->uX, pBtn_InstallRemoveSpell->uY, 0, 0, (int)pBtn_InstallRemoveSpell, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2350 if (!uActiveCharacter)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2351 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2352 pPlayer10 = pPlayers[uActiveCharacter];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2353 if (!byte_506550 || !quick_spell_at_page)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2354 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2355 pPlayer10->uQuickSpell = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2356 quick_spell_at_page = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2357 pAudioPlayer->PlaySound(SOUND_fizzle, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2358 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2359 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2360 pPlayers[uActiveCharacter]->uQuickSpell = quick_spell_at_page + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2361 AA1058_PartyQuickSpellSound[uActiveCharacter - 1].AddPartySpellSound(pPlayers[uActiveCharacter]->uQuickSpell, uActiveCharacter);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2362 if (uActiveCharacter)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2363 pPlayer10->PlaySound(SPEECH_12, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2364 byte_506550 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2365 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2366 case UIMSG_SpellBook_PressTab://перелистывание страниц клавишей Tab
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2367 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2368 if (!uActiveCharacter)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2369 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2370 int skill_count = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2371 uAction = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2372 for (uint i = 0; i < 9; i++)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2373 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2374 if (pPlayers[uActiveCharacter]->pActiveSkills[PLAYER_SKILL_FIRE + i])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2375 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2376 if (pPlayers[uActiveCharacter]->lastOpenedSpellbookPage == i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2377 uAction = skill_count;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2378 v217[skill_count++] = i;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2379 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2380 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2381 if (!skill_count)//нет скиллов
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2382 pAudioPlayer->PlaySound((SoundID)(rand() % 2 + SOUND_TurnPageU), 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2383 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2384 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2385 if (GetAsyncKeyState(VK_SHIFT))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2386 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2387 --uAction;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2388 if (uAction < 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2389 uAction = skill_count - 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2390 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2391 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2392 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2393 ++uAction;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2394 if (uAction >= skill_count)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2395 uAction = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2396 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2397 OnCloseSpellBookPage();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2398 pPlayers[uActiveCharacter]->lastOpenedSpellbookPage = LOBYTE(v217[uAction]);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2399 pGUIWindow_CurrentMenu->OpenSpellBook();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2400 pAudioPlayer->PlaySound((SoundID)(rand() % 2 + SOUND_TurnPageU), 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2401 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2402 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2403 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2404 case UIMSG_OpenSpellbookPage:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2405 if (pTurnEngine->turn_stage == TE_MOVEMENT || !uActiveCharacter || uMessageParam == pPlayers[uActiveCharacter]->lastOpenedSpellbookPage)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2406 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2407 OnCloseSpellBookPage();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2408 pPlayers[uActiveCharacter]->lastOpenedSpellbookPage = uMessageParam;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2409 pGUIWindow_CurrentMenu->OpenSpellBook();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2410 pAudioPlayer->PlaySound((SoundID)(rand() % 2 + SOUND_TurnPageU), 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2411 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2412 case UIMSG_SelectSpell:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2413 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2414 if (pTurnEngine->turn_stage == TE_MOVEMENT)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2415 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2416 if (!uActiveCharacter)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2417 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2418
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2419 // uNumSeconds = (unsigned int)pPlayers[uActiveCharacter];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2420 Player* player = pPlayers[uActiveCharacter];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2421 if (player->spellbook.pChapters[player->lastOpenedSpellbookPage].bIsSpellAvailable[uMessageParam])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2422 //if ( *(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + &lastOpenedSpellbookPage) + uMessageParam + 402) )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2423 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2424 if (quick_spell_at_page - 1 == uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2425 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2426 pGUIWindow_CurrentMenu->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2427 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2428 viewparams->bRedrawGameUI = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2429 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2430 pIcons_LOD->RemoveTexturesPackFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2431 v103 = quick_spell_at_page + 11 * player->lastOpenedSpellbookPage;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2432 /*if ( dword_50C9E8 < 40 )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2433 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2434 dword_50C9EC[3 * dword_50C9E8] = UIMSG_CastSpellFromBook;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2435 dword_50C9EC[3 * dword_50C9E8 + 1] = v103;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2436 dword_50C9EC[3 * dword_50C9E8 + 2] = uActiveCharacter - 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2437 ++dword_50C9E8;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2438 }*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2439 pMessageQueue_50C9E8->AddGUIMessage(UIMSG_CastSpellFromBook, v103, uActiveCharacter - 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2440 // pMessageQueue_50CBD0->AddGUIMessage(UIMSG_CastSpellFromBook, v103, uActiveCharacter - 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2441 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2442 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2443 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2444 byte_506550 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2445 quick_spell_at_page = uMessageParam + 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2446 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2447 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2448 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2449 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2450
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2451 case UIMSG_CastSpellFromBook:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2452 if (pTurnEngine->turn_stage != TE_MOVEMENT)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2453 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2454 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2455
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2456 case UIMSG_SpellScrollUse:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2457 __debugbreak();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2458 if (pTurnEngine->turn_stage != TE_MOVEMENT)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2459 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 133, 1, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2460 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2461 case UIMSG_SpellBookWindow:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2462 if (pTurnEngine->turn_stage == TE_MOVEMENT)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2463 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2464 if (bUnderwater == true)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2465 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2466 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2467 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2468 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2469 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2470 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2471 DoThatMessageThing();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2472 if (uActiveCharacter && !pPlayers[uActiveCharacter]->uTimeToRecovery)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2473 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2474 if (current_screen_type == SCREEN_GAME)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2475 {
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2476 new OnButtonClick2(476, 450, 0, 0, (int)pBtn_CastSpell, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2477 current_screen_type = SCREEN_SPELL_BOOK;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2478 pEventTimer->Pause();
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2479 pGUIWindow_CurrentMenu = new GUIWindow_Spellbook(0, 0, window->GetWidth(), window->GetHeight(), 0, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2480 pAudioPlayer->PlaySound(SOUND_48, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2481 viewparams->field_48 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2482 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2483 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2484 if (current_screen_type != SCREEN_REST && current_screen_type != SCREEN_CHARACTERS
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2485 && (current_screen_type <= SCREEN_63 || current_screen_type > SCREEN_67))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2486 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2487 pGUIWindow_CurrentMenu->Release();
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2488 new OnButtonClick2(476, 450, 0, 0, (int)pBtn_CastSpell, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2489 current_screen_type = SCREEN_SPELL_BOOK;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2490 pEventTimer->Pause();
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2491 pGUIWindow_CurrentMenu = new GUIWindow_Spellbook(0, 0, window->GetWidth(), window->GetHeight(), 0, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2492 pAudioPlayer->PlaySound(SOUND_48, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2493 viewparams->field_48 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2494 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2495 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2496 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2497 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2498 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2499 case UIMSG_QuickReference:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2500 DoThatMessageThing();
2547
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2501 if (current_screen_type != SCREEN_GAME)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2502 pGUIWindow_CurrentMenu->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2503 ++pIcons_LOD->uTexturePacksCount;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2504 if (!pIcons_LOD->uNumPrevLoadedFiles)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2505 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2506 new OnButtonClick2(0x230u, 0x1C2u, 0, 0, (int)pBtn_QuickReference, 0);
2547
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2507 viewparams->bRedrawGameUI = true;
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2508
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2509 pGUIWindow_CurrentMenu = new GUIWindow_QuickReference();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2510 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2511 case UIMSG_GameMenuButton:
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2512 if (current_screen_type != SCREEN_GAME)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2513 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2514 pGUIWindow_CurrentMenu->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2515 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2516 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2517 viewparams->bRedrawGameUI = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2518 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2519
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2520 stru_506E40.Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2521 pRenderer->SaveScreenshot("gamma.pcx", 155, 117);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2522 stru_506E40.LoadPCXFile("gamma.pcx", 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2523
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2524 new OnButtonClick(0x25Au, 0x1C2u, 0, 0, (int)pBtn_GameSettings, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2525 //LABEL_453:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2526 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2527 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2528 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2529 //goto LABEL_770;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2530 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2531 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2532 ++pMessageQueue_50CBD0->uNumMessages;*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2533 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2534 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2535 case UIMSG_ClickAwardScrollBar:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2536 books_page_number = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2537 if (pMouse->GetCursorPos(&v211)->y > 178)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2538 books_page_number = -1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2539 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2540 case UIMSG_ClickAwardsUpBtn:
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2541 new OnButtonClick3(pBtn_Up->uX, pBtn_Up->uY, 0, 0, (int)pBtn_Up, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2542 BtnUp_flag = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2543 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2544 case UIMSG_ClickAwardsDownBtn:
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2545 new OnButtonClick3(pBtn_Down->uX, pBtn_Down->uY, 0, 0, (int)pBtn_Down, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2546 BtnDown_flag = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2547 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2548 case UIMSG_ChangeDetaliz:
2547
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2549 ((GUIWindow_CharacterRecord *)pGUIWindow_CurrentMenu)->ToggleRingsOverlay();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2550 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2551 case UIMSG_ClickPaperdoll:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2552 OnPaperdollLeftClick();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2553 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2554 case UIMSG_SkillUp:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2555 pPlayer4 = pPlayers[uActiveCharacter];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2556 v105 = (int)&pPlayer4->pActiveSkills[uMessageParam];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2557 LOWORD(v2) = *(short *)v105;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2558 uNumSeconds = v2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2559 if (pPlayer4->uSkillPoints < (v2 & 0x3F) + 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2560 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2561 v87 = pGlobalTXT_LocalizationStrings[488];// "You don't have enough skill points!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2562 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2563 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2564 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2565 if ((uNumSeconds & 0x3F) < 0x3C)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2566 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2567 *(short *)v105 = uNumSeconds + 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2568 pPlayer4->uSkillPoints -= pPlayer4->pActiveSkills[uMessageParam] & 0x3F;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2569 pPlayer4->PlaySound(SPEECH_14, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2570 pAudioPlayer->PlaySound((SoundID)SOUND_quest, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2571 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2572 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2573 v87 = pGlobalTXT_LocalizationStrings[487];// "You have already mastered this skill!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2574 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2575 ShowStatusBarString(v87, 2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2576 continue;
2547
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2577 case UIMSG_ClickStatsBtn:
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2578 ((GUIWindow_CharacterRecord *)pGUIWindow_CurrentMenu)->ShowStatsTab();
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2579 continue;
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2580 case UIMSG_ClickSkillsBtn:
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2581 ((GUIWindow_CharacterRecord *)pGUIWindow_CurrentMenu)->ShowSkillsTab();
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2582 continue;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2583 case UIMSG_ClickInventoryBtn:
2547
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2584 ((GUIWindow_CharacterRecord *)pGUIWindow_CurrentMenu)->ShowInventoryTab();
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2585 continue;
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2586 case UIMSG_ClickAwardsBtn:
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2587 ((GUIWindow_CharacterRecord *)pGUIWindow_CurrentMenu)->ShowAwardsTab();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2588 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2589 case UIMSG_ClickExitCharacterWindowBtn:
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2590 new OnCancel2(pCharacterScreen_ExitBtn->uX, pCharacterScreen_ExitBtn->uY, 0, 0, (int)pCharacterScreen_ExitBtn, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2591 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2592 case UIMSG_ClickBooksBtn:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2593 switch (uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2594 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2595 case 11://Page UP
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2596 BtnUp_flag = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2597 pButton = pBtn_Book_2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2598 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2599 case 10://Page DOWN
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2600 BtnDown_flag = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2601 pButton = pBtn_Book_1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2602 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2603 case 0://Zoom plus
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2604 pButton = pBtn_Book_1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2605 BtnDown_flag = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2606 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2607 case 1://Zoom minus
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2608 pButton = pBtn_Book_2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2609 BtnUp_flag = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2610 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2611 case 2://Potions
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2612 Book_PageBtn3_flag = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2613 if (dword_506364)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2614 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2615 pButton = pBtn_Book_3;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2616 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2617 case 3://fountains
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2618 Book_PageBtn4_flag = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2619 if (dword_506364)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2620 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2621 pButton = pBtn_Book_4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2622 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2623 case 4://obelisks
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2624 Book_PageBtn5_flag = 1;//Autonotes_Obelisks_page_flag
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2625 if (dword_506364)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2626 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2627 pButton = pBtn_Book_5;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2628 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2629 case 5://seer
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2630 Book_PageBtn6_flag = 1;//Autonotes_Seer_page_flag
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2631 if (dword_506364)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2632 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2633 pButton = pBtn_Book_6;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2634 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2635 case 6://misc
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2636 pButton = pBtn_Autonotes_Misc;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2637 Autonotes_Misc_page_flag = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2638 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2639 case 7://Instructors
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2640 pButton = pBtn_Autonotes_Instructors;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2641 Autonotes_Instructors_page_flag = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2642 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2643 default:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2644 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2645 }
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2646 new OnButtonClick(pButton->uX, pButton->uY, 0, 0, (int)pButton, (char *)1);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2647 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2648 case UIMSG_SelectCharacter:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2649 DoThatMessageThing();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2650 GameUI_OnPlayerPortraitLeftClick(uMessageParam);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2651 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2652 case UIMSG_ShowStatus_Funds:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2653 v174 = (char *)pParty->uNumGoldInBank;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2654 //v158 = pParty->uNumGold + pParty->uNumGoldInBank;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2655 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[489], pParty->uNumGold + pParty->uNumGoldInBank, v174);// "You have %d total gold, %d in the Bank"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2656 GameUI_SetFooterString(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2657 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2658 case UIMSG_ShowStatus_DateTime:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2659 currHour = pParty->uCurrentHour;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2660 uNumSeconds = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2661 if (pParty->uCurrentHour > 12)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2662 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2663 if (pParty->uCurrentHour >= 24)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2664 uNumSeconds = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2665 currHour = (currHour - 12);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2666 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2667 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2668 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2669 if (pParty->uCurrentHour < 12) // 12:00 is PM
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2670 uNumSeconds = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2671 if (pParty->uCurrentHour == 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2672 currHour = 12;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2673 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2674 sprintf(pTmpBuf.data(), "%d:%02d%s %s %d %s %d", currHour, pParty->uCurrentMinute, aAMPMNames[uNumSeconds], aDayNames[pParty->uDaysPlayed % 7],
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2675 7 * pParty->uCurrentMonthWeek + pParty->uDaysPlayed % 7 + 1, aMonthNames[pParty->uCurrentMonth], pParty->uCurrentYear);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2676 GameUI_SetFooterString(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2677 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2678 case UIMSG_ShowStatus_Food:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2679 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[501], pParty->uNumFoodRations); // "You have %lu food"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2680 GameUI_SetFooterString(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2681 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2682 case UIMSG_ShowStatus_Player:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2683 pPlayer5 = pPlayers[uMessageParam];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2684 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], pPlayer5->pName, pClassNames[pPlayer5->classType]);// "%s the %s"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2685 strcat(pTmpBuf.data(), ": ");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2686 v107 = pPlayer5->GetMajorConditionIdx();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2687 strcat(pTmpBuf.data(), aCharacterConditionNames[v107]);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2688 GameUI_SetFooterString(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2689 v108 = 8 * uMessageParam - 8;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2690 LOBYTE(v108) = v108 | 4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2691 pMouse->uPointingObjectID = PID(OBJECT_Player, v108);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2692 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2693 case UIMSG_ShowStatus_ManaHP:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2694 sprintf(pTmpBuf.data(), "%d / %d %s %d / %d %s", pPlayers[uMessageParam]->sHealth, pPlayers[uMessageParam]->GetMaxHealth(),
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2695 pGlobalTXT_LocalizationStrings[108], pPlayers[uMessageParam]->sMana, pPlayers[uMessageParam]->GetMaxMana(),
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2696 pGlobalTXT_LocalizationStrings[212]);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2697 GameUI_SetFooterString(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2698 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2699 case UIMSG_CHEST_ClickItem:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2700 if (current_screen_type == SCREEN_CHEST_INVENTORY)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2701 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2702 pPlayers[uActiveCharacter]->OnInventoryLeftClick();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2703 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2704 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2705 Chest::OnChestLeftClick();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2706 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2707 case UIMSG_InventoryLeftClick:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2708 pPlayers[uActiveCharacter]->OnInventoryLeftClick();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2709 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2710 case UIMSG_MouseLeftClickInGame:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2711 /*if ( !pRenderer->pRenderD3D )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2712 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2713 if ( pMessageQueue_50CBD0->uNumMessages )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2714 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2715 OnGameViewportClick();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2716 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2717 }*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2718 v115 = pMessageQueue_50CBD0->uNumMessages;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2719 if (!pMessageQueue_50CBD0->uNumMessages)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2720 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2721 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_MouseLeftClickInScreen, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2722 /*if ( (signed int)v115 < 40 )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2723 //goto LABEL_769;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2724 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2725 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2726 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2727 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2728 ++pMessageQueue_50CBD0->uNumMessages;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2729 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2730 }*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2731 }
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2732 else if (pMessageQueue_50CBD0->pMessages[0].field_8)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2733 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2734 pMessageQueue_50CBD0->uNumMessages = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2735 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_MouseLeftClickInScreen, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2736 /*v115 = v0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2737 pMessageQueue_50CBD0->uNumMessages = v0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2738 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2739 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2740 //goto LABEL_771;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2741 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2742 ++pMessageQueue_50CBD0->uNumMessages;*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2743 }
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2744 else
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2745 {
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2746 v115 = 0;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2747 pMessageQueue_50CBD0->uNumMessages = 0;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2748 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_MouseLeftClickInScreen, 0, 0);
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2749 /*if ( (signed int)v115 < 40 )
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2750 //goto LABEL_769;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2751 {
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2752 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2753 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2754 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2755 ++pMessageQueue_50CBD0->uNumMessages;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2756 continue;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2757 }*/
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2758 }
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2759 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2760 case UIMSG_MouseLeftClickInScreen://срабатывает при нажатии на правую кнопку мыши после UIMSG_MouseLeftClickInGame
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2761 DoThatMessageThing();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2762 OnGameViewportClick();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2763 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2764 case UIMSG_F:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2765 __debugbreak();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2766 //if ( pRenderer->pRenderD3D )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2767 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2768 LOWORD(v116) = pEngine->pVisInstance->get_picked_object_zbuf_val();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2769 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2770 /*else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2771 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2772 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v209);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2773 pPoint3 = pMouse->GetCursorPos(&v204);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2774 v116 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint3->y]];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2775 }*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2776 pButton2 = (GUIButton *)(unsigned __int16)v116;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2777 __debugbreak();//GUIWindow::Create(0, 0, 0, 0, WINDOW_F, (int)pButton2, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2778 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2779 case UIMSG_54:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2780 __debugbreak();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2781 pButton2 = (GUIButton *)uMessageParam;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2782 __debugbreak();//GUIWindow::Create(0, 0, 0, 0, WINDOW_22, (int)pButton2, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2783 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2784 case UIMSG_Game_Action:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2785 DoThatMessageThing();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2786 OnPressSpace();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2787 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2788 case UIMSG_ClickZoomOutBtn:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2789 if (current_screen_type)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2790 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2791 pParty->uFlags |= 2u;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2792 new OnButtonClick2(519, 136, 0, 0, (int)pBtn_ZoomOut, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2793 uNumSeconds = 131072;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2794 v118 = 2 * viewparams->uMinimapZoom;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2795 ++viewparams->field_28;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2796 viewparams->uMinimapZoom *= 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2797 if (uCurrentlyLoadedLevelType != LEVEL_Outdoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2798 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2799 if ((signed int)v118 > 4096)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2800 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2801 viewparams->uMinimapZoom = 4096;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2802 viewparams->field_28 = 12;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2803 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2804 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2805 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2806 v119 = 2048;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2807 if ((signed int)v118 <= 2048)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2808 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2809 _576E2C_current_minimap_zoom = v118;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2810 dword_576E28 = viewparams->field_28;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2811 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2812 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2813 viewparams->field_28 = 11;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2814 viewparams->uMinimapZoom = v119;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2815 _576E2C_current_minimap_zoom = v119;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2816 dword_576E28 = viewparams->field_28;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2817 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2818 case UIMSG_ClickZoomInBtn:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2819 if (current_screen_type)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2820 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2821 pParty->uFlags |= 2u;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2822 new OnButtonClick2(574, 136, 0, 0, (int)pBtn_ZoomIn, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2823 uNumSeconds = 32768;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2824 v118 = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2825 --viewparams->field_28;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2826 viewparams->uMinimapZoom = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2827 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2828 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2829 v119 = 512;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2830 if ((signed int)v118 < 512)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2831 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2832 viewparams->field_28 = 9;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2833 v118 = v119;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2834 viewparams->uMinimapZoom = v119;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2835 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2836 _576E2C_current_minimap_zoom = v118;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2837 dword_576E28 = viewparams->field_28;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2838 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2839 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2840 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2841 if ((signed int)v118 < 256)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2842 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2843 viewparams->uMinimapZoom = 256;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2844 viewparams->field_28 = 8;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2845 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2846 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2847 default:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2848 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2849 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2850 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2851 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2852 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50C9E8->uNumMessages;//dword_50C9E8;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2853 memcpy(pMessageQueue_50CBD0->pMessages, pMessageQueue_50C9E8->pMessages, sizeof(GUIMessage) * pMessageQueue_50C9E8->uNumMessages);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2854 //memcpy(pMessageQueue_50CBD0->pMessages, dword_50C9EC, 12 * dword_50C9E8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2855 //dword_50C9E8 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2856
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2857
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2858 pMessageQueue_50C9E8->uNumMessages = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2859 if (dword_50C9DC)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2860 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2861 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2862 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2863 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)dword_50C9DC;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2864 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = (int)ptr_50C9E0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2865 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2866 ++pMessageQueue_50CBD0->uNumMessages;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2867 }*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2868 pMessageQueue_50CBD0->AddGUIMessage((UIMessageType)dword_50C9DC, (int)ptr_50C9E0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2869 dword_50C9DC = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2870 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2871 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2872 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2873 if (_50C9D0_AfterEnchClickEventId > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2874 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2875 _50C9D8_AfterEnchClickEventTimeout -= pEventTimer->uTimeElapsed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2876 if (_50C9D8_AfterEnchClickEventTimeout <= 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2877 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2878 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2879 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2880 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)dword_50C9D0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2881 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = dword_50C9D4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2882 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2883 ++pMessageQueue_50CBD0->uNumMessages;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2884 }*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2885 pMessageQueue_50CBD0->AddGUIMessage((UIMessageType)_50C9D0_AfterEnchClickEventId, _50C9D4_AfterEnchClickEventSecondParam, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2886 _50C9D0_AfterEnchClickEventId = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2887 _50C9D4_AfterEnchClickEventSecondParam = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2888 _50C9D8_AfterEnchClickEventTimeout = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2889 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2890 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2891 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2892 CastSpellInfoHelpers::_427E01_cast_spell();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2893 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2894
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2895
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2896
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2897
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2898
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2899 //----- (00463149) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2900 void Game_Loop()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2901 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2902 const char *pLocationName; // [sp-4h] [bp-68h]@74
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2903 bool bLoading; // [sp+10h] [bp-54h]@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2904 signed int v16; // [sp+14h] [bp-50h]@8
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2905 MSG Msg; // [sp+28h] [bp-3Ch]@20
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2906 char Source[64]; // [sp+44h] [bp-20h]@76
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2907
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2908 bLoading = sCurrentMenuID == MENU_LoadingProcInMainMenu;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2909 SetCurrentMenuID((MENU_STATE)-1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2910 if (bLoading)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2911 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2912 pParty->Reset();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2913 uGameState = GAME_STATE_PLAYING;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2914 LoadGame(uLoadGameUI_SelectedSlot);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2915 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2916
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2917 for (uint i = 1; i < 5; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2918 for (uint j = 1; j < 6; ++j)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2919 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2920 sprintf(pTmpBuf.data(), "data\\lloyd%d%d.pcx", i, j);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2921 remove(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2922 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2923
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2924 extern bool use_music_folder;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2925 LoadPlayerPortraintsAndVoices();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2926 pIcons_LOD->_inlined_sub1();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2927 if (use_music_folder)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2928 alSourcef(mSourceID, AL_GAIN, pSoundVolumeLevels[uMusicVolimeMultiplier]);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2929 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2930 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2931
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2932 while (2)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2933 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2934 v16 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2935 pMessageQueue_50CBD0->Flush();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2936
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2937 pPartyActionQueue->uNumActions = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2938 if (pParty->bTurnBasedModeOn)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2939 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2940 pTurnEngine->End(false);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2941 pParty->bTurnBasedModeOn = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2942 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2943 DoPrepareWorld(bLoading, 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2944 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2945 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0080_SKIP_USER_INPUT_THIS_FRAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2946 // uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2947 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2948
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2949 //if ( pRenderer->pRenderD3D )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2950 pEngine->pVisInstance->_4C1A02();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2951
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2952 bool game_finished = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2953 do
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2954 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2955 while (PeekMessageA(&Msg, 0, 0, 0, PM_REMOVE))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2956 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2957 if (Msg.message == WM_QUIT)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2958 Engine_DeinitializeAndTerminate(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2959 TranslateMessage(&Msg);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2960 DispatchMessageA(&Msg);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2961 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2962 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_APP_INACTIVE)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2963 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2964 WaitMessage();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2965 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2966 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2967 pEngine->_44EEA7();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2968 GameUI_WritePointedObjectStatusString();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2969 Keyboard::ProcessInputActions();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2970 Game_EventLoop();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2971 if (pArcomageGame->bGameInProgress)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2972 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2973 ArcomageGame::Loop();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2974 pRenderer->Present();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2975 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2976 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2977
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2978 pMediaPlayer->HouseMovieLoop();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2979
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2980 pEventTimer->Update();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2981 pMiscTimer->Update();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2982
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2983 OnTimer(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2984 GameUI_StatusBar_UpdateTimedString(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2985 if (pMiscTimer->bPaused && !pEventTimer->bPaused)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2986 pMiscTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2987 if (pEventTimer->bTackGameTime && !pParty->bTurnBasedModeOn)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2988 pEventTimer->bTackGameTime = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2989 if (!pEventTimer->bPaused && uGameState == GAME_STATE_PLAYING)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2990 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2991 if (!pEventTimer->bTackGameTime)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2992 _494035_timed_effects__water_walking_damage__etc();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2993
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2994 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_0001)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2995 dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_0001;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2996 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2997 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2998 Actor::UpdateActorAI();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2999 UpdateUserInput_and_MapSpecificStuff();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3000 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3001 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3002 if (v16)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3003 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3004 v16 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3005 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3006 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3007 pAudioPlayer->UpdateSounds();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3008 if ((signed int)uGameState == GAME_STATE_PLAYING)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3009 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3010 pEngine->Draw();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3011 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3012 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3013 if (uGameState == GAME_FINISHED)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3014 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3015 game_finished = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3016 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3017 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3018 if (uGameState == GAME_STATE_CHANGE_LOCATION)// смена локации
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3019 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3020 pAudioPlayer->StopChannels(-1, -1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3021 PrepareWorld(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3022 uGameState = GAME_STATE_PLAYING;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3023 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3024 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3025 if ((signed int)uGameState <= GAME_STATE_5 || uGameState == GAME_STATE_GAME_QUITTING_TO_MAIN_MENU)//GAME_STATE_NEWGAME_OUT_GAMEMENU, GAME_STATE_LOADING_GAME
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3026 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3027 game_finished = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3028 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3029 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3030 if (uGameState == GAME_STATE_FINAL_WINDOW)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3031 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3032 pRenderer->BeginScene();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3033 GUI_UpdateWindows();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3034 pRenderer->EndScene();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3035 pRenderer->Present();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3036 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3037 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3038 if (uGameState != GAME_STATE_PARTY_DIED)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3039 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3040 pEngine->Draw();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3041 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3042 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3043 if (uGameState == GAME_STATE_PARTY_DIED)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3044 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3045 pAudioPlayer->StopChannels(-1, -1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3046 memset(&pParty->pHirelings[0], 0, 0x4Cu);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3047 memset(&pParty->pHirelings[1], 0, 0x4Cu);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3048 for (int i = 0; i < (signed int)pNPCStats->uNumNewNPCs; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3049 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3050 if (pNPCStats->pNewNPCData[i].field_24)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3051 pNPCStats->pNewNPCData[i].uFlags &= 0xFFFFFF7Fu;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3052 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3053 pMediaPlayer->bStopBeforeSchedule = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3054 pMediaPlayer->PlayFullscreenMovie(MOVIE_Death, true);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3055 if (pMovie_Track)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3056 pMediaPlayer->Unload();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3057 SaveGame(0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3058 ++pParty->uNumDeaths;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3059 for (uint i = 0; i < 4; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3060 pParty->pPlayers[i].SetVariable(VAR_Award, 85);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3061 pParty->days_played_without_rest = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3062 pParty->uTimePlayed += 0x276000ui64;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3063 LOWORD(pParty->uFlags) &= ~0x204;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3064 pParty->SetGold(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3065 pOtherOverlayList->Reset();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3066 memset(pParty->pPartyBuffs.data(), 0, 0x140u);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3067
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3068 if (pParty->bTurnBasedModeOn == 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3069 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3070 pTurnEngine->End(true);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3071 pParty->bTurnBasedModeOn = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3072 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3073 for (int i = 0; i < 4; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3074 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3075 memset(pParty->pPlayers[i].pConditions.data(), 0, 0xA0u);//(pConditions, 0, 160)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3076 memset(pParty->pPlayers[i].pPlayerBuffs.data(), 0, 0x180u);//(pPlayerBuffs[0], 0, 384)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3077 pParty->pPlayers[i].sHealth = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3078 uActiveCharacter = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3079 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3080 if (_449B57_test_bit(pParty->_quest_bits, PARTY_QUEST_FINISHED_EMERALD_ISLE))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3081 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3082 pParty->vPosition.x = -17331; // respawn in harmondale
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3083 pParty->vPosition.y = 12547;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3084 pParty->vPosition.z = 465;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3085 pParty->sRotationY = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3086 pLocationName = "out02.odm";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3087 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3088 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3089 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3090 pParty->vPosition.x = 12552; // respawn on emerald isle
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3091 pParty->vPosition.y = 1816;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3092 pParty->vPosition.z = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3093 pParty->sRotationY = 512;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3094 pLocationName = "out01.odm";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3095 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3096 strcpy(Source, pLocationName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3097 pParty->uFallStartY = pParty->vPosition.z;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3098 pParty->sRotationX = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3099 pParty->uFallSpeed = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3100 pParty->field_6E4 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3101 pParty->field_6E0 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3102 if (_stricmp(Source, pCurrentMapName))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3103 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3104 strcpy(pCurrentMapName, Source);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3105 _5B65A8_npcdata_uflags_or_other = pParty->vPosition.x;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3106 _5B65AC_npcdata_fame_or_other = pParty->vPosition.y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3107 _5B65B0_npcdata_rep_or_other = pParty->vPosition.z;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3108 _5B65B4_npcdata_loword_house_or_other = pParty->sRotationY;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3109 _5B65B8_npcdata_hiword_house_or_other = pParty->sRotationX;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3110 dword_5B65C0 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3111 PrepareWorld(1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3112 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3113 Actor::InitializeActors();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3114
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3115 int num_conscious_players = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3116 int conscious_players_ids[4] = { -1, -1, -1, -1 };
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3117 for (int i = 0; i < 4; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3118 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3119 if (pParty->pPlayers[i].CanAct())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3120 conscious_players_ids[num_conscious_players++] = i;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3121 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3122 if (num_conscious_players)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3123 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3124 int idx = conscious_players_ids[rand() % num_conscious_players];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3125 Assert(idx >= 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3126 pParty->pPlayers[idx].PlaySound(SPEECH_99, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3127 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3128
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3129 ShowStatusBarString(pGlobalTXT_LocalizationStrings[524], 2);// "Once again you've cheated death!.." "Вы снова обхитрили смерть! …"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3130 uGameState = GAME_STATE_PLAYING;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3131 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3132 } while (!game_finished);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3133
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3134 pEventTimer->Pause();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3135 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3136 if (uGameState == GAME_STATE_LOADING_GAME)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3137 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3138 sub_491E3A();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3139 LoadPlayerPortraintsAndVoices();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3140 uGameState = GAME_STATE_PLAYING;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3141 pIcons_LOD->dword_11B84 = pIcons_LOD->uNumLoadedFiles;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3142 bLoading = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3143 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3144 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3145 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3146 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3147 current_screen_type = SCREEN_VIDEO;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3148 sub_491E3A();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3149 }