annotate Engine/Engine.cpp @ 2552:ac16f4a3a91e

Load from MainMenu logic separated from MainMenu window
author a.parshin
date Wed, 13 May 2015 01:33:20 +0200
parents 4008b2f34be0
children 48708da03b7f
rev   line source
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3 #define _CRTDBG_MAP_ALLOC
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
4 #include <stdlib.h>
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
5 #include <crtdbg.h>
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
6
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
7 #define _CRT_SECURE_NO_WARNINGS
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
8
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
9 #include "Engine/Engine.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
10
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
11 #include "Arcomage\Arcomage.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
12
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
13 #include "Engine/Graphics/Vis.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
14 #include "Engine/Graphics/Weather.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
15 #include "Engine/Graphics/LightmapBuilder.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
16 #include "Engine/Graphics/DecalBuilder.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
17 #include "Engine/Graphics/ParticleEngine.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
18 #include "IO/Mouse.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
19 #include "IO/Keyboard.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
20 #include "Engine/Graphics/GammaControl.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
21 #include "stru6.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
22 #include "Engine/Graphics/stru9.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
23 #include "Engine/Graphics/stru10.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
24
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
25 #include "Engine/Party.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
26 #include "Engine/Graphics/Viewport.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
27 #include "Engine/Timer.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
28 #include "Engine/Graphics/Outdoor.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
29 #include "Engine/Graphics/Overlays.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
30 #include "Media/Audio/AudioPlayer.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
31 #include "Engine/LOD.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
32 #include "GUI/GUIWindow.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
33 #include "Engine/TurnEngine/TurnEngine.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
34 #include "Media/Video/Bink_Smacker.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
35 #include "Engine/Events.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
36 #include "Engine/OurMath.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
37 #include "Engine/texts.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
38 #include "GUI/GUIFont.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
39 #include "Engine/Graphics/Lights.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
40 #include "Engine/Spells/CastSpellInfo.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
41 #include "Engine/Tables/FrameTableInc.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
42 #include "Engine/Objects/Actor.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
43 #include "GUI/GUIProgressBar.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
44 #include "Engine/Objects/ObjectList.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
45 #include "Engine/Graphics/Level/Decoration.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
46 #include "Engine/Graphics/PaletteManager.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
47 #include "GUI/UI/UIHouses.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
48 #include "GUI/UI/UIShops.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
49 #include "GUI/UI/UIPartyCreation.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
50 #include "Engine/SaveLoad.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
51 #include "Engine/Objects/SpriteObject.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
52 #include "Engine/Graphics/Sprites.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
53 #include "Engine/Registry.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
54 #include "Engine/Objects/Chest.h"
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 #include "GUI/UI/UIGame.h"
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 #include "Engine/Graphics/DecorationList.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
59 #include "Engine/Tables/IconFrameTable.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
60 #include "Engine/Tables/PlayerFrameTable.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
61 #include "Engine/MapsLongTimer.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
62 #include "Engine/Tables/StorylineTextTable.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
63 #include "Engine/Tables/FactionTable.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
64 #include "Engine/stru123.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
65 #include "Engine/LuaVM.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
66 #include "Engine/Graphics/RenderD3D11.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
67 #include "Engine/MMT.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
68 #include "GUI/NewUI\MainMenu.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
69
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
70 #include "Game/Game.h"
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
71 #include "Game/MainMenu.h"
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
72
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
73 #include <direct.h>
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
74
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
77
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
78 Engine *pEngine = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
79
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
80
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
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
86 //----- (00466C40) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
87 const wchar_t *MENU_STATE_to_string(MENU_STATE m)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
88 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
89 switch (m)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
90 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
91 case -1: return L"-1";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
92 case MENU_MAIN: return L"MENU_MAIN";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
93 case MENU_NEWGAME: return L"MENU_NEWGAME";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
94 case MENU_CREDITS: return L"MENU_CREDITS";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
95 case MENU_SAVELOAD: return L"MENU_SAVELOAD";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
96 case MENU_EXIT_GAME: return L"MENU_EXIT_GAME";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
97 case MENU_5: return L"MENU_5";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
98 case MENU_CREATEPARTY: return L"MENU_CREATEPARTY";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
99 case MENU_NAMEPANELESC: return L"MENU_NAMEPANELESC";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
100 case MENU_CREDITSPROC: return L"MENU_CREDITSPROC";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
101 case MENU_LoadingProcInMainMenu: return L"MENU_LoadingProcInMainMenu";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
102 case MENU_DebugBLVLevel: return L"MENU_DebugBLVLevel";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
103 case MENU_CREDITSCLOSE: return L"MENU_CREDITSCLOSE";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
104 case MENU_MMT_MAIN_MENU: return L"MENU_MMT_MAIN_MENU";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
105 default: return L"unk";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
106 };
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
109
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
110 void SetCurrentMenuID(MENU_STATE uMenu)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
111 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
112 sCurrentMenuID = uMenu;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
113 Log::Warning(L"CurrentMenu = %s \n", MENU_STATE_to_string(uMenu));
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
114 }
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 //----- (00466CA0) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
117 MENU_STATE GetCurrentMenuID()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
118 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
119 return sCurrentMenuID;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
120 }
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
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 //----- (00464761) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
125 void Engine_DeinitializeAndTerminate(int exitCode)
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 SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
128 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
129 pEngine->Deinitialize();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
130 pRenderer->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
131 delete window;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
132 //if ( !DestroyWindow(hWnd) )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
133 // GetLastError();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
134 exit(exitCode);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
135 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
136
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
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
141
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
142
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
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 //----- (00435694) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
148 void Engine::ToggleFlags2(unsigned int uFlag)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
149 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
150 unsigned int v2; // eax@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
151
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
152 v2 = this->uFlags2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
153 if (v2 & uFlag)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
154 this->uFlags2 = v2 & ~uFlag;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
155 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
156 this->uFlags2 = uFlag | v2;
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 //----- (0044103C) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
160 void Engine::Draw()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
161 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
162 int v4; // edi@26
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
163
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
164 uFlags2 &= ~0x02;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
165 if (pParty->_497FC5_check_party_perception_against_level())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
166 uFlags2 |= 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
167
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
168 pIndoorCameraD3D->sRotationX = pParty->sRotationX;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
169 pIndoorCameraD3D->sRotationY = pParty->sRotationY;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
170 pIndoorCameraD3D->vPartyPos.x = pParty->vPosition.x - pParty->y_rotation_granularity * cosf(2 * pi_double * pParty->sRotationY / 2048.0);
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
171 pIndoorCameraD3D->vPartyPos.y = pParty->vPosition.y - pParty->y_rotation_granularity * sinf(2 * pi_double * pParty->sRotationY / 2048.0);
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
172 pIndoorCameraD3D->vPartyPos.z = pParty->vPosition.z + pParty->sEyelevel;//193, but real 353
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
173
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
174 //pIndoorCamera->Initialize2();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
175 pIndoorCameraD3D->CalculateRotations(pParty->sRotationX, pParty->sRotationY);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
176 pIndoorCameraD3D->CreateWorldMatrixAndSomeStuff();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
177 pIndoorCameraD3D->_4374E8_ProllyBuildFrustrum();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
178
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
179 if (pMovie_Track)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
180 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
181 /*if ( !pRenderer->pRenderD3D )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
182 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
183 pRenderer->BeginSceneD3D();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
184 pMouse->DrawCursorToTarget();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
185 pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
186 }*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
187 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
188 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
189 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
190 if (pParty->vPosition.x != pParty->vPrevPosition.x || pParty->sRotationY != pParty->sPrevRotationY || pParty->vPosition.y != pParty->vPrevPosition.y
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
191 || pParty->sRotationX != pParty->sPrevRotationX || pParty->vPosition.z != pParty->vPrevPosition.z || pParty->sEyelevel != pParty->sPrevEyelevel)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
192 pParty->uFlags |= 2u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
193 pParty->vPrevPosition.x = pParty->vPosition.x;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
194 pParty->vPrevPosition.y = pParty->vPosition.y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
195 pParty->vPrevPosition.z = pParty->vPosition.z;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
196 //v0 = &pRenderer;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
197 pParty->sPrevRotationY = pParty->sRotationY;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
198 pParty->sPrevRotationX = pParty->sRotationX;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
199
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
200 pParty->sPrevEyelevel = pParty->sEyelevel;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
201 pRenderer->BeginSceneD3D();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
202
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
203 //if ( !pRenderer->pRenderD3D )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
204 //pMouse->DrawCursorToTarget();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
205 if (!PauseGameDrawing() || viewparams->field_48 == 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
206 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
207 //if ( pRenderer->pRenderD3D )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
208 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
209 float v2 = (double)(((signed int)pMiscTimer->uTotalGameTimeElapsed >> 2) & 0x1F) * 0.032258064 * 6.0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
210 //v3 = v2 + 6.7553994e15;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
211 //pRenderer->field_1036A8_bitmapid = LODWORD(v3);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
212 pRenderer->hd_water_current_frame = floorf(v2 + 0.5f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
213 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
214
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
215 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
216 pIndoor->Draw();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
217 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
218 pOutdoor->Draw();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
219 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
220 Error("Invalid level type: %u", uCurrentlyLoadedLevelType);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
221
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
222 //if (pRenderer->pRenderD3D)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
223 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
224 pDecalBuilder->DrawBloodsplats();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
225 pEngine->pLightmapBuilder->DrawLightmapsType(2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
226 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
227 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
228 pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
229 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
230
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
231 //DEBUG: force redraw gui
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
232 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
233
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
234
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
235 pRenderer->BeginScene();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
236 //if (pRenderer->pRenderD3D)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
237 pMouse->DrawCursorToTarget();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
238 if (pOtherOverlayList->bRedraw)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
239 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
240 v4 = viewparams->bRedrawGameUI;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
241 GameUI_Footer();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
242 if (!viewparams->bRedrawGameUI)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
243 GameUI_DrawRightPanelItems();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
244 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
245 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
246 GameUI_DrawRightPanelFrames();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
247 GameUI_Footer_2();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
248 viewparams->bRedrawGameUI = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
249 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
250 if (!pMovie_Track)//!pVideoPlayer->pSmackerMovie)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
251 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
252 GameUI_DrawMinimap(488, 16, 625, 133, viewparams->uMinimapZoom, true);//redraw = pParty->uFlags & 2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
253 if (v4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
254 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
255 if (!PauseGameDrawing() /*&& pRenderer->pRenderD3D*/) // clear game viewport with transparent color
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
256 pRenderer->FillRectFast(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pViewport->uViewportBR_X - pViewport->uViewportTL_X,
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
257 pViewport->uViewportBR_Y - pViewport->uViewportTL_Y + 1,
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
258 0x7FF);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
259 viewparams->field_48 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
260 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
261 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
262
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
263 viewparams->bRedrawGameUI = pOtherOverlayList->bRedraw;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
264 pOtherOverlayList->bRedraw = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
265
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
266 GameUI_DrawPartySpells();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
267 if (v4 || pParty->pHirelings[0].evt_C || pParty->pHirelings[1].evt_C)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
268 GameUI_DrawHiredNPCs();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
269 GameUI_DrawPortraits(v4);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
270 GameUI_DrawLifeManaBars();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
271 GameUI_DrawCharacterSelectionFrame();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
272 if (_44100D_should_alter_right_panel())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
273 GameUI_DrawRightPanel();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
274 if (!pMovie_Track)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
275 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
276 pStru6Instance->DrawPlayerBuffAnims();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
277 pOtherOverlayList->DrawTurnBasedIcon(v4);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
278 GameUI_DrawTorchlightAndWizardEye();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
279 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
280
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
281
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
282 static bool render_framerate = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
283 static float framerate = 0.0f;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
284 static uint frames_this_second = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
285 static uint last_frame_time = GetTickCount();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
286 static uint framerate_time_elapsed = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
287
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
288 if (current_screen_type == SCREEN_GAME && uCurrentlyLoadedLevelType == LEVEL_Outdoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
289 pWeather->Draw();//Ritor1: my include
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
290
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
291 //while(GetTickCount() - last_frame_time < 33 );//FPS control
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
292 uint frame_dt = GetTickCount() - last_frame_time;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
293 last_frame_time = GetTickCount();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
294
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
295 framerate_time_elapsed += frame_dt;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
296 if (framerate_time_elapsed >= 1000)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
297 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
298 framerate = frames_this_second * (1000.0f / framerate_time_elapsed);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
299
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
300 framerate_time_elapsed = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
301 frames_this_second = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
302 render_framerate = true;
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
305 ++frames_this_second;
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 if (debug_information)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
308 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
309 if (render_framerate)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
310 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
311 sprintf(pTmpBuf.data(), "FPS: % .4f", framerate);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
312 pPrimaryWindow->DrawText(pFontArrus, 494, 0, Color16(0, 0, 0), pTmpBuf.data(), 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
313 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
314
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
315 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
316 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
317 int sector_id = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
318 sprintf(pTmpBuf.data(), "Party Sector ID: %u/%u\n", sector_id, pIndoor->uNumSectors);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
319 pPrimaryWindow->DrawText(pFontArrus, 16, 16, Color16(255, 255, 255), pTmpBuf.data(), 0, 0, Color16(255, 255, 255));
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
320 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
321 sprintf(pTmpBuf.data(), "Party Position: % d % d % d", pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
322 pPrimaryWindow->DrawText(pFontArrus, 16, 16 + 16, Color16(255, 255, 255), pTmpBuf.data(), 0, 0, Color16(255, 255, 255));
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
323
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
324 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
325 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
326 uint uFaceID;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
327 int sector_id = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
328 int floor_level = BLV_GetFloorLevel(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + 40, sector_id, &uFaceID);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
329 sprintf(pTmpBuf.data(), "BLV_GetFloorLevel: %d face_id %d\n", floor_level, uFaceID);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
330 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
331 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
332 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
333 int on_water, _a6;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
334 int floor_level = ODM_GetFloorLevel(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z, 0, &on_water, &_a6, false);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
335 sprintf(pTmpBuf.data(), "ODM_GetFloorLevel: %d on_water: %s a6 = %d\n", floor_level, on_water ? "true" : "false", _a6);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
336 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
337 pPrimaryWindow->DrawText(pFontArrus, 16, 16 + 16 + 16, Color16(255, 255, 255), pTmpBuf.data(), 0, 0, Color16(255, 255, 255));
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
338 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
339
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
340 GUI_UpdateWindows();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
341 pParty->UpdatePlayersAndHirelingsEmotions();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
342
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
343 _unused_5B5924_is_travel_ui_drawn = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
344 if (v4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
345 pMouse->bRedraw = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
346 pMouse->ReadCursorWithItem();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
347 pMouse->DrawCursor();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
348 pMouse->Activate();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
349 pRenderer->EndScene();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
350 pRenderer->Present();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
351 pParty->uFlags &= ~2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
352 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
353
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
354 //----- (0047A815) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
355 void Engine::DrawParticles()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
356 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
357 pParticleEngine->Draw();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
358 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
359
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 //----- (0044F192) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
362 void Engine::PrepareBloodsplats()
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 for (uint i = 0; i < uNumBloodsplats; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
365 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
366 pBloodsplatContainer->AddBloodsplat(pBloodsplats[i].x, pBloodsplats[i].y, pBloodsplats[i].z,
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
367 pBloodsplats[i].radius, pBloodsplats[i].r, pBloodsplats[i].g, pBloodsplats[i].b);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
368 }
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
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 //----- (0044F120) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
373 void Engine::PushStationaryLights(int a2)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
374 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
375 Game__StationaryLight* pLight;
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 for (int i = 0; i < uNumStationaryLights; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
378 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
379 pLight = &pStationaryLights[i];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
380 pStationaryLightsStack->AddLight(pLight->vPosition.x, pLight->vPosition.y, pLight->vPosition.z,
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
381 pLight->flt_18, pLight->vRGBColor.x, pLight->vRGBColor.y, pLight->vRGBColor.z, _4E94D0_light_type);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
382 }
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 // 4E94D0: using guessed type char _4E94D0_light_type;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
385
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
386 //----- (0044F0FD) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
387 void Engine::_44F0FD()
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 ToggleFlags(0x40u);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
390
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
391 if (!(uFlags & 0x40))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
392 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
393 uNumBloodsplats = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
394 field_E0C = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
395 }
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
398 //----- (0044F0D8) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
399 void Engine::ToggleFlags(uint uMask)
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 if (uFlags & uMask)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
402 uFlags &= ~uMask;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
403 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
404 uFlags |= uMask;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
405 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
406
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 //----- (0044F07B) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
409 bool Engine::_44F07B()
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 if (!pKeyboardInstance->IsKeyBeingHeld(VK_SHIFT) && !pKeyboardInstance->IsKeyBeingHeld(VK_LSHIFT) &&
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
412 !pKeyboardInstance->IsKeyBeingHeld(VK_LSHIFT) || (pKeyboardInstance->WasKeyPressed(VK_F11) == 0 &&
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
413 pKeyboardInstance->WasKeyPressed(VK_F11)))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
414 return true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
415 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
416 }
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 //----- (0044EEA7) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
419 bool Engine::_44EEA7()
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 //Game *v1; // esi@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
422 //double v2; // st7@2
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
423 float depth; // ST00_4@9
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
424 //bool result; // eax@9
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
425 //unsigned int v5; // eax@14
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
426 __int64 v6; // kr00_8@21
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
427 //unsigned int y; // [sp+4h] [bp-24h]@2
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
428 //unsigned int x; // [sp+8h] [bp-20h]@2
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
429 Vis_SelectionFilter *v10; // [sp+10h] [bp-18h]@2
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
430 Vis_SelectionFilter *v11; // [sp+14h] [bp-14h]@2
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
431 POINT cursor; // [sp+20h] [bp-8h]@1
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 //v1 = this;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
434 ++qword_5C6DF0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
435 pParticleEngine->UpdateParticles();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
436 pMouseInstance->GetCursorPos(&cursor);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
437
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
438 //x = cursor.y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
439 //y = cursor.x;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
440 if (sub_4637E0_is_there_popup_onscreen())
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 v11 = &vis_face_filter;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
443 v10 = &vis_sprite_filter_2;
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
444 depth = pIndoorCameraD3D->GetPickDepth();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
445 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
446 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
447 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
448 if (uFlags2 & GAME_FLAGS_2_TARGETING_MODE)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
449 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
450 v11 = &vis_face_filter;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
451 v10 = &vis_sprite_filter_1;
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 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
454 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
455 v11 = &vis_face_filter;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
456 v10 = &vis_sprite_filter_4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
457 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
458 depth = 5120.0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
459 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
460 //depth = v2;
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 PickMouse(depth, cursor.x, cursor.y, false, v10, v11);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
463 pLightmapBuilder->std__vector_000004_size = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
464 pLightmapBuilder->std__vector_183808_size = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
465 pDecalBuilder->std__vector_pDecals_size = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
466 pDecalBuilder->field_308008 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
467 if (!_44F07B())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
468 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
469
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
470 if (uFlags & GAME_FLAGS_1_DRAW_BLV_DEBUGS)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
471 pStru10Instance->bDoNotDrawPortalFrustum = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
472 if ( /*pRenderer->pRenderD3D &&*/ uCurrentlyLoadedLevelType == LEVEL_Outdoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
473 pRenderer->uFogColor = GetLevelFogColor() & 0xFFFFFF;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
474 if (uFlags & 0x0400)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
475 uFlags2 |= 0x01;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
476 /*if ( !pRenderer->pRenderD3D && uCurrentlyLoadedLevelType == LEVEL_Outdoor && pMobileLightsStack->uNumLightsActive )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
477 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
478 uFlags2 |= 0x01;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
479 field_E10 = qword_5C6DF0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
480 }*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
481 v6 = qword_5C6DF0 - field_E10;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
482 if (qword_5C6DF0 - field_E10 == 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
483 uFlags2 |= v6;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
484 if (uNumStationaryLights_in_pStationaryLightsStack != pStationaryLightsStack->uNumLightsActive)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
485 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
486 uFlags2 |= 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
487 uNumStationaryLights_in_pStationaryLightsStack = pStationaryLightsStack->uNumLightsActive;
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 return true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
490 }
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
493 //----- (0044EDE4) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
494 bool Engine::AlterGamma_BLV(BLVFace *pFace, signed int *pColor)
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 if (uFlags2 & GAME_FLAGS_2_SATURATE_LIGHTMAPS &&
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
497 pFace->uAttributes & FACE_CAN_SATURATE_COLOR)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
498 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
499 *pColor = ReplaceHSV(*pColor, 1.0, fSaturation, -1.0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
500 return true;
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 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
503 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
504 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
505
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
506 //----- (0044EE30) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
507 bool Engine::AlterGamma_ODM(ODMFace *pFace, signed int *pColor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
508 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
509 if (uFlags2 & GAME_FLAGS_2_SATURATE_LIGHTMAPS &&
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
510 pFace->uAttributes & FACE_CAN_SATURATE_COLOR)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
511 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
512 *pColor = ReplaceHSV(*pColor, 1.0, fSaturation, -1.0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
513 return true;
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 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
517 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
518
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
519
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
520 //----- (004645FA) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
521 void Engine::Deinitialize()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
522 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
523 WriteWindowsRegistryInt("startinwindow", 1);//pRenderer->bWindowMode);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
524 //if (pRenderer->bWindowMode)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
525 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
526 WriteWindowsRegistryInt("window X", window->GetX());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
527 WriteWindowsRegistryInt("window Y", window->GetY());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
528 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
529 WriteWindowsRegistryInt("valAlwaysRun", bAlwaysRun);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
530 pItemsTable->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
531 pNPCStats->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
532
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
533 if (pMouse)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
534 pMouse->Deactivate();
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 delete pRenderer;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
537 pAudioPlayer->Release();//error
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
538 pNew_LOD->FreeSubIndexAndIO();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
539 pGames_LOD->FreeSubIndexAndIO();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
540 ClipCursor(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
541 Engine::Destroy();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
542 delete pEventTimer;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
543 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
544
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
545 //----- (0044EE7C) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
546 bool Engine::draw_debug_outlines()
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 if (uFlags & 0x04)
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 pLightmapBuilder->DrawDebugOutlines(-1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
551 pDecalBuilder->DrawDecalDebugOutlines();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
552 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
553 return true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
554 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
555
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
556 //----- (0044EC23) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
557 int Engine::_44EC23(struct Polygon *a2, int *a3, signed int a4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
558 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
559 double v4; // st7@4
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
560 //double v5; // ST00_8@4
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
561 signed int v6; // eax@5
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
562 //double v7; // ST00_8@6
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
563 signed int result; // eax@8
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
564 //double v9; // ST00_8@9
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
565 //double v10; // ST00_8@11
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
566 float a2a; // [sp+14h] [bp+8h]@4
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
567 float a3a; // [sp+18h] [bp+Ch]@4
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
568 float a3b; // [sp+18h] [bp+Ch]@6
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
569 float a4a; // [sp+1Ch] [bp+10h]@9
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
570 float a4b; // [sp+1Ch] [bp+10h]@11
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
571
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
572 if (this->uFlags2 & 2 && a2->field_59 == 5 && a2->pODMFace->uAttributes & 2)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
573 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
574 v4 = (double)a4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
575 a2a = v4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
576 *a3 |= 2u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
577 a3a = (1.0 - this->fSaturation) * v4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
578 //v5 = a3a + 6.7553994e15;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
579 //if ( SLODWORD(v5) >= 0 )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
580 if (floorf(a3a + 0.5f) >= 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
581 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
582 a3b = (1.0 - this->fSaturation) * a2a;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
583 //v7 = a3b + 6.7553994e15;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
584 //v6 = LODWORD(v7);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
585 v6 = floorf(a3b + 0.5f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
586 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
587 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
588 v6 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
589 if (a4 >= v6)
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 a4a = (1.0 - fSaturation) * a2a;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
592 //v9 = a4a + 6.7553994e15;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
593 //if ( SLODWORD(v9) >= 0 )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
594 if (floorf(a4a + 0.5f) >= 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
595 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
596 a4b = (1.0 - fSaturation) * a2a;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
597 //v10 = a4b + 6.7553994e15;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
598 //result = LODWORD(v10);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
599 result = floorf(a4b + 0.5f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
600 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
601 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
602 result = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
603 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
604 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
605 result = a4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
606 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
607 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
608 result = -1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
609 return result;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
610 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
611
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
612
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
613
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
614 //----- (00465C8B) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
615 Engine *Engine::Create()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
616 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
617 return new Engine;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
618 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
619
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
620 //----- (00465CF3) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
621 void Engine::Destroy()
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 delete pEngine;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
624 pEngine = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
625 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
626
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
627 //----- (0044ED0A) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
628 signed int Engine::_44ED0A(BLVFace *a2, int *a3, signed int a4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
629 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
630 double v4; // st7@3
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
631 //double v5; // ST00_8@3
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
632 signed int v6; // eax@4
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
633 //double v7; // ST00_8@5
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
634 signed int result; // eax@7
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
635 //double v9; // ST00_8@8
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
636 //double v10; // ST00_8@10
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
637 float v11; // [sp+14h] [bp+8h]@3
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
638 float v12; // [sp+18h] [bp+Ch]@3
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
639 float v13; // [sp+18h] [bp+Ch]@5
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
640 float v14; // [sp+1Ch] [bp+10h]@8
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
641 float v15; // [sp+1Ch] [bp+10h]@10
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 if (this->uFlags2 & 2 && a2->uAttributes & 2)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
644 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
645 v4 = (double)a4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
646 v11 = v4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
647 *a3 |= 2u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
648 v12 = (1.0 - this->fSaturation) * v4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
649 //v5 = v12 + 6.7553994e15;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
650 if (floorf(v12 + 0.5f)/* SLODWORD(v5)*/ >= 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
651 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
652 v13 = (1.0 - this->fSaturation) * v11;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
653 //v7 = v13 + 6.7553994e15;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
654 //v6 = LODWORD(v7);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
655 v6 = floorf(v13 + 0.5f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
656 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
657 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
658 v6 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
659 if (a4 >= v6)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
660 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
661 v14 = (1.0 - fSaturation) * v11;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
662 //v9 = v14 + 6.7553994e15;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
663 if (floorf(v14 + 0.5f)/* SLODWORD(v9)*/ >= 0)
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 v15 = (1.0 - fSaturation) * v11;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
666 //v10 = v15 + 6.7553994e15;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
667 //result = LODWORD(v10);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
668 result = floorf(v15 + 0.5f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
669 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
670 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
671 result = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
672 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
673 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
674 result = a4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
675 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
676 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
677 result = -1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
678 return result;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
679 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
680
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 //----- (0044E4B7) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
683 Engine::Engine()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
684 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
685 uNumStationaryLights = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
686 uNumBloodsplats = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
687 field_E0C = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
688 field_E10 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
689 uNumStationaryLights_in_pStationaryLightsStack = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
690 uFlags = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
691 uFlags2 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
692
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
693 //pThreadWardInstance = new ThreadWard;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
694 pThreadWardInstance = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
695 pParticleEngine = new ParticleEngine;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
696 pMouse = pMouseInstance = new Mouse;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
697 pLightmapBuilder = new LightmapBuilder;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
698 pVisInstance = new Vis;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
699 pStru6Instance = new stru6;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
700 pIndoorCameraD3D = new IndoorCameraD3D;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
701 pStru9Instance = new stru9;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
702 pStru10Instance = new stru10;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
703 //pStru11Instance = new stru11;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
704 pStru11Instance = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
705 //pStru12Instance = new stru12(pStru11Instance);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
706 pStru12Instance = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
707 //pCShow = new CShow;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
708 pCShow = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
709 pKeyboardInstance = new Keyboard;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
710 //pGammaController = new GammaController;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
711
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
712 uFlags |= 0x0800;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
713 uFlags2 |= 0x24;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
714
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
715 _44F0FD();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
716 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
717
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
718 //----- (0044E7F3) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
719 Engine::~Engine()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
720 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
721 //delete pGammaController;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
722 delete pKeyboardInstance;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
723 /*delete pCShow;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
724 delete pStru12Instance;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
725 delete pStru11Instance;*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
726 delete pStru10Instance;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
727 delete pStru9Instance;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
728 delete pIndoorCameraD3D;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
729 delete pStru6Instance;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
730 delete pVisInstance;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
731 delete pLightmapBuilder;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
732 delete pMouseInstance;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
733 delete pParticleEngine;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
734 //delete pThreadWardInstance;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
735 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
736
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
737 //----- (0044EA5E) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
738 bool Engine::PickMouse(float fPickDepth, unsigned int uMouseX, unsigned int uMouseY, bool bOutline, Vis_SelectionFilter *sprite_filter, Vis_SelectionFilter *face_filter)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
739 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
740 /*if (current_screen_type != SCREEN_GAME|| !pRenderer->pRenderD3D)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
741 return false;*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
742
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
743 if (!pVisInstance)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
744 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
745 MessageBoxW(nullptr, L"The 'Vis' object pointer has not been instatiated, but CGame::Pick() is trying to call through it.", nullptr, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
746 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
747 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
748
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
749 if (uMouseX >= (signed int)pViewport->uScreen_TL_X &&
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
750 uMouseX <= (signed int)pViewport->uScreen_BR_X &&
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
751 uMouseY >= (signed int)pViewport->uScreen_TL_Y &&
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
752 uMouseY <= (signed int)pViewport->uScreen_BR_Y)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
753 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
754 pVisInstance->PickMouse(fPickDepth, uMouseX, uMouseY, sprite_filter, face_filter);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
755
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
756 if (bOutline)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
757 OutlineSelection();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
758 }
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 return true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
761 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
762 // 4E28F8: using guessed type int current_screen_type;
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 //----- (0044EB12) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
765 bool Engine::PickKeyboard(bool bOutline, Vis_SelectionFilter *sprite_filter, Vis_SelectionFilter *face_filter)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
766 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
767 if (current_screen_type == SCREEN_GAME && pVisInstance /*&& pRenderer->pRenderD3D*/)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
768 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
769 bool r = pVisInstance->PickKeyboard(&pVisInstance->default_list, sprite_filter, face_filter);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
770
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
771 if (bOutline)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
772 OutlineSelection();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
773 return r;
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 return false;
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 /*
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
778 Result::Code Game::PickKeyboard(bool bOutline, struct unnamed_F93E6C *a3, struct unnamed_F93E6C *a4)
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 (dword_4E28F8_PartyCantJumpIfTrue)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
781 return Result::Generic;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
782
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
783 pVis->PickKeyboard(a3, a4);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
784 if (bOutline)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
785 Game_outline_selection((int)this);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
786 return Result::Success;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
787 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
788 */
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
789 // 4E28F8: using guessed type int current_screen_type;
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 //----- (0044EB5A) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
792 void Engine::OutlineSelection()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
793 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
794 if (!pVisInstance)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
795 return;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
796
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
797 if (!pVisInstance->default_list.uNumPointers)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
798 return;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
799
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
800 Vis_ObjectInfo* object_info = pVisInstance->default_list.object_pointers[0];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
801 if (object_info)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
802 switch (object_info->object_type)
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 case VisObjectType_Sprite:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
805 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
806 Log::Warning(L"Sprite outline currently unsupported");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
807 return;
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
810 case VisObjectType_Face:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
811 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
812 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
813 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
814 ODMFace* face = (ODMFace *)object_info->object;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
815 if (face->uAttributes & FACE_OUTLINED)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
816 face->uAttributes &= ~FACE_OUTLINED;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
817 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
818 face->uAttributes |= FACE_OUTLINED;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
819 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
820 else if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
821 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
822 BLVFace* face = (BLVFace *)object_info->object;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
823 if (face->uAttributes & FACE_OUTLINED)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
824 face->uAttributes &= ~FACE_OUTLINED;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
825 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
826 face->uAttributes |= FACE_OUTLINED;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
827 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
828 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
829 Error("Invalid level type", uCurrentlyLoadedLevelType);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
830 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
831 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
832
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
833 default:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
834 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
835 MessageBoxW(nullptr, L"Undefined CObjectInfo type requested in CGame::outline_selection()", nullptr, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
836 ExitProcess(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
837 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
838 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
839 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
840
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
841
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
845 //----- (0042FBDD) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
846 void sub_42FBDD()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
847 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
848 pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
849 pRenderer->DrawTextureIndexedAlpha(pBtn_YES->uX, pBtn_YES->uY, pBtn_YES->pTextures[0]);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
850 pRenderer->Present();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
851 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
852
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
853 //----- (0042FC15) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
854 void CloseWindowBackground()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
855 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
856 pAudioPlayer->PlaySound(SOUND_StartMainChoice02, -2, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
857 pRenderer->DrawTextureIndexedAlpha(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pBtn_ExitCancel->pTextures[0]);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
858 pRenderer->Present();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
859 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
860
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 //----- (0046BDC0) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
863 void UpdateUserInput_and_MapSpecificStuff()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
864 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
865 if (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
866 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
867 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
868 return;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
869 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
870
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
871 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
872 BLV_UpdateUserInputAndOther();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
873 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
874 ODM_UpdateUserInputAndOther();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
875
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
876 area_of_effect__damage_evaluate();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
877 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
878
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
879 //----- (004646F0) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
880 void PrepareWorld(unsigned int _0_box_loading_1_fullscreen)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
881 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
882 //if ( pRenderer->pRenderD3D )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
883 pEngine->pVisInstance->_4C1A02();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
884 pEventTimer->Pause();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
885 pMiscTimer->Pause();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
886 pParty->uFlags = 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
887 CastSpellInfoHelpers::_427D48();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
888 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
889 DoPrepareWorld(0, (_0_box_loading_1_fullscreen == 0) + 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
890 pMiscTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
891 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
892 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
893
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
894 //----- (00464866) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
895 void DoPrepareWorld(unsigned int bLoading, int _1_fullscreen_loading_2_box)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
896 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
897 char *v3; // eax@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
898 unsigned int v5; // eax@3
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
899 char Str1[20]; // [sp+Ch] [bp-18h]@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
900 unsigned int v9; // [sp+20h] [bp-4h]@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
901
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
902 v9 = bLoading;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
903 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
904 pDecalBuilder->Reset(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
905 pGameLoadingUI_ProgressBar->Initialize(_1_fullscreen_loading_2_box == 1 ? GUIProgressBar::TYPE_Fullscreen :
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
906 GUIProgressBar::TYPE_Box);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
907 strcpy(Str1, pCurrentMapName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
908 v3 = strtok(Str1, ".");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
909 strcpy(Str1, v3);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
910 Level_LoadEvtAndStr(Str1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
911 LoadLevel_InitializeLevelEvt();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
912 strcpy(Str1, pCurrentMapName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
913 _strrev(Str1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
914 strtok(Str1, ".");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
915 _strrev(Str1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
916
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
917 for (uint i = 0; i < 1000; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
918 pSpriteObjects[i].uObjectDescID = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
919
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
920 v5 = pMapStats->GetMapInfo(pCurrentMapName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
921 bUnderwater = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
922 uLevelMapStatsID = v5;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
923 pEngine->uFlags2 &= 0xFFFFFFF7u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
924 if (!_stricmp(pCurrentMapName, "out15.odm"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
925 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
926 bUnderwater = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
927 pEngine->uFlags2 |= GAME_FLAGS_2_ALTER_GRAVITY;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
928 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
929 pParty->floor_face_pid = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
930 if (_stricmp(Str1, "blv"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
931 PrepareToLoadODM(v9, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
932 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
933 PrepareToLoadBLV(v9);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
934 pAudioPlayer->SetMapEAX();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
935 _461103_load_level_sub();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
936 if (!_stricmp(pCurrentMapName, "d11.blv") || !_stricmp(pCurrentMapName, "d10.blv"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
937 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
938 //spawning grounds & walls of mist - no loot & exp from monsters
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
939
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
940 for (uint i = 0; i < uNumActors; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
941 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
942 pActors[i].pMonsterInfo.uTreasureType = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
943 pActors[i].pMonsterInfo.uTreasureDiceRolls = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
944 pActors[i].pMonsterInfo.uExp = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
945 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
946 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
947 bDialogueUI_InitializeActor_NPC_ID = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
948 OnMapLoad();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
949 pGameLoadingUI_ProgressBar->Progress();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
950 memset(&pRenderer->pBillboardRenderListD3D, 0, sizeof(pRenderer->pBillboardRenderListD3D));
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
951 pGameLoadingUI_ProgressBar->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
952 _flushall();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
953 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
954
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
955 void IntegrityTest()
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 static_assert(sizeof(MovieHeader) == 44, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
958 static_assert(sizeof(SoundDesc_mm6) == 112, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
959 static_assert(sizeof(SoundDesc) == 120, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
960 static_assert(sizeof(OverlayDesc) == 8, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
961 static_assert(sizeof(ChestDesc) == 36, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
962 static_assert(sizeof(ObjectDesc_mm6) == 52, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
963 static_assert(sizeof(ObjectDesc) == 56, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
964 static_assert(sizeof(DecorationDesc) == 84, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
965 static_assert(sizeof(IconFrame) == 32, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
966 static_assert(sizeof(PlayerFrame) == 10, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
967 static_assert(sizeof(TextureFrame) == 20, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
968 static_assert(sizeof(SpriteFrame) == 60, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
969 static_assert(sizeof(RenderVertexSoft) == 0x30, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
970 static_assert(sizeof(RenderBillboard) == 0x34, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
971 static_assert(sizeof(Texture) == 0x48, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
972 //static_assert(sizeof(RGBTexture) == 0x28, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
973 //static_assert(sizeof(LODFile_IconsBitmaps) == 0x11BB8 + 4, "Wrong type size"); // + virtual dtor ptr
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
974 static_assert(sizeof(AudioPlayer) == 0xC84, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
975 static_assert(sizeof(SoundDesc) == 0x78, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
976 static_assert(sizeof(stru339_spell_sound) == 0xAFD8, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
977 //static_assert(sizeof(VideoPlayer) == 0x108 + 4, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
978 static_assert(sizeof(MovieHeader) == 0x2C, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
979 static_assert(sizeof(DecorationDesc) == 0x54, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
980 static_assert(sizeof(ObjectDesc) == 0x38, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
981 static_assert(sizeof(OverlayDesc) == 0x8, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
982 static_assert(sizeof(ChestDesc) == 0x24, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
983 static_assert(sizeof(TileDesc) == 0x1A, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
984 static_assert(sizeof(MonsterDesc_mm6) == 148, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
985 static_assert(sizeof(MonsterDesc) == 152, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
986 static_assert(sizeof(Timer) == 0x28, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
987 static_assert(sizeof(OtherOverlay) == 0x14, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
988 static_assert(sizeof(ItemGen) == 0x24, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
989 static_assert(sizeof(SpriteObject) == 0x70, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
990 static_assert(sizeof(ItemDesc) == 0x30, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
991 static_assert(sizeof(ItemsTable) == 0x117A0, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
992 static_assert(sizeof(Chest) == 0x14CC, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
993 static_assert(sizeof(MapInfo) == 0x44, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
994 static_assert(sizeof(SpellInfo) == 0x24, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
995 static_assert(sizeof(SpellData) == 0x14, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
996 static_assert(sizeof(SpellBuff) == 0x10, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
997 static_assert(sizeof(AIDirection) == 0x1C, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
998 static_assert(sizeof(ActorJob) == 0xC, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
999 static_assert(sizeof(Actor) == 0x344, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1000 static_assert(sizeof(LevelDecoration) == 0x20, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1001 static_assert(sizeof(KeyboardActionMapping) == 0x20C, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1002 static_assert(sizeof(UIAnimation) == 0xD, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1003 static_assert(sizeof(SpawnPointMM7) == 0x18, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1004 static_assert(sizeof(ODMFace) == 0x134, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1005 static_assert(sizeof(BSPNode) == 0x8, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1006 static_assert(sizeof(BSPModel) == 0xBC, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1007 static_assert(sizeof(OutdoorLocation) == 0x1C28C, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1008 static_assert(sizeof(BLVFace) == 0x60, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1009 static_assert(sizeof(BLVFaceExtra) == 0x24, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1010 static_assert(sizeof(BLVSector) == 0x74, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1011 static_assert(sizeof(BLVLightMM7) == 0x10, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1012 static_assert(sizeof(BLVDoor) == 0x50, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1013 static_assert(sizeof(IndoorLocation) == 0x690, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1014 //static_assert(sizeof(ODMRenderParams) == 0x74, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1015 static_assert(sizeof(Mouse) == 0x114, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1016 static_assert(sizeof(Particle_sw) == 0x68, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1017 static_assert(sizeof(Particle) == 0x68, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1018 static_assert(sizeof(ParticleEngine) == 0xE430, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1019 static_assert(sizeof(Lightmap) == 0xC1C, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1020 static_assert(sizeof(LightmapBuilder) == 0x3CBC38, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1021 static_assert(sizeof(Vis_SelectionList) == 0x2008, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1022 static_assert(sizeof(Vis) == 0x20D0, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1023 static_assert(sizeof(PlayerBuffAnim) == 0x10, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1024 static_assert(sizeof(ProjectileAnim) == 0x1C, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1025 static_assert(sizeof(stru6) == 0x5F8, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1026 static_assert(sizeof(IndoorCameraD3D_Vec3) == 0x10, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1027 static_assert(sizeof(IndoorCameraD3D_Vec4) == 0x18, "Wrong type size"); //should be 14 (10 vec3 + 4 vdtor) but 18 coz of his +4 from own vdtor, but it is odd since vdtor already present from vec3
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1028 //static_assert(sizeof(IndoorCameraD3D) == 0x1A1384, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1029 static_assert(sizeof(StationaryLight) == 0xC, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1030 static_assert(sizeof(LightsStack_StationaryLight_) == 0x12C8, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1031 static_assert(sizeof(MobileLight) == 0x12, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1032 static_assert(sizeof(LightsStack_MobileLight_) == 0x1C28, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1033 static_assert(sizeof(Engine) == 0xE78, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1034 static_assert(sizeof(stru141_actor_collision_object) == 0xA8, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1035 static_assert(sizeof(ActionQueue) == 0x7C, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1036 static_assert(sizeof(NPCData) == 0x4C, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1037 static_assert(sizeof(NPCStats) == 0x17FFC, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1038 static_assert(sizeof(BspRenderer) == 0x53740, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1039 static_assert(sizeof(PaletteManager) == 0x267AF0, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1040 static_assert(sizeof(ViewingParams) == 0x26C, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1041 //static_assert(sizeof(IndoorCamera) == 0x50, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1042 static_assert(sizeof(Bloodsplat) == 0x28, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1043 static_assert(sizeof(BloodsplatContainer) == 0xA0C, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1044 static_assert(sizeof(TrailParticle) == 0x18, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1045 static_assert(sizeof(EventIndex) == 0xC, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1046 static_assert(sizeof(_2devent) == 0x34, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1047 static_assert(sizeof(MapsLongTimer) == 0x20, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1048 static_assert(sizeof(SavegameHeader) == 0x64, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1049 static_assert(sizeof(SavegameList) == 0x3138, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1050 static_assert(sizeof(StorylineText) == 0x160, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1051 static_assert(sizeof(FactionTable) == 0x1EF1, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1052 static_assert(sizeof(Decal) == 0xC20, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1053 static_assert(sizeof(DecalBuilder) == 0x30C038, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1054 static_assert(sizeof(MonsterInfo) == 0x58, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1055 static_assert(sizeof(MonsterStats) == 0x5BA0, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1056 static_assert(sizeof(RenderD3D) == 0x148, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1057 // static_assert(sizeof(Render) == 0x129844, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1058 static_assert(sizeof(Player) == 0x1B3C, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1059 static_assert(sizeof(PartyTimeStruct) == 0x678, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1060 static_assert(sizeof(Party) == 0x16238, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1061 static_assert(sizeof(GUIButton) == 0xBC, "Wrong type size");
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
1062 //static_assert(sizeof(GUIWindow) == 0x54, "Wrong type size");
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1063 //static_assert(sizeof(GUIProgressBar) == 0x1B8, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1064 static_assert(sizeof(GUIFont) == 0x1020, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1065 // static_assert(sizeof(stru262_TurnBased) == 0x40, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1066 //static_assert(sizeof(ArcomageGame) == 0xFB, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1067 static_assert(sizeof(CastSpellInfo) == 0x14, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1068 static_assert(sizeof(ArcomageCard) == 0x6C, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1069 static_assert(sizeof(stru320) == 0x3FC, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1070 static_assert(sizeof(TravelInfo) == 0x20, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1071 static_assert(sizeof(stru336) == 0x798, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1072 static_assert(sizeof(Vec3_short_) == 6, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1073 static_assert(sizeof(BLVFace) == 96, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1074 static_assert(sizeof(BLVFaceExtra) == 36, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1075 static_assert(sizeof(BLVSector) == 116, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1076 static_assert(sizeof(LevelDecoration) == 32, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1077 static_assert(sizeof(BLVLightMM7) == 16, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1078 static_assert(sizeof(BSPNode) == 8, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1079 static_assert(sizeof(SpawnPointMM7) == 24, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1080 static_assert(sizeof(DDM_DLV_Header) == 40, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1081 static_assert(sizeof(Actor) == 836, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1082 static_assert(sizeof(SpriteObject) == 112, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1083 static_assert(sizeof(Chest) == 5324, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1084 static_assert(sizeof(stru123) == 0xC8, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1085 static_assert(sizeof(BLVMapOutline) == 12, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1086 static_assert(sizeof(LODSprite) == 0x28, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1087 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1088
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1089
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1090 //----- (004647AB) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1091 void FinalInitialization()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1092 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1093 pViewport->SetScreen(viewparams->uSomeX, viewparams->uSomeY, viewparams->uSomeZ, viewparams->uSomeW);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1094 pViewport->SetFOV(flt_6BE3A0 * 65536.0f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1095
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1096 //pIndoorCamera = new IndoorCamera;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1097 //pIndoorCamera->Initialize(65, viewparams->uScreen_BttmR_X - viewparams->uScreen_topL_X + 1,
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1098 // viewparams->uScreen_BttmR_Y - viewparams->uScreen_topL_Y + 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1099
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1100 InitializeTurnBasedAnimations(&stru_50C198);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1101 pBitmaps_LOD->_inlined_sub1();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1102 pSprites_LOD->_inlined_sub1();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1103 pIcons_LOD->_inlined_sub1();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1104 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1105 // 6BE3A0: using guessed type float flt_6BE3A0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1106
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1109 //----- (00464E17) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1110 bool __fastcall CheckMM7CD(char c)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1111 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1112 char DstBuf[256] = { 0 };
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1113 char strCommand[256] = { 0 }; // [sp+10Ch] [bp-118h]@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1114 char Filename[20] = { 0 }; // [sp+20Ch] [bp-18h]@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1115
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1116 wchar_t pMagicPath[1024];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1117 swprintf(pMagicPath, wcslen(L"%C:\\anims\\magic7.vid"), L"%C:\\anims\\magic7.vid", c);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1118 if (GetFileAttributesW(pMagicPath) == -1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1119 return false;
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 //Open CD audio
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1122 wsprintfA(strCommand, "open %c: type cdaudio alias CD", c);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1123 if (!mciSendStringA(strCommand, DstBuf, 255, 0))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1124 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1125 wsprintfA(strCommand, "info CD UPC wait");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1126 mciSendStringA(strCommand, DstBuf, 255, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1127 wsprintfA(strCommand, "close CD");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1128 mciSendStringA(strCommand, DstBuf, 255, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1129 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1130
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1131 memcpy(Filename, "X:\\anims\\magic7.vid", sizeof(Filename));
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1132 *Filename = c;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1133
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1134 FILE* f = fopen(Filename, "rb");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1135 if (!f)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1136 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1137
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1138 if (!fseek(f, 0, SEEK_END))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1139 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1140 if (!fseek(f, -100, SEEK_CUR))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1141 fread(DstBuf, 1, 0x64u, f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1142
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1143 fclose(f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1144 return true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1145 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1146 fclose(f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1147 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1148 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1149
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1150 //----- (00464F1B) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1151 signed int __stdcall InsertMM7CDDialogFunc(HWND hDlg, int a2, __int16 a3, int a4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1152 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1153 char v4; // zf@3
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1154 int v6; // eax@10
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1155 int v7; // eax@11
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1156 int v8; // eax@12
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1157 int v9; // eax@13
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1158 BOOL(__stdcall *v10)(HWND, int, LPCSTR); // edi@15
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1159 const CHAR *v11; // [sp-Ch] [bp-Ch]@15
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1160 INT_PTR v12; // [sp-4h] [bp-4h]@5
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1161
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1162 if (a2 == 272)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1163 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1164 hInsertCDWindow = hDlg;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1165 v6 = (GetUserDefaultLangID() & 0x3FF) - 7;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1166 if (v6)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1167 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1168 v7 = v6 - 3;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1169 if (v7)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1170 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1171 v8 = v7 - 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1172 if (v8)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1173 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1174 v9 = v8 - 4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1175 if (v9)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1176 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1177 if (v9 != 5)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1178 return 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1179 SetWindowTextA(hDlg, "Wloz CD-ROM numer 2");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1180 v10 = SetDlgItemTextA;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1181 SetDlgItemTextA(hDlg, 1010, "Wloz CD-ROM numer 2 Might and Magic® VII.");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1182 v11 = "Odwolaj";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1183 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1184 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1185 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1186 SetWindowTextA(hDlg, "Inserire il secondo CD");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1187 v10 = SetDlgItemTextA;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1188 SetDlgItemTextA(hDlg, 1010, "Inserire il secondo CD di Might and Magic® VII.");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1189 v11 = "Annulla";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1190 }
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 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1193 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1194 SetWindowTextA(hDlg, "Insérez le CD 2");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1195 v10 = SetDlgItemTextA;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1196 SetDlgItemTextA(hDlg, 1010, "Insérez Might & Magic® VII CD 2.");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1197 v11 = "Supprimer";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1198 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1199 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1200 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1201 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1202 SetWindowTextA(hDlg, "Por favor, inserte disco 2");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1203 v10 = SetDlgItemTextA;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1204 SetDlgItemTextA(hDlg, 1010, "Por favor, inserte disco 2 de Might & Magic® VII.");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1205 v11 = "Cancelar";
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1208 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1209 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1210 SetWindowTextA(hDlg, "Bitte CD 2 einlegen");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1211 v10 = SetDlgItemTextA;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1212 SetDlgItemTextA(hDlg, 1010, "Bitte CD 2 von Might and Magic® VII einlegen.");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1213 v11 = "Abbrechen";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1214 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1215 v10(hDlg, 2, v11);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1216 return 0;
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 if (a2 == 273)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1219 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1220 if (a3 == 2)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1221 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1222 v12 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1223 EndDialog(hDlg, v12);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1224 return 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1225 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1226 v4 = a3 == 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1227 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1228 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1229 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1230 v4 = a2 == 1025;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1231 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1232 if (v4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1233 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1234 v12 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1235 EndDialog(hDlg, v12);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1236 return 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1237 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1238 return 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1239 }
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 //----- (00465061) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1242 bool __fastcall FindMM7CD(HWND hWnd, char *pCDDrive)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1243 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1244 char drive[4] = { 'X', ':', '\\', 0 };
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1245
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1246 bool bGotCDFromRegistry = false;
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 HKEY hSoftware = nullptr,
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1249 hNWC = nullptr,
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1250 hMM7 = nullptr,
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1251 hVersion = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1252 if (!RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, KEY_READ | KEY_WOW64_32KEY, &hSoftware))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1253 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1254 if (!RegOpenKeyExA(hSoftware, "New World Computing", 0, KEY_READ | KEY_WOW64_32KEY, &hNWC))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1255 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1256 if (!RegOpenKeyExA(hNWC, "Might and Magic VII", 0, KEY_READ | KEY_WOW64_32KEY, &hMM7))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1257 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1258 if (!RegOpenKeyExA(hMM7, "1.0", 0, KEY_READ | KEY_WOW64_32KEY, &hVersion))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1259 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1260 DWORD cbData = 3;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1261 if (!RegQueryValueExA(hVersion, "CDDrive", 0, 0, (BYTE *)drive, &cbData))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1262 bGotCDFromRegistry = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1263 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1264 RegCloseKey(hVersion);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1265 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1266 RegCloseKey(hMM7);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1267 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1268 RegCloseKey(hNWC);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1269 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1270 RegCloseKey(hSoftware);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1271
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1272 if (bGotCDFromRegistry)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1273 if (CheckMM7CD(*drive))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1274 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1275 cMM7GameCDDriveLetter = *drive;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1276 return true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1277 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1278
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1279 while (true)
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 for (uint i = 0; i < 26; ++i)
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 drive[0] = 'A' + i;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1284
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1285 if (GetDriveTypeA(drive) == DRIVE_CDROM)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1286 if (CheckMM7CD(*drive))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1287 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1288 cMM7GameCDDriveLetter = *drive;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1289 WriteWindowsRegistryString("CDDrive", drive);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1290 return true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1291 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1292 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1293
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1294 if (DialogBoxParamA(GetModuleHandleW(nullptr), "InsertCD", hWnd, (DLGPROC)InsertMM7CDDialogFunc, 0))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1295 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1296 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1297 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1298 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1299
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1300 //----- (004651F4) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1301 bool MM7_Initialize(int game_width, int game_height)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1302 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1303 wchar_t pCurrentDir[1024];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1304 _wgetcwd(pCurrentDir, 1024);
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 wchar_t pMM6IniFile[1024];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1307 wsprintfW(pMM6IniFile, L"%s\\mm6.ini", pCurrentDir);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1308
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1309 bCanLoadFromCD = GetPrivateProfileIntW(L"settings", L"use_cd", 1, pMM6IniFile);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1310 if (bNoCD)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1311 bCanLoadFromCD = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1312 if (bCanLoadFromCD)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1313 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1314 Log::Warning(L"Checking for CD...");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1315 if (!FindMM7CD(nullptr, &cMM7GameCDDriveLetter))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1316 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1317 Log::Warning(L"...done.");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1318 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1319
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1320
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1321 srand(GetTickCount());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1322
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1323 pEventTimer = Timer::Create();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1324 pEventTimer->Initialize();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1325 window = OSWindow::Create(L"Might and Magic® Trilogy", game_width, game_height);//Create game window
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1326
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1327 bool use_d3d11 = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1328 if (use_d3d11)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1329 pRenderer = RenderD3D11::Create();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1330 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1331 pRenderer = Render::Create();//Create DirectX
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1332 if (!pRenderer)
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 Log::Warning(L"Render creation failed");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1335 return false;
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 else
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 //bool bWindowMode = ReadWindowsRegistryInt("startinwindow", false);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1340 //uint uDefaultDevice = ReadWindowsRegistryInt("D3D Device", 1);
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 (!pRenderer->Initialize(window/*, bColoredLights, uLevelOfDetail, bTinting*/))
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 Log::Warning(L"Render failed to initialize");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1345 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1346 }
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1349 game_starting_year = 1168;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1350
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1351 pParty = new Party;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1352 memset(&pParty->pHirelings, 0, sizeof(pParty->pHirelings));
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1353 pParty->uWalkSpeed = GetPrivateProfileIntW(L"debug", L"walkspeed", 384, pMM6IniFile);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1354 pParty->uDefaultEyelevel = GetPrivateProfileIntW(L"party", L"eyelevel", 160, pMM6IniFile);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1355 pParty->sEyelevel = pParty->uDefaultEyelevel;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1356 pParty->uDefaultPartyHeight = GetPrivateProfileIntW(L"party", L"height", 192, pMM6IniFile);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1357 pParty->uPartyHeight = pParty->uDefaultPartyHeight;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1358
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1359 MM6_Initialize(pMM6IniFile);
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 pKeyActionMap = new KeyboardActionMapping;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1362
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1363 OnTimer(1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1364 GameUI_StatusBar_UpdateTimedString(1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1365 pEngine = Engine::Create();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1366 pMouse = pEngine->pMouseInstance;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1367
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1368
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1369 pIcons_LOD = new LODFile_IconsBitmaps;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1370 if (!pIcons_LOD->Load("data\\icons.lod", "icons"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1371 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1372 MessageBoxW(nullptr, L"Some files are missing\n\nPlease Reinstall.",
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1373 L"Files Missing", MB_ICONEXCLAMATION);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1374 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1375 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1376 pIcons_LOD->dword_011BA4 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1377
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1378 pEvents_LOD = new LODFile_IconsBitmaps;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1379 if (!pEvents_LOD->Load("data\\events.lod", "icons"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1380 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1381 MessageBoxW(nullptr, L"Some files are missing\n\nPlease Reinstall.",
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1382 L"Files Missing", MB_ICONEXCLAMATION);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1383 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1384 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1385
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1386 InitializeGameText();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1387
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1388 pBitmaps_LOD = new LODFile_IconsBitmaps;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1389 if (!pBitmaps_LOD->Load("data\\bitmaps.lod", "bitmaps"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1390 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1391 MessageBoxA(nullptr, pGlobalTXT_LocalizationStrings[63],
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1392 pGlobalTXT_LocalizationStrings[184], MB_ICONEXCLAMATION);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1393 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1394 }
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 pSprites_LOD = new LODFile_Sprites;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1397 if (!pSprites_LOD->LoadSprites("data\\sprites.lod"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1398 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1399 MessageBoxA(nullptr,
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1400 pGlobalTXT_LocalizationStrings[63],
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1401 pGlobalTXT_LocalizationStrings[184], MB_ICONEXCLAMATION);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1402 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1403 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1404
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1405
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1406 #if 0
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1407 if (_access("../MM_VI/data/icons.lod", 0) == 0)
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 pIcons_LOD_mm6 = new LODFile_IconsBitmaps;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1410 if (!pIcons_LOD_mm6->Load("../MM_VI/data/icons.lod", "icons"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1411 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1412 delete pIcons_LOD_mm6;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1413 pIcons_LOD_mm6 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1414 Log::Warning(L"Unable to load mm6:icons.lod");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1415 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1416 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1417 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1418 Log::Warning(L"Unable to find mm6:icons.lod");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1419
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1420 if (_access("../MM_VI/data/bitmaps.lod", 0) == 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1421 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1422 pBitmaps_LOD_mm6 = new LODFile_IconsBitmaps;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1423 if (!pBitmaps_LOD_mm6->Load("../MM_VI/data/bitmaps.lod", "bitmaps"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1424 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1425 delete pBitmaps_LOD_mm6;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1426 pBitmaps_LOD_mm6 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1427 Log::Warning(L"Unable to load mm6:bitmaps.lod");
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1430 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1431 Log::Warning(L"Unable to find mm6:bitmaps.lod");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1432
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1433 auto mm6_sprite_container_name = bUseLoResSprites ? "../MM_VI/data/spriteLO.lod"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1434 : "../MM_VI/data/sprites.lod";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1435 if (_access(mm6_sprite_container_name, 0) == 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1436 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1437 pSprites_LOD_mm6 = new LODFile_Sprites;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1438 if (!pSprites_LOD_mm6->LoadSprites(mm6_sprite_container_name))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1439 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1440 delete pSprites_LOD_mm6;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1441 pSprites_LOD_mm6 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1442 Log::Warning(L"Unable to load mm6:sprites.lod");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1443 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1444 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1445 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1446 Log::Warning(L"Unable to find mm6:sprites.lod");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1447
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1448
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1449 if (_access("../mm8/data/icons.lod", 0) == 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1450 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1451 pIcons_LOD_mm8 = new LODFile_IconsBitmaps;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1452 if (!pIcons_LOD_mm8->Load("../mm8/data/icons.lod", "icons"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1453 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1454 delete pIcons_LOD_mm8;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1455 pIcons_LOD_mm8 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1456 Log::Warning(L"Unable to load mm8:icons.lod");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1457 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1458 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1459 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1460 Log::Warning(L"Unable to find mm8:icons.lod");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1461
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1462
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1463 if (_access("../mm8/data/bitmaps.lod", 0) == 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1464 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1465 pBitmaps_LOD_mm8 = new LODFile_IconsBitmaps;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1466 if (!pBitmaps_LOD_mm8->Load("../mm8/data/bitmaps.lod", "bitmaps"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1467 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1468 delete pBitmaps_LOD_mm8;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1469 pBitmaps_LOD_mm8 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1470 Log::Warning(L"Unable to load mm8:bitmaps.lod");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1471 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1472 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1473 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1474 Log::Warning(L"Unable to find mm8:bitmaps.lod");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1475
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1476
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1477 if (_access("../mm8/data/sprites.lod", 0) == 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1478 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1479 pSprites_LOD_mm8 = new LODFile_Sprites;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1480 if (!pSprites_LOD_mm8->LoadSprites("../mm8/data/sprites.lod"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1481 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1482 delete pSprites_LOD_mm8;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1483 pSprites_LOD_mm8 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1484 Log::Warning(L"Unable to load mm8:sprites.lod");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1485 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1486 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1487 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1488 Log::Warning(L"Unable to find mm8:sprites.lod");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1489 #endif
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1490
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1491 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1492 void *sft_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dsft.bin", 1) : nullptr,
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1493 *sft_mm8 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1494 void *sft_mm7 = pEvents_LOD->LoadRaw("dsft.bin", 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1495 pSpriteFrameTable = new SpriteFrameTable;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1496 pSpriteFrameTable->FromFile(sft_mm6, sft_mm7, sft_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1497 free(sft_mm6);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1498 free(sft_mm7);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1499 free(sft_mm8);
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 void *tft_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dtft.bin", 1) : nullptr,
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1502 *tft_mm8 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1503 void *tft_mm7 = pEvents_LOD->LoadRaw("dtft.bin", 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1504 pTextureFrameTable = new TextureFrameTable;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1505 pTextureFrameTable->FromFile(tft_mm6, tft_mm7, tft_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1506 free(tft_mm6);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1507 free(tft_mm7);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1508 free(tft_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1509
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1510 void *tiles_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dtile.bin", 1) : nullptr,
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1511 *tiles_mm8 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1512 void *tiles_mm7 = pEvents_LOD->LoadRaw("dtile.bin", 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1513 pTileTable = new TileTable;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1514 pTileTable->FromFile(tiles_mm6, tiles_mm7, tiles_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1515 free(tiles_mm6);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1516 free(tiles_mm7);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1517 free(tiles_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1518
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1519 void *pft_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dpft.bin", 1) : nullptr,
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1520 *pft_mm8 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1521 void *pft_mm7 = pEvents_LOD->LoadRaw("dpft.bin", 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1522 pPlayerFrameTable = new PlayerFrameTable;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1523 pPlayerFrameTable->FromFile(pft_mm6, pft_mm7, pft_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1524 free(pft_mm6);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1525 free(pft_mm7);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1526 free(pft_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1527
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1528 void *ift_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dift.bin", 1) : nullptr,
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1529 *ift_mm8 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1530 void *ift_mm7 = pEvents_LOD->LoadRaw("dift.bin", 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1531 pIconsFrameTable = new IconFrameTable;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1532 pIconsFrameTable->FromFile(ift_mm6, ift_mm7, ift_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1533 free(ift_mm6);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1534 free(ift_mm7);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1535 free(ift_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1536
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1537 void *decs_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("ddeclist.bin", 1) : nullptr,
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1538 *decs_mm8 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1539 void *decs_mm7 = pEvents_LOD->LoadRaw("ddeclist.bin", 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1540 pDecorationList = new DecorationList;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1541 pDecorationList->FromFile(decs_mm6, decs_mm7, decs_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1542 free(decs_mm6);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1543 free(decs_mm7);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1544 free(decs_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1545
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1546 void *objs_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dobjlist.bin", 1) : nullptr,
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1547 *objs_mm8 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1548 void *objs_mm7 = pEvents_LOD->LoadRaw("dobjlist.bin", 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1549 pObjectList = new ObjectList;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1550 pObjectList->FromFile(objs_mm6, objs_mm7, objs_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1551 free(objs_mm6);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1552 free(objs_mm7);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1553 free(objs_mm8);
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 void *mons_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dmonlist.bin", 1) : nullptr,
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1556 *mons_mm8 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1557 void *mons_mm7 = pEvents_LOD->LoadRaw("dmonlist.bin", 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1558 pMonsterList = new MonsterList;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1559 pMonsterList->FromFile(mons_mm6, mons_mm7, mons_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1560 free(mons_mm6);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1561 free(mons_mm7);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1562 free(mons_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1563
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1564 void *chests_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dchest.bin", 1) : nullptr,
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1565 *chests_mm8 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1566 void *chests_mm7 = pEvents_LOD->LoadRaw("dchest.bin", 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1567 pChestList = new ChestList;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1568 pChestList->FromFile(chests_mm6, chests_mm7, chests_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1569 free(chests_mm6);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1570 free(chests_mm7);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1571 free(chests_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1572
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1573 void *overlays_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("doverlay.bin", 1) : nullptr,
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1574 *overlays_mm8 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1575 void *overlays_mm7 = pEvents_LOD->LoadRaw("doverlay.bin", 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1576 pOverlayList = new OverlayList;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1577 pOverlayList->FromFile(overlays_mm6, overlays_mm7, overlays_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1578 free(overlays_mm6);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1579 free(overlays_mm7);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1580 free(overlays_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1581
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1582 void *sounds_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dsounds.bin", 1) : nullptr,
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1583 *sounds_mm8 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1584 void *sounds_mm7 = pEvents_LOD->LoadRaw("dsounds.bin", 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1585 pSoundList = new SoundList;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1586 pSoundList->FromFile(sounds_mm6, sounds_mm7, sounds_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1587 free(sounds_mm6);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1588 free(sounds_mm7);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1589 free(sounds_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1590 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1591
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1592
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1593
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1594
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1595 if (dword_6BE368_debug_settings_2 & DEBUG_SETTINGS_RUN_IN_WIDOW)
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 //window->SetWindowedMode(game_width, game_height);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1598 pRenderer->SwitchToWindow();
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 __debugbreak(); // Nomad
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1603 window->SetFullscreenMode();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1604 pRenderer->InitializeFullscreen();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1605 }
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 uSoundVolumeMultiplier = min(9, ReadWindowsRegistryInt("soundflag", 9));
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1608 uMusicVolimeMultiplier = min(9, ReadWindowsRegistryInt("musicflag", 9));
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1609 uVoicesVolumeMultiplier = min(9, ReadWindowsRegistryInt("CharVoices", 9));
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1610 bShowDamage = ReadWindowsRegistryInt("ShowDamage", 1) != 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1611
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1612 uGammaPos = min(4, ReadWindowsRegistryInt("GammaPos", 4));
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1613 //pEngine->pGammaController->Initialize(uGammaPos * 0.1 + 0.6);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1614
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1615 if (ReadWindowsRegistryInt("Bloodsplats", 1))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1616 pEngine->uFlags2 |= GAME_FLAGS_2_DRAW_BLOODSPLATS;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1617 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1618 pEngine->uFlags2 &= ~GAME_FLAGS_2_DRAW_BLOODSPLATS;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1619
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1620 uTurnSpeed = ReadWindowsRegistryInt("TurnDelta", 3);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1621
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1622 if (!bNoSound)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1623 pAudioPlayer->Initialize();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1624
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1625 pMediaPlayer = new Media::MPlayer();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1626 pMediaPlayer->Initialize(window);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1627
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1628 dword_6BE364_game_settings_1 |= GAME_SETTINGS_4000;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1629
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1630 switch (uTurnSpeed)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1631 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1632 case 0: // undefined turn option
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1633 __debugbreak(); // really shouldn't use this mode
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1634 uTurnSpeed = 64; //(unsigned int)uCPUSpeed < 199/*MHz*/ ? 128 : 64; // adjust turn speed to estimated fps
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1635 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1636
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1637 case 1: // 16x
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1638 Log::Warning(L"x16 Turn Speed"); // really shouldn't use this mode
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1639 uTurnSpeed = 128;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1640 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1641
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1642 case 2: // 32x
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1643 Log::Warning(L"x32 Turn Speed"); // really shouldn't use this mode
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1644 uTurnSpeed = 64;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1645 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1646
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1647 case 3: // smooth
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1648 uTurnSpeed = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1649 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1650 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1651
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1652 return true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1653 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1654
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1655 //----- (00465D0B) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1656 void SecondaryInitialization()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1657 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1658 pMouse->Initialize(window);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1659
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1660 pItemsTable = new ItemsTable;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1661 pItemsTable->Initialize();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1662
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1663 //pBitmaps_LOD->can_load_hardware_sprites = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1664 //pBitmaps_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1665 pBitmaps_LOD->SetupPalettes(5, 6, 5);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1666 //pIcons_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1667 pIcons_LOD->SetupPalettes(5, 6, 5);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1668 //pPaletteManager->SetColorChannelInfo(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1669 pPaletteManager->SetColorChannelInfo(5, 6, 5);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1670
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1671 pPaletteManager->SetMistColor(128, 128, 128);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1672 pPaletteManager->RecalculateAll();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1673 //pSprites_LOD->can_load_hardware_sprites = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1674 pObjectList->InitializeSprites();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1675 pOverlayList->InitializeSprites();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1676
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1677 if (!bNoSound)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1678 pSoundList->Initialize();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1679
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1680
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1681 for (uint i = 0; i < 4; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1682 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1683 static const char *pUIAnimNames[4] =
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1684 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1685 "glow03", "glow05",
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1686 "torchA", "wizeyeA"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1687 };
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1688 static unsigned short _4E98D0[4][4] =
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1689 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1690 { 479, 0, 329, 0 },
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1691 { 585, 0, 332, 0 },
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1692 { 468, 0, 0, 0 },
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1693 { 606, 0, 0, 0 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1694 };
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1695
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1696 pUIAnims[i]->uIconID = pIconsFrameTable->FindIcon(pUIAnimNames[i]);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1697 pIconsFrameTable->InitializeAnimation(pUIAnims[i]->uIconID);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1698
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1699 pUIAnims[i]->uAnimLength = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1700 pUIAnims[i]->uAnimTime = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1701 pUIAnims[i]->x = _4E98D0[i][0];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1702 pUIAnims[i]->y = _4E98D0[i][2];
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1705 for (unsigned int i = 0; i < pObjectList->uNumObjects; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1706 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1707 pObjectList->pObjects[i].uParticleTrailColor = pObjectList->pObjects[i].uParticleTrailColorB |
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1708 ((unsigned int)pObjectList->pObjects[i].uParticleTrailColorG << 8) |
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1709 ((unsigned int)pObjectList->pObjects[i].uParticleTrailColorR << 16);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1710 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1711
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1712 MainMenuUI_Create();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1713 pEngine->pStru6Instance->LoadAnimations();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1714
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1715 for (uint i = 0; i < 7; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1716 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1717 char container_name[64];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1718 sprintf(container_name, "HDWTR%03u", i);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1719 pRenderer->pHDWaterBitmapIDs[i] = pBitmaps_LOD->LoadTexture(container_name);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1720 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1721
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1722 pNPCStats = new NPCStats;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1723 memset(pNPCStats->pNPCData, 0, 0x94BCu);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1724 pNPCStats->Initialize();
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 Initialize_GlobalEVT();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1727 pBitmaps_LOD->_inlined_sub0();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1728 pSprites_LOD->_inlined_sub0();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1729 pPaletteManager->LockAll();
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 _mkdir("Saves");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1732 for (uint i = 0; i < 5; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1733 for (uint j = 0; j < 6; ++j)
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 sprintf(pTmpBuf.data(), "data\\lloyd%d%d.pcx", i, j);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1736 remove(pTmpBuf.data());
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1739 Initialize_GamesLOD_NewLOD();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1740 _576E2C_current_minimap_zoom = 512;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1741 dword_576E28 = 9;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1742 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1743
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1744 int max_flight_height = 4000; //maximum altitude
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1745 bool use_MMT = false;
2551
4008b2f34be0 MainMenu rendering moved from event loop to respective window class
a.parshin
parents: 2544
diff changeset
1746 bool use_music_folder = false;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1747 bool for_refactoring = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1748
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1749 //----- (00462C94) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1750 bool MM_Main(const wchar_t *pCmdLine)
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 IntegrityTest();
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 lua = new LuaVM;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1755 lua->Initialize();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1756
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1757 bool bNoMargareth = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1758 if (pCmdLine && *pCmdLine)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1759 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1760 //if (wcsstr(pCmdLine, L"-usedefs"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1761 // bDebugResouces = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1762 if (wcsstr(pCmdLine, L"-window"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1763 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_RUN_IN_WIDOW;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1764
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1765 if (wcsstr(pCmdLine, L"-nointro"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1766 bNoIntro = true;//dword_6BE364_game_settings_1 |= 4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1767 if (wcsstr(pCmdLine, L"-nologo"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1768 bNoLogo = true;//dword_6BE364_game_settings_1 |= 8;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1769 if (wcsstr(pCmdLine, L"-nosound"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1770 bNoSound = true; //dword_6BE364_game_settings_1 |= 0x10;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1771
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1772 bWalkSound = ReadWindowsRegistryInt("WalkSound", 1) != 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1773 if (wcsstr(pCmdLine, L"-nowalksound"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1774 bWalkSound = false;//dword_6BE364_game_settings_1 |= 0x20;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1775 if (wcsstr(pCmdLine, L"-novideo"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1776 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1777 dword_6BE364_game_settings_1 |= GAME_SETTINGS_NO_HOUSE_ANIM;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1778 bNoVideo = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1779 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1780 if (wcsstr(pCmdLine, L"-nocd"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1781 bNoCD = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1782 if (wcsstr(pCmdLine, L"-nomarg"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1783 bNoMargareth = true;
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 //_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF | _CRTDBG_CHECK_ALWAYS_DF );//Ritor1: for memory test
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1787
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1788 if (!MM7_Initialize(640, 480))
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 Log::Warning(L"MM init: failed");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1791 pEngine->Deinitialize();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1792 return 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1793 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1794
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1795 pEventTimer->Pause();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1796
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1797 SetUserInterface(PartyAlignment_Neutral, false);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1798
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1799 ShowLogoVideo();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1800 //ShowIntroVideo_and_LoadingScreen();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1801 WriteWindowsRegistryInt("Ran once", 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1802 dword_6BE364_game_settings_1 |= GAME_SETTINGS_4000;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1803 SecondaryInitialization();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1804 //pRenderer->SetRasterClipRect(0, 0, window->GetWidth() - 1, window->GetHeight() - 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1805 FinalInitialization();
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 //Ritor1: include
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1808 if (use_MMT)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1809 MMT_MainMenu_Loop();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1810
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1811 Log::Warning(L"MM: entering main loop");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1812 while (1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1813 {
2552
ac16f4a3a91e Load from MainMenu logic separated from MainMenu window
a.parshin
parents: 2551
diff changeset
1814 //MainMenuWindow *main_menu_window = MainMenuWindow::Create();
ac16f4a3a91e Load from MainMenu logic separated from MainMenu window
a.parshin
parents: 2551
diff changeset
1815 //window->AddControl(main_menu_window);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1816 MainMenu_Loop();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1817 uGameState = GAME_STATE_PLAYING;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1818 while (1)
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 if (uGameState == GAME_FINISHED || GetCurrentMenuID() == MENU_EXIT_GAME)
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 pEngine->Deinitialize();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1823 return true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1824 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1825
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1826 if (GetCurrentMenuID() == MENU_NEWGAME)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1827 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1828 if (use_music_folder)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1829 alSourceStop(mSourceID);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1830 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1831 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1832 if (pAudioPlayer->hAILRedbook)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1833 AIL_redbook_stop(pAudioPlayer->hAILRedbook);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1834 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1835 pParty->Reset();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1836 pOtherOverlayList->Reset();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1837 strcpy(pCurrentMapName, pStartingMapName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1838 pParty->CreateDefaultParty(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1839 PlayerCreationUI_Initialize();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1840 if (PlayerCreationUI_Loop())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1841 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1842 DeleteCCharFont();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1843 break;
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 DeleteCCharFont();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1846 bFlashQuestBook = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1847 pMediaPlayer->PlayFullscreenMovie(MOVIE_Emerald, true);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1848 SaveNewGame();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1849 if (bNoMargareth)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1850 _449B7E_toggle_bit(pParty->_quest_bits, PARTY_QUEST_EMERALD_MARGARETH_OFF, 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1851 Game_Loop();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1852 if (uGameState == GAME_STATE_NEWGAME_OUT_GAMEMENU)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1853 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1854 SetCurrentMenuID(MENU_NEWGAME);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1855 uGameState = GAME_STATE_PLAYING;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1856 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1857 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1858 else if (uGameState == GAME_STATE_GAME_QUITTING_TO_MAIN_MENU)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1859 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1860 assert(false && "Invalid game state");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1861 }
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
1862 else if (GetCurrentMenuID() == MENU_CREDITS)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1863 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1864 if (use_music_folder)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1865 alSourceStop(mSourceID);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1866 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1867 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1868 if (pAudioPlayer->hAILRedbook)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1869 AIL_redbook_stop(pAudioPlayer->hAILRedbook);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1870 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1871 MainMenuUI_Credits_Loop();
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 }
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
1874 else if (GetCurrentMenuID() == MENU_5 || GetCurrentMenuID() == MENU_LoadingProcInMainMenu)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1875 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1876 uGameState = GAME_STATE_PLAYING;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1877 Game_Loop();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1878 }
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
1879 else if (GetCurrentMenuID() == MENU_DebugBLVLevel)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1880 {
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
1881 pMouse->ChangeActivation(0);
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
1882 pParty->Reset();
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
1883 pParty->CreateDefaultParty(1);
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
1884
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
1885 __debugbreak();
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
1886 /*extern void CreateDefaultBLVLevel();
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
1887 CreateDefaultBLVLevel();
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
1888
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
1889 OPENFILENAMEA ofn;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
1890 if ( !GetOpenFileNameA((LPOPENFILENAMEA)&ofn) )
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1891 {
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
1892 pMouse->ChangeActivation(1);
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
1893 break;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1894 }
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
1895 _chdir("..\\");
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
1896 strcpy(pCurrentMapName, ofn.lpstrFileTitle);*/
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
1897 pMouse->ChangeActivation(1);
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
1898 Game_Loop();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1899 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1900 if (uGameState == GAME_STATE_LOADING_GAME)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1901 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1902 SetCurrentMenuID(MENU_5);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1903 uGameState = GAME_STATE_PLAYING;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1904 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1905 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1906 if (uGameState == GAME_STATE_NEWGAME_OUT_GAMEMENU)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1907 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1908 SetCurrentMenuID(MENU_NEWGAME);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1909 uGameState = GAME_STATE_PLAYING;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1910 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1911 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1912 if (uGameState == GAME_STATE_GAME_QUITTING_TO_MAIN_MENU)// from the loaded game
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1913 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1914 pAudioPlayer->StopChannels(-1, -1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1915 uGameState = GAME_STATE_PLAYING;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1916 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1917 }
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 if (!bNoSound)
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 (use_music_folder)
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 PlayAudio(L"Music\\14.mp3");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1924 alSourcef(mSourceID, AL_GAIN, pSoundVolumeLevels[uMusicVolimeMultiplier]);
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 else if (pAudioPlayer->hAILRedbook)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1927 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1928 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1929 AIL_redbook_stop(pAudioPlayer->hAILRedbook);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1930 unsigned int startms, end_ms;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1931 AIL_redbook_track_info(pAudioPlayer->hAILRedbook, 14, &startms, &end_ms);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1932 AIL_redbook_play(pAudioPlayer->hAILRedbook, startms + 1, end_ms);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1933 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1934 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1935 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1936 //lua_close(L);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1937 pEngine->Deinitialize();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1938 return 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1939 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1940
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1941
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1942
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1943 //----- (00466082) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1944 void MM6_Initialize(const wchar_t *pIniFilename)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1945 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1946 size_t v2; // eax@31
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1947 size_t v3; // ebx@32
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1948 size_t v4; // edi@36
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1949 char pDefaultGroundTexture[16]; // [sp+FCh] [bp-8Ch]@32
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1950 unsigned int v9; // [sp+184h] [bp-4h]@28
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1951
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1952 //_getcwd(v5, 120);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1953 //sprintfex(pIniFilename, "%s\\mm6.ini", v5);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1954 viewparams = new ViewingParams;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1955 game_viewport_x = viewparams->uScreen_topL_X = GetPrivateProfileIntW(L"screen", L"vx1", 8, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1956 game_viewport_y = viewparams->uScreen_topL_Y = GetPrivateProfileIntW(L"screen", L"vy1", 8, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1957 game_viewport_z = viewparams->uScreen_BttmR_X = GetPrivateProfileIntW(L"screen", L"vx2", 468, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1958 game_viewport_w = viewparams->uScreen_BttmR_Y = GetPrivateProfileIntW(L"screen", L"vy2", 351, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1959 game_viewport_width = game_viewport_z - game_viewport_x;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1960 game_viewport_height = game_viewport_w - game_viewport_y + 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1961
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1962
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1963 pAudioPlayer = new AudioPlayer;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1964 pAudioPlayer->uMixerChannels = GetPrivateProfileIntW(L"settings", L"mixerchannels", 16, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1965 if (pAudioPlayer->uMixerChannels > 16)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1966 pAudioPlayer->uMixerChannels = 16;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1967
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1968
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1969 if (GetPrivateProfileIntW(L"debug", L"nomonster", 0, pIniFilename))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1970 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_NO_ACTORS;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1971 if (ReadWindowsRegistryInt("startinwindow", 0))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1972 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_RUN_IN_WIDOW;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1973 if (GetPrivateProfileIntW(L"debug", L"showFR", 0, pIniFilename))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1974 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_0002_SHOW_FR;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1975 if (GetPrivateProfileIntW(L"debug", L"nodamage", 0, pIniFilename))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1976 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_NO_DAMAGE;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1977 if (GetPrivateProfileIntW(L"debug", L"nodecoration", 0, pIniFilename))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1978 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_NO_DECORATIONS;
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 wchar_t pStartingMapNameW[1024];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1981 GetPrivateProfileStringW(L"file", L"startmap", L"out01.odm", pStartingMapNameW, 0x20u, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1982 sprintf(pStartingMapName, "%S", pStartingMapNameW);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1983
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1984 v9 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1985 if (strlen(pStartingMapName))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1986 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1987 do
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 if (pStartingMapName[v9] == ' ')
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1990 pStartingMapName[v9] = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1991 ++v9;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1992 v2 = strlen(pStartingMapName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1993 } while (v9 < v2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1994 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1995
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1996 pODMRenderParams = new ODMRenderParams;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1997 pODMRenderParams->outdoor_no_mist = GetPrivateProfileIntW(L"debug", L"noMist", 0, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1998 pODMRenderParams->bNoSky = GetPrivateProfileIntW(L"outdoor", L"nosky", 0, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1999 pODMRenderParams->bDoNotRenderDecorations = GetPrivateProfileIntW(L"render", L"nodecorations", 0, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2000 pODMRenderParams->outdoor_no_wavy_water = GetPrivateProfileIntW(L"outdoor", L"nowavywater", 0, pIniFilename);
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
2001 //outdoor_grid_band_1 = GetPrivateProfileIntW(L"outdoor", L"gridband1", 10, pIniFilename);
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
2002 //outdoor_grid_band_2 = GetPrivateProfileIntW(L"outdoor", L"gridband2", 15, pIniFilename);
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
2003 //outdoor_grid_band_3 = GetPrivateProfileIntW(L"outdoor", L"gridband3", 25, pIniFilename);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2004 pODMRenderParams->terrain_gamma = GetPrivateProfileIntW(L"outdoor", L"ter_gamma", 0, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2005 pODMRenderParams->building_gamme = GetPrivateProfileIntW(L"outdoor", L"bld_gamma", 0, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2006 pODMRenderParams->shading_dist_shade = GetPrivateProfileIntW(L"shading", L"dist_shade", 2048, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2007 pODMRenderParams->shading_dist_shademist = GetPrivateProfileIntW(L"shading", L"dist_shademist", 4096, pIniFilename);
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 pODMRenderParams->shading_dist_mist = GetPrivateProfileIntW(L"shading", L"dist_mist", 0x2000, pIniFilename);//drawing dist 0x2000
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 wchar_t pDefaultSkyTextureW[1024];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2012 GetPrivateProfileStringW(L"textures", L"sky", L"plansky1", pDefaultSkyTextureW, 0x10u, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2013 sprintf(pDefaultSkyTexture.data(), "%S", pDefaultSkyTextureW);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2014
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2015 wchar_t pDefaultGroundTextureW[1024];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2016 GetPrivateProfileStringW(L"textures", L"default", L"dirt", pDefaultGroundTextureW, 0x10u, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2017 sprintf(pDefaultGroundTexture, "%S", pDefaultGroundTextureW);
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 wchar_t pFloat[1024];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2020 GetPrivateProfileStringW(L"debug", L"recmod1", L"1.0", pFloat, 0x10u, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2021 swscanf(pFloat, L"%f", &flt_6BE3A4_debug_recmod1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2022
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2023 GetPrivateProfileStringW(L"debug", L"recmod2", L"1.0", pFloat, 0x10u, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2024 swscanf(pFloat, L"%f", &flt_6BE3A8_debug_recmod2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2025
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2026 flt_6BE3AC_debug_recmod1_x_1_6 = flt_6BE3A4_debug_recmod1 * 1.666666666666667;
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 v3 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2029 if (strlen(pDefaultSkyTexture.data()))
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 do
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 (pDefaultSkyTexture[v3] == ' ')
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2034 pDefaultSkyTexture[v3] = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2035 ++v3;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2036 } while (v3 < strlen(pDefaultSkyTexture.data()));
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 v4 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2039 if (strlen(pDefaultGroundTexture))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2040 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2041 do
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2042 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2043 if (pDefaultGroundTexture[v4] == ' ')
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2044 pDefaultGroundTexture[v4] = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2045 ++v4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2046 } while (v4 < strlen(pDefaultGroundTexture));
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 MM7Initialization();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2050 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2051
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2052 //----- (004666D5) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2053 void MM7Initialization()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2054 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2055 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2056 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2057 /*if (byte_6BE388_graphicsmode == 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2058 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2059 outdoor_grid_band_1 = 10;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2060 outdoor_grid_band_2 = 15;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2061 outdoor_grid_band_3 = 20;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2062 pODMRenderParams->shading_dist_mist = 8192;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2063 pODMRenderParams->bNoSky = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2064 LOBYTE(viewparams->field_20) = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2065 }*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2066 pODMRenderParams->shading_dist_shade = 2048;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2067 pODMRenderParams->terrain_gamma = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2068 pODMRenderParams->building_gamme = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2069 pODMRenderParams->shading_dist_shademist = 4096;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2070 pODMRenderParams->outdoor_no_wavy_water = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2071 //_47F4D3_initialize_terrain_bezier_stuff(outdoor_grid_band_1, outdoor_grid_band_2, outdoor_grid_band_3);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2072 {
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
2073 pODMRenderParams->outdoor_grid_band_3 = 25;//outdoor_grid_band_3;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
2074 pODMRenderParams->uPickDepth = 25 * 512;//outdoor_grid_band_3 * 512;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2075 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2076 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2077 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2078 LOBYTE(viewparams->field_20) = 0;
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
2079
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2080 pParty->uFlags |= 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2081 viewparams->uSomeY = viewparams->uScreen_topL_Y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2082 viewparams->uSomeX = viewparams->uScreen_topL_X;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2083 viewparams->uSomeZ = viewparams->uScreen_BttmR_X;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2084 viewparams->uSomeW = viewparams->uScreen_BttmR_Y;
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 pViewport->SetScreen(viewparams->uScreen_topL_X, viewparams->uScreen_topL_Y, viewparams->uScreen_BttmR_X, viewparams->uScreen_BttmR_Y);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2087 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2088 pODMRenderParams->Initialize();
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2091 //----- (004610AA) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2092 void __fastcall PrepareToLoadODM(unsigned int bLoading, ODMRenderParams *a2)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2093 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2094 pGameLoadingUI_ProgressBar->Reset(27);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2095 pSoundList->_4A9D79(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2096 uCurrentlyLoadedLevelType = LEVEL_Outdoor;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2097 ODM_LoadAndInitialize(pCurrentMapName, a2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2098 if (!bLoading)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2099 TeleportToStartingPoint(uLevel_StartingPointType);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2100 viewparams->_443365();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2101 PlayLevelMusic();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2102 }
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
2103
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2104
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2105 //----- (00464479) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2106 void ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2107 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2108 int v0; // esi@9
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2109
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2110 if (pMouse)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2111 pMouse->SetCursorBitmap("MICON1");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2112
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2113 pPaletteManager->ResetNonLocked();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2114 pBitmaps_LOD->ReleaseAll2();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2115 pSprites_LOD->DeleteSomeOtherSprites();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2116 pIcons_LOD->ReleaseAll2();
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 (uCurrentlyLoadedLevelType == LEVEL_Indoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2119 pIndoor->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2120 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2121 pOutdoor->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2122
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2123 pAudioPlayer->StopChannels(-1, -1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2124 pSoundList->_4A9D79(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2125 uCurrentlyLoadedLevelType = LEVEL_null;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2126 pSpriteFrameTable->ResetSomeSpriteFlags();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2127 v0 = uNumVisibleWindows;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2128 pParty->armageddon_timer = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2129 while (v0 > 0)
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2130 {
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2131 pWindowList[pVisibleWindowsIdxs[v0--] - 1]->Release();
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2132 delete pWindowList[pVisibleWindowsIdxs[v0--] - 1];
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2133 pWindowList[pVisibleWindowsIdxs[v0--] - 1] = nullptr;
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2134 }
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2135 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2136
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2137 //----- (00461103) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2138 void _461103_load_level_sub()
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 int v4; // edx@8
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2141 signed int v6; // esi@14
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2142 signed int v8; // ecx@16
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2143 int v12; // esi@25
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2144 int v13; // eax@26
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2145 __int16 v14; // ax@41
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2146 signed int v17; // [sp+14h] [bp-48h]@3
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2147 signed int v18; // [sp+14h] [bp-48h]@23
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2148 int v19; // [sp+18h] [bp-44h]@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2149 signed int v20; // [sp+18h] [bp-44h]@14
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2150 int v21[16]; // [sp+1Ch] [bp-40h]@17
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2151
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2152 GenerateItemsInChest();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2153 pGameLoadingUI_ProgressBar->Progress();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2154 pParty->uFlags |= 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2155 pParty->field_7B5_in_arena_quest = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2156 dword_5C6DF8 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2157 pNPCStats->uNewlNPCBufPos = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2158 v19 = pMapStats->GetMapInfo(pCurrentMapName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2159
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2160 //v15 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2161 for (uint i = 0; i < uNumActors; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2162 //if ( (signed int)uNumActors > 0 )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2163 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2164 //Actor* pActor = &pActors[i];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2165 //v2 = (char *)&pActors[0].uNPC_ID;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2166 //do
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2167 //{
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2168 //v3 = pActors[i].pMonsterInfo.uID;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2169 v17 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2170 if (pActors[i].pMonsterInfo.uID >= 115 && pActors[i].pMonsterInfo.uID <= 186
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2171 || pActors[i].pMonsterInfo.uID >= 232 && pActors[i].pMonsterInfo.uID <= 249)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2172 v17 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2173 //v1 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2174 v4 = (pActors[i].pMonsterInfo.uID - 1) % 3;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2175 if (2 == v4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2176 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2177 if (pActors[i].sNPC_ID && pActors[i].sNPC_ID < 5000)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2178 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2179 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2180 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2181 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2182 if (v4 != 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2183 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2184 if (v4 == 0 && pActors[i].sNPC_ID == 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2185 pActors[i].sNPC_ID = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2186 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2187 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2188 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2189 if (pActors[i].sNPC_ID > 0 && pActors[i].sNPC_ID < 5000)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2190 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2191 if (v17)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2192 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2193 pNPCStats->InitializeAdditionalNPCs(&pNPCStats->pAdditionalNPC[pNPCStats->uNewlNPCBufPos], pActors[i].pMonsterInfo.uID, 0, v19);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2194 v14 = LOWORD(pNPCStats->uNewlNPCBufPos) + 5000;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2195 ++pNPCStats->uNewlNPCBufPos;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2196 pActors[i].sNPC_ID = v14;
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2199 pActors[i].sNPC_ID = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2200 //++v15;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2201 //v2 += 836;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2202 //}
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2203 //while ( v15 < (signed int)uNumActors );
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2206 pGameLoadingUI_ProgressBar->Progress();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2207
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2208 //v5 = uNumActors;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2209 v6 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2210 v20 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2211 //v16 = v1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2212
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2213 for (uint i = 0; i < uNumActors; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2214 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2215 //v7 = (char *)&pActors[0].pMonsterInfo;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2216 //do
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2217 //{
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2218 for (v8 = 0; v8 < v6; ++v8)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2219 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2220 if (v21[v8] == pActors[i].pMonsterInfo.uID - 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2221 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2222 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2223
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2224 if (v8 == v6)
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 v21[v6++] = pActors[i].pMonsterInfo.uID - 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2227 v20 = v6;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2228 if (v6 == 16)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2229 break;
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 //++v16;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2232 //v7 += 836;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2233 //}
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2234 //while ( v16 < (signed int)v5 );
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2235 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2236
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2237 pGameLoadingUI_ProgressBar->Progress();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2238
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2239 for (int _v0 = 0; _v0 < v6; ++_v0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2240 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2241 for (v18 = 4; v18; --v18)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2242 pSoundList->LoadSound(pMonsterList->pMonsters[v21[_v0]].pSoundSampleIDs[4 - v18], 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2243 v12 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2244 do
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2245 v13 = pSoundList->LoadSound(v12++ + word_4EE088_sound_ids[pMonsterStats->pInfos[v21[_v0] + 1].uSpell1ID], 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2246 while (v13);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2247 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2248 //v0 = pGameLoadingUI_ProgressBar;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2249 //v1 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2250
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2251 pGameLoadingUI_ProgressBar->Progress();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2252
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2253 if (dword_6BE368_debug_settings_2 & DEBUG_SETTINGS_NO_ACTORS)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2254 uNumActors = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2255 if (dword_6BE368_debug_settings_2 & DEBUG_SETTINGS_NO_DECORATIONS)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2256 uNumLevelDecorations = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2257 init_event_triggers();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2258
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2259 pGameLoadingUI_ProgressBar->Progress();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2260
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
2261 pIndoorCameraD3D->vPartyPos.x = 0;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
2262 pIndoorCameraD3D->vPartyPos.y = 0;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
2263 pIndoorCameraD3D->vPartyPos.z = 100;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
2264 pIndoorCameraD3D->sRotationX = 0;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
2265 pIndoorCameraD3D->sRotationY = 0;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2266 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2267 uLevel_StartingPointType = MapStartPoint_Party;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2268 pSprites_LOD->_461397();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2269 pPaletteManager->LockTestAll();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2270 if (pParty->pPickedItem.uItemID != 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2271 pMouse->SetCursorBitmapFromItemID(pParty->pPickedItem.uItemID);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2272 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2273
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2274 //----- (0042F3D6) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2275 void InitializeTurnBasedAnimations(void *_this)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2276 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2277 for (unsigned int i = 0; i < pIconIDs_Turn.size(); ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2278 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2279 char icon_name[32];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2280 sprintf(icon_name, "turn%u", i);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2281 pIconIDs_Turn[i] = pIconsFrameTable->FindIcon(icon_name);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2282 pIconsFrameTable->InitializeAnimation(pIconIDs_Turn[i]);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2283 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2284
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2285 uIconID_TurnStop = pIconsFrameTable->FindIcon("turnstop");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2286 uIconID_TurnHour = pIconsFrameTable->FindIcon("turnhour");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2287 uIconID_TurnStart = pIconsFrameTable->FindIcon("turnstart");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2288 uIconID_CharacterFrame = pIconsFrameTable->FindIcon("aframe1");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2289 uSpriteID_Spell11 = pSpriteFrameTable->FastFindSprite("spell11");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2290
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2291 pIconsFrameTable->InitializeAnimation(uIconID_TurnHour);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2292 pIconsFrameTable->InitializeAnimation(uIconID_TurnStop);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2293 pIconsFrameTable->InitializeAnimation(uIconID_TurnStart);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2294 pIconsFrameTable->InitializeAnimation(uIconID_CharacterFrame);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2295 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2296
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2297 //----- (0046BDA8) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2298 unsigned int GetGravityStrength()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2299 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2300 int v0; // eax@1
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 v0 = ~LOBYTE(pEngine->uFlags2) & 8;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2303 LOBYTE(v0) = v0 | 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2304 return (unsigned int)v0 >> 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2305 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2306
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2307 //----- (00448B45) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2308 void GameUI_StatusBar_UpdateTimedString(unsigned int bForceHide)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2309 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2310 if (bForceHide || GameUI_Footer_TimeLeft && GetTickCount() >= GameUI_Footer_TimeLeft)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2311 GameUI_Footer_TimeLeft = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2312 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2313
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2314 //----- (0044861E) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2315 void __fastcall sub_44861E_set_texture(unsigned int uFaceCog, const char *pFilename)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2316 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2317 unsigned int texture; // eax@2
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2318
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2319 if (uFaceCog)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2320 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2321 texture = pBitmaps_LOD->LoadTexture(pFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2322 if (texture != -1 ? (int)&pBitmaps_LOD->pTextures[texture] : 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2323 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2324 pBitmaps_LOD->pTextures[texture].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[texture].palette_id1);
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 if (uCurrentlyLoadedLevelType == 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2327 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2328 if ((signed int)pIndoor->uNumFaceExtras > 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2329 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2330 for (uint i = 1; i < (signed int)pIndoor->uNumFaceExtras; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2331 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2332 if (pIndoor->pFaceExtras[i].sCogNumber == uFaceCog)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2333 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2334 if (pIndoor->pFaces[pIndoor->pFaceExtras[i].field_C].uAttributes & FACE_TEXTURE_FRAME)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2335 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2336 pIndoor->pFaces[pIndoor->pFaceExtras[i].field_C].uBitmapID = pTextureFrameTable->FindTextureByName(pFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2337 if (pIndoor->pFaces[pIndoor->pFaceExtras[i].field_C].uBitmapID)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2338 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2339 pTextureFrameTable->LoadAnimationSequenceAndPalettes(pIndoor->pFaces[pIndoor->pFaceExtras[i].field_C].uBitmapID);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2340 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2341 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2342 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2343 pIndoor->pFaces[pIndoor->pFaceExtras[i].field_C].uBitmapID = texture;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2344 pIndoor->pFaces[pIndoor->pFaceExtras[i].field_C].uAttributes &= 0xFFFFBFFF;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2345 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2346 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2347 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2348 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2349 pIndoor->pFaces[pIndoor->pFaceExtras[i].field_C].uBitmapID = texture;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2350 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2351 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2352 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2353 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2354 pParty->uFlags |= 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2355 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2356 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2357 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2358 for (uint j = 0; j < (unsigned int)pOutdoor->uNumBModels; ++j)
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 for (uint i = 0; i < pOutdoor->pBModels[j].uNumFaces; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2361 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2362 if (pOutdoor->pBModels[j].pFaces[i].sCogNumber == uFaceCog)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2363 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2364 if (pOutdoor->pBModels[j].pFaces[i].uAttributes & FACE_TEXTURE_FRAME)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2365 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2366 pOutdoor->pBModels[j].pFaces[i].uTextureID = pTextureFrameTable->FindTextureByName(pFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2367 if (pOutdoor->pBModels[j].pFaces[i].uTextureID)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2368 pTextureFrameTable->LoadAnimationSequenceAndPalettes(pOutdoor->pBModels[j].pFaces[i].uTextureID);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2369 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2370 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2371 pOutdoor->pBModels[j].pFaces[i].uTextureID = texture;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2372 pOutdoor->pBModels[j].pFaces[i].uAttributes &= 0xFFFFBFFF;
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2375 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2376 pOutdoor->pBModels[j].pFaces[i].uTextureID = texture;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2377 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2378 }
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 pParty->uFlags |= 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2382 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2383 }
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2386 //----- (0044892E) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2387 void __fastcall sub_44892E_set_faces_bit(int sCogNumber, int bit, int on)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2388 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2389 if (sCogNumber)
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 if (uCurrentlyLoadedLevelType == 1)
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 for (uint i = 1; i < (unsigned int)pIndoor->uNumFaceExtras; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2394 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2395 if (pIndoor->pFaceExtras[i].sCogNumber == sCogNumber)
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 if (on)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2398 pIndoor->pFaces[pIndoor->pFaceExtras[i].field_C].uAttributes |= bit;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2399 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2400 pIndoor->pFaces[pIndoor->pFaceExtras[i].field_C].uAttributes &= ~bit;
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2403 pParty->uFlags |= 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2404 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2405 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2406 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2407 for (uint j = 0; j < (unsigned int)pOutdoor->uNumBModels; ++j)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2408 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2409 for (uint i = 0; i < (unsigned int)pOutdoor->pBModels[j].uNumFaces; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2410 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2411 if (pOutdoor->pBModels[j].pFaces[i].sCogNumber == sCogNumber)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2412 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2413 if (on)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2414 pOutdoor->pBModels[j].pFaces[i].uAttributes |= bit;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2415 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2416 pOutdoor->pBModels[j].pFaces[i].uAttributes &= ~bit;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2417 }
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2420 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2421 pParty->uFlags |= 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2422 }
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2425 //----- (0044882F) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2426 void __fastcall SetDecorationSprite(uint16_t uCog, bool bHide, const char *pFileName)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2427 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2428 for (size_t i = 0; i < uNumLevelDecorations; i++)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2429 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2430 if (pLevelDecorations[i].uCog == uCog)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2431 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2432 if (pFileName && strcmp(pFileName, "0"))
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 pLevelDecorations[i].uDecorationDescID = pDecorationList->GetDecorIdByName(pFileName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2435 pDecorationList->InitializeDecorationSprite(pLevelDecorations[i].uDecorationDescID);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2436 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2437
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2438 if (bHide)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2439 pLevelDecorations[i].uFlags &= ~LEVEL_DECORATION_INVISIBLE;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2440 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2441 pLevelDecorations[i].uFlags |= LEVEL_DECORATION_INVISIBLE;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2442
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2443 pParty->uFlags |= 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2444 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2445 }
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 //----- (004356FF) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2449 void back_to_game()
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 dword_507BF0_is_there_popup_onscreen = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2452 dword_4E455C = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2453
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2454 extern int no_rightlick_in_inventory;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2455 no_rightlick_in_inventory = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2456
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2457 if (pGUIWindow_ScrollWindow)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2458 free_book_subwindow();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2459 if (!current_screen_type && !pGUIWindow_Settings)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2460 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2461 viewparams->bRedrawGameUI = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2462 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2463
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2464 //----- (00494035) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2465 void _494035_timed_effects__water_walking_damage__etc()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2466 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2467 signed __int64 v0; // qax@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2468 unsigned int v4; // edi@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2469 // signed int v12; // edi@29
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2470 int v24; // ecx@60
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2471 int v26; // ecx@64
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2472 int v28; // ecx@68
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2473 int v30; // ecx@72
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2474 int v32; // ecx@76
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2475 int v34; // ecx@80
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2476 int v36; // ecx@84
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2477 int v38; // ecx@88
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2478 int v40; // ecx@92
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2479 int v42; // ecx@96
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2480 bool v43; // ebx@102
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2481 bool v46; // edi@111
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2482 // unsigned int v56; // [sp-8h] [bp-38h]@55
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2483 // int v59; // [sp-4h] [bp-34h]@55
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2484 // unsigned int v61; // [sp+14h] [bp-1Ch]@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2485 signed int a2a; // [sp+18h] [bp-18h]@47
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2486 signed int old_day; // [sp+1Ch] [bp-14h]@47
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2487 signed int old_hour;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2488
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2489 old_day = pParty->uDaysPlayed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2490 old_hour = pParty->uCurrentHour;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2491 //auto prev_time = pEventTimer->uTimeElapsed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2492 pParty->uTimePlayed += pEventTimer->uTimeElapsed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2493 v0 = ((signed __int64)(pParty->uTimePlayed * 0.234375) / 60) / 60i64;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2494 v4 = (unsigned int)(((unsigned int)v0 / 24) / 7) >> 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2495 pParty->uCurrentTimeSecond = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) % 60;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2496 pParty->uCurrentMinute = ((signed __int64)(pParty->uTimePlayed * 0.234375) / 60) % 60;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2497 pParty->uCurrentHour = v0 % 24;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2498 pParty->uCurrentMonthWeek = ((unsigned int)v0 / 24) / 7 & 3;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2499 pParty->uDaysPlayed = (unsigned int)((unsigned int)v0 / 24) % 28;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2500 pParty->uCurrentMonth = v4 % 12;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2501 pParty->uCurrentYear = v4 / 0xC + game_starting_year;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2502 if (pParty->uCurrentHour >= 3 && (old_hour < 3 || pParty->uDaysPlayed > old_day)) // new day dawns
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2503 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2504 pParty->pHirelings[0].bHasUsedTheAbility = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2505 pParty->pHirelings[1].bHasUsedTheAbility = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2506
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2507 for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2508 pNPCStats->pNewNPCData[i].bHasUsedTheAbility = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2509
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2510 ++pParty->days_played_without_rest;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2511 if (pParty->days_played_without_rest > 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2512 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2513 for (uint i = 0; i < 4; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2514 pParty->pPlayers[i].SetCondWeakWithBlockCheck(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2515
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2516 if (pParty->uNumFoodRations)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2517 Party::TakeFood(1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2518 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2519 for (uint i = 0; i < 4; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2520 pParty->pPlayers[i].sHealth = pParty->pPlayers[i].sHealth / (pParty->days_played_without_rest + 1) + 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2521
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2522 if (pParty->days_played_without_rest > 3)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2523 for (uint i = 0; i < 4; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2524 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2525 pParty->pPlayers[i].Zero();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2526 if (!pParty->pPlayers[i].IsPertified() && !pParty->pPlayers[i].IsEradicated()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2527 && !pParty->pPlayers[i].IsDead())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2528 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2529 if (rand() % 100 < 5 * pParty->days_played_without_rest)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2530 pParty->pPlayers[i].SetCondDeadWithBlockCheck(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2531 if (rand() % 100 < 10 * pParty->days_played_without_rest)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2532 pParty->pPlayers[i].SetCondInsaneWithBlockCheck(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2533 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2534 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2535 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2536 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2537 pOutdoor->SetFog();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2538
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2539 for (uint i = 0; i < 4; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2540 pParty->pPlayers[i].uNumDivineInterventionCastsThisDay = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2541 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2542
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2543 if (pParty->uFlags & 4 && pParty->field_6FC < (signed __int64)pParty->uTimePlayed)//water damage
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2544 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2545 pParty->field_6FC = (signed __int64)pParty->uTimePlayed + 128;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2546 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2547 for (uint pl = 1; pl <= 4; ++pl)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2548 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2549 if (pPlayers[pl]->WearsItem(ITEM_RELIC_HARECS_LEATHER, EQUIP_ARMOUR)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2550 || pPlayers[pl]->HasEnchantedItemEquipped(71)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2551 || pPlayers[pl]->pPlayerBuffs[PLAYER_BUFF_WATER_WALK].uExpireTime > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2552 pPlayers[pl]->PlayEmotion(CHARACTER_EXPRESSION_37, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2553 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2554 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2555 if (!pPlayers[pl]->HasUnderwaterSuitEquipped())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2556 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2557 pPlayers[pl]->ReceiveDamage((signed __int64)pPlayers[pl]->GetMaxHealth() * 0.1, DMGT_FIRE);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2558 if (pParty->uFlags & 4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2559 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2560 strcpy(GameUI_Footer_TimedString.data(), pGlobalTXT_LocalizationStrings[660]);// Âû òîíåòå!
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2561 GameUI_Footer_TimeLeft = 128;
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2564 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2565 pPlayers[pl]->PlayEmotion(CHARACTER_EXPRESSION_37, 0);
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2568 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2569 if (pParty->uFlags & 0x200 && pParty->field_6FC < (signed __int64)pParty->uTimePlayed) //lava damage
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2570 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2571 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2572 pParty->field_6FC = (signed __int64)pParty->uTimePlayed + 128;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2573
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2574 for (uint pl = 1; pl <= 4; pl++)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2575 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2576 pPlayers[pl]->ReceiveDamage((signed __int64)pPlayers[pl]->GetMaxHealth() * 0.1, DMGT_FIRE);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2577 if (pParty->uFlags & 0x200)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2578 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2579 strcpy(GameUI_Footer_TimedString.data(), pGlobalTXT_LocalizationStrings[661]); //Âû ãîðèòå!
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2580 GameUI_Footer_TimeLeft = 128;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2581 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2582 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2583 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2584 _493938_regenerate();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2585 uint party_condition_flag = 4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2586 a2a = pEventTimer->uTimeElapsed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2587 if (pParty->uFlags2 & PARTY_FLAGS_2_RUNNING)//çàìåäëåíèå âîññòàíîâëåíèÿ ïðè áåãå
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2588 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2589 a2a *= 0.5f;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2590 if (a2a < 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2591 a2a = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2592 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2593
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2594 for (uint pl = 1; pl <= 4; pl++)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2595 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2596 if (pPlayers[pl]->uTimeToRecovery)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2597 pPlayers[pl]->Recover(a2a);//âîññòàíîâëåíèå àêòèâíîñòè
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2598 if (pPlayers[pl]->GetItemsBonus(CHARACTER_ATTRIBUTE_ENDURANCE) + pPlayers[pl]->sHealth + pPlayers[pl]->uEndurance >= 1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2599 || (signed __int64)pPlayers[pl]->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2600 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2601 if (pPlayers[pl]->sHealth < 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2602 pPlayers[pl]->SetCondition(Condition_Unconcious, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2603 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2604 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2605 pPlayers[pl]->SetCondition(Condition_Dead, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2606 if (pPlayers[pl]->field_E0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2607 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2608 v24 = pPlayers[pl]->field_E0 - pEventTimer->uTimeElapsed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2609 if (v24 > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2610 pPlayers[pl]->field_E0 = v24;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2611 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2612 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2613 pPlayers[pl]->field_E0 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2614 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2615 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2616 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2617 if (pPlayers[pl]->field_E4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2618 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2619 v26 = pPlayers[pl]->field_E4 - pEventTimer->uTimeElapsed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2620 if (v26 > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2621 pPlayers[pl]->field_E4 = v26;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2622 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2623 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2624 pPlayers[pl]->field_E4 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2625 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2626 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2627 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2628 if (pPlayers[pl]->field_E8)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2629 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2630 v28 = pPlayers[pl]->field_E8 - pEventTimer->uTimeElapsed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2631 if (v28 > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2632 pPlayers[pl]->field_E8 = v28;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2633 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2634 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2635 pPlayers[pl]->field_E8 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2636 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2637 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2638 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2639 if (pPlayers[pl]->field_EC)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2640 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2641 v30 = pPlayers[pl]->field_EC - pEventTimer->uTimeElapsed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2642 if (v30 > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2643 pPlayers[pl]->field_EC = v30;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2644 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2645 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2646 pPlayers[pl]->field_EC = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2647 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2648 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2649 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2650 if (pPlayers[pl]->field_F0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2651 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2652 v32 = pPlayers[pl]->field_F0 - pEventTimer->uTimeElapsed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2653 if (v32 > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2654 pPlayers[pl]->field_F0 = v32;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2655 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2656 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2657 pPlayers[pl]->field_F0 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2658 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2659 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2660 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2661 if (pPlayers[pl]->field_F4)
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 v34 = pPlayers[pl]->field_F4 - pEventTimer->uTimeElapsed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2664 if (v34 > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2665 pPlayers[pl]->field_F4 = v34;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2666 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2667 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2668 pPlayers[pl]->field_F4 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2669 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2670 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2671 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2672 if (pPlayers[pl]->field_F8)
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 v36 = pPlayers[pl]->field_F8 - pEventTimer->uTimeElapsed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2675 if (v36 > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2676 pPlayers[pl]->field_F8 = v36;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2677 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2678 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2679 pPlayers[pl]->field_F8 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2680 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2681 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2682 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2683 if (pPlayers[pl]->field_FC)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2684 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2685 v38 = pPlayers[pl]->field_FC - pEventTimer->uTimeElapsed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2686 if (v38 > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2687 pPlayers[pl]->field_FC = v38;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2688 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2689 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2690 pPlayers[pl]->field_FC = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2691 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2692 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2693 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2694 if (pPlayers[pl]->field_100)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2695 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2696 v40 = pPlayers[pl]->field_100 - pEventTimer->uTimeElapsed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2697 if (v40 > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2698 pPlayers[pl]->field_100 = v40;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2699 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2700 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2701 pPlayers[pl]->field_100 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2702 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2703 }
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 if (pPlayers[pl]->field_104)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2706 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2707 v42 = pPlayers[pl]->field_104 - pEventTimer->uTimeElapsed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2708 if (v42 > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2709 pPlayers[pl]->field_104 = v42;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2710 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2711 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2712 pPlayers[pl]->field_104 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2713 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2714 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2715 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2716 if (pPlayers[pl]->pConditions[Condition_Sleep] | pPlayers[pl]->pConditions[Condition_Paralyzed]
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2717 | pPlayers[pl]->pConditions[Condition_Unconcious] | pPlayers[pl]->pConditions[Condition_Dead]
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2718 | pPlayers[pl]->pConditions[Condition_Pertified] | pPlayers[pl]->pConditions[Condition_Eradicated])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2719 --party_condition_flag;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2720 v43 = (signed __int64)pPlayers[pl]->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime > 0; //ñïåøêà
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2721
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2722 for (uint k = 0; k < 24; ++k)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2723 pPlayers[pl]->pPlayerBuffs[k].IsBuffExpiredToTime(pParty->uTimePlayed);
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 if (v43 && (signed __int64)pPlayers[pl]->pPlayerBuffs[7].uExpireTime <= 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2726 pPlayers[pl]->SetCondition(Condition_Weak, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2727 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2728
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2729 v46 = (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_HASTE].uExpireTime > 0;
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 for (uint i = 0; i < 20; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2732 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2733 if (pParty->pPartyBuffs[i].IsBuffExpiredToTime(pParty->uTimePlayed) == 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2734 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2735 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2736
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2737 if (v46 && (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_HASTE].uExpireTime <= 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2738 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2739 for (uint i = 0; i < 4; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2740 pParty->pPlayers[i].SetCondition(1, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2741 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2742
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2743 for (uint i = 0; i < 2; ++i)//Ïðîâåðêà â ñîçíàíèè ëè ïåðñ ñäåëàâøèé çàêë íà ïîë¸ò è õîæäåíèå ïî âîäå
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2744 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2745 SpellBuff* pBuf = &pParty->pPartyBuffs[Party_Spec_Motion_status_ids[i]];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2746 if (pBuf->uExpireTime == 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2747 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2748
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2749 if (!(pBuf->uFlags & 1))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2750 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2751 if (!pPlayers[pBuf->uCaster]->CanAct())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2752 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2753 pBuf->Reset();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2754 if (Party_Spec_Motion_status_ids[i] == PARTY_BUFF_FLY)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2755 pParty->bFlying = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2756 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2757 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2758 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2759
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2760 if (!party_condition_flag)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2761 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2762 if (current_screen_type != SCREEN_REST)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2763 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2764 for (uint pl = 1; pl <= 4; pl++)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2765 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2766 if (pPlayers[pl]->pConditions[Condition_Sleep])
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 pPlayers[pl]->pConditions[Condition_Sleep] = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2769 party_condition_flag = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2770 break;
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2773 if (!party_condition_flag || _5C35C0_force_party_death)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2774 uGameState = GAME_STATE_PARTY_DIED;
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2777
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2778 if (uActiveCharacter)//âûáîð ñëåäóþùåãî ïîñëå ïðîïóñêàþùåãî õîä
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2779 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2780 if (current_screen_type != SCREEN_REST)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2781 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2782 if (pPlayers[uActiveCharacter]->pConditions[Condition_Sleep]
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2783 || pPlayers[uActiveCharacter]->pConditions[Condition_Paralyzed]
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2784 || pPlayers[uActiveCharacter]->pConditions[Condition_Unconcious]
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2785 || pPlayers[uActiveCharacter]->pConditions[Condition_Dead]
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2786 || pPlayers[uActiveCharacter]->pConditions[Condition_Pertified]
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2787 || pPlayers[uActiveCharacter]->pConditions[Condition_Eradicated])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2788 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2789 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2790 uActiveCharacter = pParty->GetNextActiveCharacter();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2791 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2792 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2793 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2794 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2795
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2796 //----- (00493938) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2797 void _493938_regenerate()
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 int current_time; // edi@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2800 int last_reg_time; // qax@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2801 int v4; // eax@2
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2802 int v5; // edi@5
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2803 long long *v6; // ecx@5
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2804 char v7; // sf@5
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2805 int *v8; // ecx@10
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2806 int v9; // edi@15
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2807 signed int v10; // eax@15
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2808 // __int16 *v11; // edx@16
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2809 // int v12; // eax@20
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2810 int numberOfActorsAffected; // ebx@20
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2811 unsigned int v14; // esi@21
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2812 //unsigned int v15; // ecx@21
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2813 //unsigned int v16; // eax@21
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2814 // int v18; // eax@21
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2815 signed int v19; // eax@21
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2816 bool recovery_HP; // ebx@25
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2817 // ITEM_EQUIP_TYPE v22; // edi@30
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2818 signed int v25; // eax@33
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2819 // int v26; // eax@35
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2820 // int v27; // eax@36
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2821 // int v28; // eax@37
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2822 signed int v31; // ecx@53
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2823 int actorsAffectedByImmolation[100]; // [sp+4h] [bp-22Ch]@20
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2824 SpriteObject a1; // [sp+194h] [bp-9Ch]@15
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2825 Vec3_int_ a3; // [sp+204h] [bp-2Ch]@15
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2826 bool has_dragon_flag; // [sp+210h] [bp-20h]@22
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2827 bool lich_jar_flag; // [sp+214h] [bp-1Ch]@25
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2828 bool zombie_flag; // [sp+218h] [bp-18h]@25
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2829 bool decrease_HP; // [sp+21Ch] [bp-14h]@25
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2830 bool lich_flag; // [sp+220h] [bp-10h]@25
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2831 int v49; // [sp+224h] [bp-Ch]@24
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2832 bool recovery_SP; // [sp+228h] [bp-8h]@25
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2833 bool redraw_flag; // [sp+22Ch] [bp-4h]@2
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2834
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2835 current_time = (signed int)(signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2836 last_reg_time = (signed int)(signed __int64)((double)pParty->uLastRegenerationTime * 0.234375) / 60;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2837 if (current_time >= (signed int)last_reg_time + 5)
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 redraw_flag = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2840 v4 = (current_time - last_reg_time) / 5;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2841 if (pParty->FlyActive())
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 if (pParty->bFlying)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2844 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2845 if (!(pParty->pPartyBuffs[PARTY_BUFF_FLY].uFlags & 1))
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 v5 = v4 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uPower;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2848 //cursed_flag = pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster - 1].pConditions[Condition_Cursed];//cursed
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2849 //v7 = cursed_flag < v5;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2850 //cursed_flag -= v5;
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 v6 = &pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster - 1].pConditions[Condition_Cursed];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2853
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2854 if (*v6 < v5)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2855 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2856 v6 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2857 pParty->uFlags &= 0xFFFFFFBFu;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2858 pParty->bFlying = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2859 redraw_flag = true;
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 }
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2864
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2865 if (pParty->WaterWalkActive())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2866 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2867 if (pParty->uFlags & PARTY_FLAGS_1_STANDING_ON_WATER)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2868 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2869 if (!(pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uFlags & 1))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2870 { // taking on water
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2871 v8 = (int *)&pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uCaster - 1].pConditions[Condition_Cursed];//&AA1058_PartyQuickSpellSound[4].pSounds[6972 * pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uCaster + 2000];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2872 v7 = *v8 < v4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2873 *v8 -= v4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2874 if (v7)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2875 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2876 *v8 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2877 pParty->uFlags &= ~PARTY_FLAGS_1_STANDING_ON_WATER;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2878 redraw_flag = true;
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2881 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2882 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2883
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2884 if (pParty->ImmolationActive())//Æåðòâà
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2885 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2886 a3.z = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2887 a3.y = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2888 a3.x = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2889 a1.stru_24.Reset();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2890 a1.spell_level = pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION].uPower;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2891 a1.spell_skill = pParty->ImmolationSkillLevel();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2892 v10 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2893 a1.uType = 1070;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2894 a1.spell_id = SPELL_FIRE_IMMOLATION;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2895 v10 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2896 for (uint i = 0; i > pObjectList->uNumObjects; i++)
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 if (pObjectList->pObjects[i].uObjectID == stru_4E3ACC[8].uType)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2899 v10 = i;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2900 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2901 a1.uObjectDescID = v10;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2902 a1.field_60_distance_related_prolly_lod = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2903 a1.uAttributes = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2904 a1.uSectorID = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2905 a1.uSpriteFrameID = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2906 a1.spell_caster_pid = PID(OBJECT_Player, pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION].uCaster);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2907 a1.uFacing = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2908 a1.uSoundID = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2909 numberOfActorsAffected = pParty->_46A89E_immolation_effect(actorsAffectedByImmolation, 100, 307);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2910 for (v9 = 0; v9 < numberOfActorsAffected; ++v9)
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 v14 = actorsAffectedByImmolation[v9];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2913 a1.vPosition.x = pActors[v14].vPosition.x;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2914 a1.vPosition.y = pActors[v14].vPosition.y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2915 a1.vPosition.z = pActors[v14].vPosition.z;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2916 a1.spell_target_pid = PID(OBJECT_Actor, v14);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2917 v19 = a1.Create(0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2918 Actor::DamageMonsterFromParty(PID(OBJECT_Item, v19), v14, &a3);
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2921
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2922 has_dragon_flag = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2923 if (PartyHasDragon())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2924 has_dragon_flag = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2925
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2926 for (v49 = 0; v49 < 4; v49++)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2927 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2928 recovery_HP = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2929 recovery_SP = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2930 decrease_HP = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2931 lich_flag = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2932 lich_jar_flag = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2933 zombie_flag = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2934
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2935 for (int v22 = 0; (signed int)v22 < 16; v22++)
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 if (pParty->pPlayers[v49].HasItemEquipped((ITEM_EQUIP_TYPE)v22))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2938 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2939 uint _idx = pParty->pPlayers[v49].pEquipment.pIndices[v22];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2940 if (pParty->pPlayers[v49].pInventoryItemList[_idx - 1].uItemID > 134)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2941 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2942 if (pParty->pPlayers[v49].pInventoryItemList[_idx - 1].uItemID == ITEM_RELIC_ETHRICS_STAFF)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2943 decrease_HP = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2944 if (pParty->pPlayers[v49].pInventoryItemList[_idx - 1].uItemID == ITEM_ARTIFACT_HERMES_SANDALS)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2945 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2946 recovery_HP = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2947 recovery_SP = true;
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 (pParty->pPlayers[v49].pInventoryItemList[_idx - 1].uItemID == ITEM_ARTIFACT_MINDS_EYE)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2950 recovery_SP = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2951 if (pParty->pPlayers[v49].pInventoryItemList[_idx - 1].uItemID == ITEM_ARTIFACT_HEROS_BELT)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2952 recovery_HP = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2953 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2954 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2955 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2956 v25 = pParty->pPlayers[v49].pInventoryItemList[_idx - 1].uSpecEnchantmentType;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2957 if (v25 == 37 //of Regeneration("Regenerate 1hp/x while walking, etc")
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2958 || v25 == 44 //of Life("HP (+10), Regen hpts")
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2959 || v25 == 50 //of The Phoenix("Fire Res (+30), Regen hpts") &&
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2960 || v25 == 54)// of The Troll("End (+15), Regen hpts")
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2961 recovery_HP = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2962 if (v25 == 38 //of Mana("Regenerate 1sp/x while walking, etc")
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2963 || v25 == 47 //of The Eclipse("SP (+10), Regen spts")
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2964 || v25 == 55)//of The Unicorn("Luck (+15), Regen spts")
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2965 recovery_SP = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2966 if (v25 == 66)// of Plenty("Regenerate 1 hp/x and 1 sp/x while walking, etc.")
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2967 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2968 recovery_HP = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2969 recovery_SP = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2970 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2971 }
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 if (recovery_HP &&
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2974 !pParty->pPlayers[v49].pConditions[Condition_Dead] &&
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2975 !pParty->pPlayers[v49].pConditions[Condition_Eradicated])
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 if (pParty->pPlayers[v49].sHealth < pParty->pPlayers[v49].GetMaxHealth())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2978 ++pParty->pPlayers[v49].sHealth;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2979 if (pParty->pPlayers[v49].pConditions[Condition_Unconcious] && pParty->pPlayers[v49].sHealth > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2980 pParty->pPlayers[v49].pConditions[Condition_Unconcious] = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2981 redraw_flag = true;
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2984 if (recovery_SP &&
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2985 !pParty->pPlayers[v49].pConditions[Condition_Dead] &&
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2986 !pParty->pPlayers[v49].pConditions[Condition_Eradicated])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2987 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2988 if (pParty->pPlayers[v49].sMana < pParty->pPlayers[v49].GetMaxMana())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2989 ++pParty->pPlayers[v49].sMana;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2990 redraw_flag = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2991 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2992
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2993 if (decrease_HP &&
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2994 !pParty->pPlayers[v49].pConditions[Condition_Dead] &&
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2995 !pParty->pPlayers[v49].pConditions[Condition_Eradicated])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2996 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2997 --pParty->pPlayers[v49].sHealth;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2998 if (!(pParty->pPlayers[v49].pConditions[Condition_Unconcious]) && pParty->pPlayers[v49].sHealth < 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2999 pParty->pPlayers[v49].pConditions[Condition_Unconcious] = pParty->uTimePlayed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3000 if (pParty->pPlayers[v49].sHealth < 1)
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 (pParty->pPlayers[v49].sHealth + pParty->pPlayers[v49].uEndurance + pParty->pPlayers[v49].GetItemsBonus(CHARACTER_ATTRIBUTE_ENDURANCE) >= 1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3003 || (signed __int64)pParty->pPlayers[v49].pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3004 pParty->pPlayers[v49].pConditions[Condition_Unconcious] = pParty->uTimePlayed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3005 else
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 if (!pParty->pPlayers[v49].pConditions[Condition_Dead])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3008 pParty->pPlayers[v49].pConditions[Condition_Dead] = pParty->uTimePlayed;
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3011 redraw_flag = true;
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 }
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3016 //regeneration
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3017 if (pParty->pPlayers[v49].pPlayerBuffs[PLAYER_BUFF_REGENERATION].uExpireTime > 0
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3018 && !pParty->pPlayers[v49].pConditions[Condition_Dead]
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3019 && !pParty->pPlayers[v49].pConditions[Condition_Eradicated])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3020 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3021 pParty->pPlayers[v49].sHealth += 5 * pParty->pPlayers[v49].pPlayerBuffs[PLAYER_BUFF_REGENERATION].uPower;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3022 if (pParty->pPlayers[v49].sHealth > pParty->pPlayers[v49].GetMaxHealth())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3023 pParty->pPlayers[v49].sHealth = pParty->pPlayers[v49].GetMaxHealth();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3024 if (pParty->pPlayers[v49].pConditions[Condition_Unconcious] && pParty->pPlayers[v49].sHealth > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3025 pParty->pPlayers[v49].pConditions[Condition_Unconcious] = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3026 redraw_flag = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3027 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3028
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3029 //for warlock
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3030 if (has_dragon_flag && pParty->pPlayers[v49].classType == PLAYER_CLASS_WARLOCK)
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 if (pParty->pPlayers[v49].sMana < pParty->pPlayers[v49].GetMaxMana())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3033 ++pParty->pPlayers[v49].sMana;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3034 redraw_flag = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3035 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3036
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3037 //for lich
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3038 if (pParty->pPlayers[v49].classType == PLAYER_CLASS_LICH)
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 for (v31 = 0; v31 < 126; ++v31)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3041 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3042 if (pParty->pPlayers[v49].pInventoryItemList[v31].uItemID == ITEM_LICH_JAR_FULL)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3043 lich_jar_flag = true;
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 lich_flag = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3046 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3047 if (lich_flag && !pParty->pPlayers[v49].pConditions[Condition_Dead]
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3048 && !pParty->pPlayers[v49].pConditions[Condition_Eradicated])
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 (pParty->pPlayers[v49].sHealth > pParty->pPlayers[v49].GetMaxHealth() / 2)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3051 pParty->pPlayers[v49].sHealth = pParty->pPlayers[v49].sHealth - 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3052 if (pParty->pPlayers[v49].sMana > pParty->pPlayers[v49].GetMaxMana() / 2)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3053 pParty->pPlayers[v49].sMana = pParty->pPlayers[v49].sMana - 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3054 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3055 if (lich_jar_flag)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3056 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3057 if (pParty->pPlayers[v49].sMana < pParty->pPlayers[v49].GetMaxMana())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3058 ++pParty->pPlayers[v49].sMana;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3059 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3060
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3061 //for zombie
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3062 if (pParty->pPlayers[v49].pConditions[Condition_Zombie])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3063 zombie_flag = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3064 if (zombie_flag && !pParty->pPlayers[v49].pConditions[Condition_Dead]
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3065 && !pParty->pPlayers[v49].pConditions[Condition_Eradicated])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3066 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3067 if (pParty->pPlayers[v49].sHealth > pParty->pPlayers[v49].GetMaxHealth() / 2)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3068 pParty->pPlayers[v49].sHealth = pParty->pPlayers[v49].sHealth - 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3069 if (pParty->pPlayers[v49].sMana > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3070 pParty->pPlayers[v49].sMana = pParty->pPlayers[v49].sMana - 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3071 }
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 pParty->uLastRegenerationTime = pParty->uTimePlayed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3074 if (!viewparams->bRedrawGameUI)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3075 viewparams->bRedrawGameUI = redraw_flag;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3076 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3077 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3078
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3079 //----- (00491E3A) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3080 void sub_491E3A()
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 signed int v1; // esi@3
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3083 unsigned int v3; // eax@7
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3084 unsigned int v4; // edx@8
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3085 int v6; // edi@17
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3086
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3087 //__debugbreak();//Ritor1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3088 for (uint pl = 0; pl < 4; pl++)
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 if (SoundSetAction[24][0])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3091 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3092 v3 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3093 for (v1 = 0; v1 < (signed int)pSoundList->sNumSounds; ++v1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3094 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3095 int ps = 2 * (SoundSetAction[24][0] + 50 * pParty->pPlayers[pl].uVoiceID) + 4998;//6728
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3096 if (pSoundList->pSL_Sounds[v1].uSoundID == 2 * (SoundSetAction[24][0] + 50 * pParty->pPlayers[pl].uVoiceID) + 4998)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3097 v3 = v1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3098 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3099 pSoundList->UnloadSound(v3, 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3100 for (v4 = 0; (signed int)v4 < (signed int)pSoundList->sNumSounds; ++v4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3101 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3102 if (pSoundList->pSL_Sounds[v4].uSoundID == 2 * (SoundSetAction[24][0] + 50 * pParty->pPlayers[pl].uVoiceID) + 4999)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3103 pSoundList->UnloadSound(v4, 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3104 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3105 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3106 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3107 v6 = pIcons_LOD->uNumLoadedFiles - 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3108 if (v6 >= pIcons_LOD->pFacesLock)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3109 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3110 do
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3111 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3112 pIcons_LOD->pTextures[v6].Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3113 if (pIcons_LOD->pHardwareTextures)
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 if (pIcons_LOD->pHardwareTextures[v6])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3116 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3117 pIcons_LOD->pHardwareTextures[v6]->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3118 pIcons_LOD->pHardwareTextures[v6] = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3119 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3120 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3121 if (pIcons_LOD->pHardwareSurfaces)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3122 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3123 if (pIcons_LOD->pHardwareSurfaces[v6])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3124 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3125 pIcons_LOD->pHardwareSurfaces[v6]->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3126 pIcons_LOD->pHardwareSurfaces[v6] = 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 --v6;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3130 } while (v6 >= pIcons_LOD->pFacesLock);
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 pIcons_LOD->uNumLoadedFiles = pIcons_LOD->pFacesLock;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3133 pIcons_LOD->pFacesLock = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3134 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3135
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3136 //----- (00494820) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3137 unsigned int __fastcall _494820_training_time(unsigned int a1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3138 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3139 signed int v1; // eax@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3140
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3141 v1 = 5;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3142 if (a1 % 24 >= 5)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3143 v1 = 29;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3144 return v1 - a1 % 24;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3145 }
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 //----- (00494836) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3148 int stru339_spell_sound::AddPartySpellSound(int uSoundID, int a6)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3149 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3150 int v3; // esi@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3151 int result; // eax@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3152 //stru339_spell_sound *v5; // ebx@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3153 //int *v6; // edi@2
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3154 unsigned int v7; // eax@3
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3155 int v8; // [sp+Ch] [bp-8h]@3
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3156 int v9; // [sp+10h] [bp-4h]@2
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3157 int a2a; // [sp+1Ch] [bp+8h]@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3158 //return 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3159 v3 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3160 result = word_4EE088_sound_ids[uSoundID];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3161 //v5 = this;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3162 a2a = word_4EE088_sound_ids[uSoundID];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3163 if (word_4EE088_sound_ids[uSoundID])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3164 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3165 //v6 = this->pSoundsOffsets;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3166 for (v9 = 0; v9 < 2; ++v9)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3167 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3168 v7 = a2a++;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3169 result = pSoundList->LoadSound(v7, (char *)this + v3, 44744 - v3, &v8, a6);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3170 if (!result)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3171 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3172 a6 += 4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3173 result = v8 + 256;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3174 this->pSoundsOffsets[v9] = v3;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3175 v3 += result;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3176 this->pSoundsSizes[v9] = v8 + 256;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3177 //++v6;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3178 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3179 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3180 return result;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3181 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3182
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3183 //----- (00443E31) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3184 void LoadLevel_InitializeLevelStr()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3185 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3186
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3187 // char Args[100];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3188 int string_num;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3189 int max_string_length;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3190 // int current_string_length;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3191 int prev_string_offset;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3192
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3193 if (sizeof(pLevelStrOffsets) != 2000)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3194 Log::Warning(L"pLevelStrOffsets: deserialization warning");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3195 memset(pLevelStrOffsets.data(), 0, 2000);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3196
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3197 max_string_length = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3198 string_num = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3199 prev_string_offset = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3200 pLevelStrOffsets[0] = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3201 for (uint i = 0; i < uLevelStrFileSize; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3202 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3203 if (!pLevelStr[i])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3204 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3205 pLevelStrOffsets[string_num] = i + 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3206 ++string_num;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3207 if (i - prev_string_offset > max_string_length)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3208 max_string_length = i - prev_string_offset;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3209 prev_string_offset = i;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3210 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3211 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3212
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3213 uLevelStrNumStrings = string_num - 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3214 if (max_string_length > 800)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3215 Error("MAX_EVENT_TEXT_LENGTH needs to be increased to %lu", max_string_length + 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3216
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3217 if (uLevelStrNumStrings > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3218 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3219 for (uint i = 0; i <uLevelStrNumStrings; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3220 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3221 if (RemoveQuotes(&pLevelStr[pLevelStrOffsets[i]]) != &pLevelStr[pLevelStrOffsets[i]])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3222 ++pLevelStrOffsets[i];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3223 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3224 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3225 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3226
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3227 //----- (00443F95) --------------------------------------------------------
2551
4008b2f34be0 MainMenu rendering moved from event loop to respective window class
a.parshin
parents: 2544
diff changeset
3228 void OnMapLeave()
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3229 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3230 _evt_raw *test_event;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3231 if (uLevelEVT_NumEvents > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3232 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3233 for (uint i = 0; i < uLevelEVT_NumEvents; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3234 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3235 test_event = (_evt_raw*)&pLevelEVT[pLevelEVT_Index[i].uEventOffsetInEVT];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3236 if (test_event->_e_type == EVENT_OnMapLeave)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3237 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3238 EventProcessor(pLevelEVT_Index[i].uEventID, 0, 1, pLevelEVT_Index[i].event_sequence_num);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3239 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3240 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3241 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3242 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3243
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3244 //----- (00443FDC) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3245 void OnMapLoad()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3246 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3247 int v6; // eax@9
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3248 unsigned __int64 v8; // qax@26
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3249 int hours; // ebx@26
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3250 unsigned __int64 v18; // [sp+Ch] [bp-44h]@12
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3251 unsigned int seconds; // [sp+14h] [bp-3Ch]@26
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3252 unsigned __int64 v20; // [sp+1Ch] [bp-34h]@7
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3253 unsigned int minutes; // [sp+2Ch] [bp-24h]@26
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3254 unsigned int years; // [sp+34h] [bp-1Ch]@26
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3255 unsigned int weeks; // [sp+38h] [bp-18h]@26
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3256 int v26; // [sp+3Ch] [bp-14h]@15
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3257 unsigned int days; // [sp+3Ch] [bp-14h]@26
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3258 unsigned int months; // [sp+40h] [bp-10h]@26
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3259
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3260 for (uint i = 0; i < uLevelEVT_NumEvents; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3261 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3262 EventIndex pEvent = pLevelEVT_Index[i];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3263
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3264 _evt_raw* _evt = (_evt_raw *)(&pLevelEVT[pEvent.uEventOffsetInEVT]);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3265
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3266 if (_evt->_e_type == EVENT_PlaySound)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3267 pSoundList->LoadSound(EVT_DWORD(_evt->v5), 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3268 else if (_evt->_e_type == EVENT_OnMapReload)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3269 EventProcessor(pEvent.uEventID, 0, 0, pEvent.event_sequence_num);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3270 else if (_evt->_e_type == EVENT_OnTimer || _evt->_e_type == EVENT_Initialize)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3271 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3272 //v3 = &MapsLongTimersList[MapsLongTimers_count];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3273 v20 = pOutdoor->loc_time.uLastVisitDay;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3274 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3275 v20 = pIndoor->stru1.uLastVisitDay;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3276
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3277 MapsLongTimersList[MapsLongTimers_count].timer_evt_type = _evt->_e_type;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3278 MapsLongTimersList[MapsLongTimers_count].timer_evt_ID = pEvent.uEventID;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3279 MapsLongTimersList[MapsLongTimers_count].timer_evt_seq_num = pEvent.event_sequence_num;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3280
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3281 MapsLongTimersList[MapsLongTimers_count].YearsInterval = _evt->v5;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3282 MapsLongTimersList[MapsLongTimers_count].MonthsInterval = _evt->v6;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3283 MapsLongTimersList[MapsLongTimers_count].WeeksInterval = _evt->v7;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3284 MapsLongTimersList[MapsLongTimers_count].HoursInterval = _evt->v8;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3285 MapsLongTimersList[MapsLongTimers_count].MinutesInterval = _evt->v9;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3286 MapsLongTimersList[MapsLongTimers_count].SecondsInterval = _evt->v10;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3287
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3288
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3289 v6 = ((unsigned short)_evt->v12 << 8) + _evt->v11;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3290
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3291 MapsLongTimersList[MapsLongTimers_count].time_left_to_fire = ((unsigned short)_evt->v12 << 8) + _evt->v11;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3292 MapsLongTimersList[MapsLongTimers_count].IntervalHalfMins = ((unsigned short)_evt->v12 << 8) + _evt->v11;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3293 if (MapsLongTimersList[MapsLongTimers_count].timer_evt_type == EVENT_Initialize && !(short)v6)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3294 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3295 if (v20)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3296 v18 = pParty->uTimePlayed - v20;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3297 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3298 v18 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3299 v26 = (signed int)(signed __int64)((double)(signed __int64)v18 * 0.234375) / 60 / 60 / 24;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3300
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3301 if (v26 / 7 / 4 / 12 != 0 && MapsLongTimersList[MapsLongTimers_count].YearsInterval ||
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3302 v26 / 7 / 4 != 0 && MapsLongTimersList[MapsLongTimers_count].MonthsInterval != 0 ||
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3303 v26 / 7 != 0 && MapsLongTimersList[MapsLongTimers_count].WeeksInterval != 0 ||
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3304 v26 != 0 || !v20)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3305 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3306 ++MapsLongTimers_count;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3307 MapsLongTimersList[MapsLongTimers_count].NextStartTime = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3308 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3309 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3310 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3311 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3312 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3313 v8 = (__int64)((double)pParty->uTimePlayed * 0.234375);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3314 seconds = v8 % 60;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3315 minutes = (v8 / 60) % 60;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3316 hours = ((v8 / 60) / 60) % 24;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3317 days = (((v8 / 60) / 60) / 24) % 7;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3318 weeks = ((((v8 / 60) / 60) / 24) / 7) % 4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3319 months = (((((v8 / 60) / 60) / 24) / 7) / 4) % 12;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3320 years = (((((v8 / 60) / 60) / 24) / 7) / 4) / 12;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3321
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3322 if (MapsLongTimersList[MapsLongTimers_count].YearsInterval)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3323 ++years;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3324 else if (MapsLongTimersList[MapsLongTimers_count].MonthsInterval)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3325 ++months;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3326 else if (MapsLongTimersList[MapsLongTimers_count].WeeksInterval)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3327 ++weeks;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3328 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3329 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3330 ++days;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3331 hours = MapsLongTimersList[MapsLongTimers_count].HoursInterval;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3332 minutes = MapsLongTimersList[MapsLongTimers_count].MinutesInterval;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3333 seconds = MapsLongTimersList[MapsLongTimers_count].SecondsInterval;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3334 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3335 MapsLongTimersList[MapsLongTimers_count].NextStartTime = (signed __int64)((double)((seconds
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3336 + 60 * minutes
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3337 + 3600 * hours
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3338 + 86400 * days
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3339 + 604800 * weeks
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3340 + 2419200 * months
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3341 + 29030400 * years) << 7)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3342 * 0.033333335);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3343
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3344 ++MapsLongTimers_count;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3345 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3346 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3347 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3348 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3349
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3350 //----- (00444360) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3351 void Level_LoadEvtAndStr(const char *pLevelName)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3352 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3353 char pContainerName[120]; // [sp+8h] [bp-98h]@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3354
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3355 sprintf(pContainerName, "%s.evt", pLevelName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3356 uLevelEVT_Size = LoadEventsToBuffer(pContainerName, pLevelEVT.data(), 9216);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3357
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3358 sprintf(pContainerName, "%s.str", pLevelName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3359 uLevelStrFileSize = LoadEventsToBuffer(pContainerName, pLevelStr.data(), 9216);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3360 if (uLevelStrFileSize)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3361 LoadLevel_InitializeLevelStr();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3362 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3363
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3364 //----- (004452BB) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3365 void sub_4452BB()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3366 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3367 pGUIWindow2->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3368 pGUIWindow2 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3369 activeLevelDecoration = _591094_decoration;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3370 EventProcessor(dword_5C3418, 0, 1, dword_5C341C);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3371 activeLevelDecoration = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3372 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3373 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3374
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3375 //----- (0044100D) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3376 bool _44100D_should_alter_right_panel()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3377 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3378 return current_screen_type == SCREEN_NPC_DIALOGUE || current_screen_type == SCREEN_CHARACTERS ||
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3379 current_screen_type == SCREEN_HOUSE || current_screen_type == SCREEN_E ||
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3380 current_screen_type == SCREEN_CHANGE_LOCATION || current_screen_type == SCREEN_INPUT_BLV || current_screen_type == SCREEN_CASTING;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3381 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3382
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3383 //----- (0044987B) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3384 void Transition_StopSound_Autosave(const char *pMapName, MapStartPoint start_point)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3385 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3386 pAudioPlayer->StopChannels(-1, -1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3387 pGameLoadingUI_ProgressBar->Initialize(GUIProgressBar::TYPE_None);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3388 if (_stricmp(pCurrentMapName, pMapName))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3389 SaveGame(1, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3390
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3391 uGameState = GAME_STATE_CHANGE_LOCATION;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3392 strcpy(pCurrentMapName, pMapName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3393 uLevel_StartingPointType = start_point;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3394 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3395
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3396 //----- (004451A8) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3397 void __fastcall sub_4451A8_press_any_key(int a1, int a2, int a4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3398 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3399 if (!pGUIWindow2)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3400 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3401 if (pParty->uFlags & 2)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3402 pEngine->Draw();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3403 pAudioPlayer->StopChannels(-1, -1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3404 pMiscTimer->Pause();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3405 pEventTimer->Pause();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3406 dword_5C3418 = a1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3407 dword_5C341C = a2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3408 _591094_decoration = activeLevelDecoration;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
3409 pGUIWindow2 = new GUIWindow_GenericDialogue(0, 0, window->GetWidth(), window->GetHeight(), a4, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3410 pGUIWindow2->CreateButton(61, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3411 pGUIWindow2->CreateButton(177, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3412 pGUIWindow2->CreateButton(292, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3413 pGUIWindow2->CreateButton(407, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3414 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3415 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3416
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3417
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3418
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3419
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3420 //----- (00448B67) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3421 void OnTimer(int)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3422 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3423 if (pEventTimer->bPaused)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3424 return;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3425
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3426 long long v13 = (signed __int64)(pParty->uTimePlayed - _5773B8_event_timer) / 128;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3427 if (!v13)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3428 return;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3429
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3430 //uint _v2v3 = pParty->uTimePlayed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3431 //v3 = HIDWORD(pParty->uTimePlayed);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3432 //v2 = LODWORD(pParty->uTimePlayed);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3433
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3434 _5773B8_event_timer = pParty->uTimePlayed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3435
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3436 for (uint i = 0; i < MapsLongTimers_count; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3437 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3438 //v4 = (char *)&array_5B5928_timers[0].field_C;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3439 MapsLongTimer* timer = &MapsLongTimersList[i];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3440 //while ( 1 )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3441 //{
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3442 //v5 = *(short *)v4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3443 if (timer->time_left_to_fire)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3444 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3445 if (v13 < timer->time_left_to_fire)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3446 timer->time_left_to_fire -= v13;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3447 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3448 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3449 timer->time_left_to_fire = timer->IntervalHalfMins;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3450 EventProcessor(timer->timer_evt_ID, 0, 1, timer->timer_evt_seq_num);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3451 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3452 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3453 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3454 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3455 if (timer->NextStartTime < pParty->uTimePlayed)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3456 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3457 uint next_trigger_time = 1 * 60 * 60 * 24; // 1 day
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3458 if (timer->YearsInterval)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3459 next_trigger_time = 336 * 60 * 60 * 24; // 1 year
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3460 else if (timer->MonthsInterval)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3461 next_trigger_time = 28 * 60 * 60 * 24; // 1 month
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3462 else if (timer->WeeksInterval)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3463 next_trigger_time = 7 * 60 * 60 * 24; // 1 week
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3464
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3465 timer->NextStartTime += (next_trigger_time * 128) / 3.0f;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3466 if (timer->NextStartTime < pParty->uTimePlayed) // make sure in wont fire several times in a row if big time interval has lapsed
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3467 timer->NextStartTime = pParty->uTimePlayed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3468
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3469 EventProcessor(timer->timer_evt_ID, 0, 1, timer->timer_evt_seq_num);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3470 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3471 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3472 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3473 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3474
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3475
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3476
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3477
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3478
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3479
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3480
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3481 //----- (0044C28F) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3482 bool TeleportToNWCDungeon()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3483 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3484 if (!_stricmp("nwc.blv", pCurrentMapName))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3485 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3486
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3487 _5B65A8_npcdata_uflags_or_other = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3488 _5B65AC_npcdata_fame_or_other = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3489 _5B65B0_npcdata_rep_or_other = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3490 _5B65B4_npcdata_loword_house_or_other = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3491 _5B65B8_npcdata_hiword_house_or_other = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3492 dword_5B65BC = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3493 dword_5B65C0 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3494
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3495 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3496 Transition_StopSound_Autosave("nwc.blv", MapStartPoint_Party);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3497 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3498 return true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3499 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3500
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3501 //----- (00401000) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3502 void mm7__vector_constructor(void *a1, int objSize, int numObjs, int(*constructor)(int))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3503 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3504 void *v4; // esi@2
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3505
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3506 if (numObjs > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3507 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3508 v4 = a1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3509 for (int i = numObjs; i; --i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3510 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3511 constructor((int)v4);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3512 v4 = (char *)v4 + objSize;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3513 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3514 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3515 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3516
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3517
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3518