annotate Engine/Engine.cpp @ 2542:bacf9809126a

.
author a.parshin
date Sun, 10 May 2015 02:04:52 +0200
parents a902abdfc7f2
children b6140dfeac27
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"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
71
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
72 #include <direct.h>
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
73
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
74
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 Engine *pEngine = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
78
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
79
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 //----- (00466C40) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
86 const wchar_t *MENU_STATE_to_string(MENU_STATE m)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
87 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
88 switch (m)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
89 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
90 case -1: return L"-1";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
91 case MENU_MAIN: return L"MENU_MAIN";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
92 case MENU_NEWGAME: return L"MENU_NEWGAME";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
93 case MENU_CREDITS: return L"MENU_CREDITS";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
94 case MENU_SAVELOAD: return L"MENU_SAVELOAD";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
95 case MENU_EXIT_GAME: return L"MENU_EXIT_GAME";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
96 case MENU_5: return L"MENU_5";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
97 case MENU_CREATEPARTY: return L"MENU_CREATEPARTY";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
98 case MENU_NAMEPANELESC: return L"MENU_NAMEPANELESC";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
99 case MENU_CREDITSPROC: return L"MENU_CREDITSPROC";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
100 case MENU_LoadingProcInMainMenu: return L"MENU_LoadingProcInMainMenu";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
101 case MENU_DebugBLVLevel: return L"MENU_DebugBLVLevel";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
102 case MENU_CREDITSCLOSE: return L"MENU_CREDITSCLOSE";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
103 case MENU_MMT_MAIN_MENU: return L"MENU_MMT_MAIN_MENU";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
104 default: return L"unk";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
105 };
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
106 };
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 void SetCurrentMenuID(MENU_STATE uMenu)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
110 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
111 sCurrentMenuID = uMenu;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
112 Log::Warning(L"CurrentMenu = %s \n", MENU_STATE_to_string(uMenu));
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
113 }
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 //----- (00466CA0) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
116 MENU_STATE GetCurrentMenuID()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
117 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
118 return sCurrentMenuID;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
119 }
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 //----- (00464761) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
124 void Engine_DeinitializeAndTerminate(int exitCode)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
125 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
126 SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
127 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
128 pEngine->Deinitialize();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
129 pRenderer->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
130 delete window;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
131 //if ( !DestroyWindow(hWnd) )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
132 // GetLastError();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
133 exit(exitCode);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
134 }
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 //----- (00435694) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
147 void Engine::ToggleFlags2(unsigned int uFlag)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
148 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
149 unsigned int v2; // eax@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
150
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
151 v2 = this->uFlags2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
152 if (v2 & uFlag)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
153 this->uFlags2 = v2 & ~uFlag;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
154 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
155 this->uFlags2 = uFlag | v2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
156 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
157
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
158 //----- (0044103C) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
159 void Engine::Draw()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
160 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
161 int v4; // edi@26
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
162
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
163 uFlags2 &= ~0x02;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
164 if (pParty->_497FC5_check_party_perception_against_level())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
165 uFlags2 |= 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
166
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
167 pEngine->pIndoorCameraD3D->sRotationX = pParty->sRotationX;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
168 pEngine->pIndoorCameraD3D->sRotationY = pParty->sRotationY;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
169 pEngine->pIndoorCameraD3D->vPartyPos.x = pParty->vPosition.x - pParty->y_rotation_granularity * cosf(2 * pi_double * pParty->sRotationY / 2048.0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
170 pEngine->pIndoorCameraD3D->vPartyPos.y = pParty->vPosition.y - pParty->y_rotation_granularity * sinf(2 * pi_double * pParty->sRotationY / 2048.0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
171 pEngine->pIndoorCameraD3D->vPartyPos.z = pParty->vPosition.z + pParty->sEyelevel;//193, but real 353
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
172
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
173 //pIndoorCamera->Initialize2();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
174 pIndoorCameraD3D->CalculateRotations(pParty->sRotationX, pParty->sRotationY);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
175 pIndoorCameraD3D->CreateWorldMatrixAndSomeStuff();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
176 pIndoorCameraD3D->_4374E8_ProllyBuildFrustrum();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
177
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
178 if (pMovie_Track)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
179 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
180 /*if ( !pRenderer->pRenderD3D )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
181 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
182 pRenderer->BeginSceneD3D();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
183 pMouse->DrawCursorToTarget();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
184 pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
185 }*/
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 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
188 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
189 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
190 || 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
191 pParty->uFlags |= 2u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
192 pParty->vPrevPosition.x = pParty->vPosition.x;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
193 pParty->vPrevPosition.y = pParty->vPosition.y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
194 pParty->vPrevPosition.z = pParty->vPosition.z;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
195 //v0 = &pRenderer;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
196 pParty->sPrevRotationY = pParty->sRotationY;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
197 pParty->sPrevRotationX = pParty->sRotationX;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
198
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
199 pParty->sPrevEyelevel = pParty->sEyelevel;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
200 pRenderer->BeginSceneD3D();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
201
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
202 //if ( !pRenderer->pRenderD3D )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
203 //pMouse->DrawCursorToTarget();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
204 if (!PauseGameDrawing() || viewparams->field_48 == 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
205 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
206 //if ( pRenderer->pRenderD3D )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
207 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
208 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
209 //v3 = v2 + 6.7553994e15;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
210 //pRenderer->field_1036A8_bitmapid = LODWORD(v3);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
211 pRenderer->hd_water_current_frame = floorf(v2 + 0.5f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
212 }
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 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
215 pIndoor->Draw();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
216 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
217 pOutdoor->Draw();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
218 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
219 Error("Invalid level type: %u", uCurrentlyLoadedLevelType);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
220
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
221 //if (pRenderer->pRenderD3D)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
222 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
223 pDecalBuilder->DrawBloodsplats();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
224 pEngine->pLightmapBuilder->DrawLightmapsType(2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
225 }
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 pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
228 }
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 //DEBUG: force redraw gui
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
231 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
232
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 pRenderer->BeginScene();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
235 //if (pRenderer->pRenderD3D)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
236 pMouse->DrawCursorToTarget();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
237 if (pOtherOverlayList->bRedraw)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
238 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
239 v4 = viewparams->bRedrawGameUI;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
240 GameUI_Footer();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
241 if (!viewparams->bRedrawGameUI)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
242 GameUI_DrawRightPanelItems();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
243 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
244 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
245 GameUI_DrawRightPanelFrames();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
246 GameUI_Footer_2();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
247 viewparams->bRedrawGameUI = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
248 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
249 if (!pMovie_Track)//!pVideoPlayer->pSmackerMovie)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
250 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
251 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
252 if (v4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
253 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
254 if (!PauseGameDrawing() /*&& pRenderer->pRenderD3D*/) // clear game viewport with transparent color
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
255 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
256 pViewport->uViewportBR_Y - pViewport->uViewportTL_Y + 1,
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
257 0x7FF);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
258 viewparams->field_48 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
259 }
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 viewparams->bRedrawGameUI = pOtherOverlayList->bRedraw;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
263 pOtherOverlayList->bRedraw = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
264
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
265 GameUI_DrawPartySpells();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
266 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
267 GameUI_DrawHiredNPCs();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
268 GameUI_DrawPortraits(v4);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
269 GameUI_DrawLifeManaBars();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
270 GameUI_DrawCharacterSelectionFrame();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
271 if (_44100D_should_alter_right_panel())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
272 GameUI_DrawRightPanel();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
273 if (!pMovie_Track)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
274 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
275 pStru6Instance->DrawPlayerBuffAnims();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
276 pOtherOverlayList->DrawTurnBasedIcon(v4);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
277 GameUI_DrawTorchlightAndWizardEye();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
278 }
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 static bool render_framerate = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
282 static float framerate = 0.0f;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
283 static uint frames_this_second = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
284 static uint last_frame_time = GetTickCount();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
285 static uint framerate_time_elapsed = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
286
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
287 if (current_screen_type == SCREEN_GAME && uCurrentlyLoadedLevelType == LEVEL_Outdoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
288 pWeather->Draw();//Ritor1: my include
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
289
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
290 //while(GetTickCount() - last_frame_time < 33 );//FPS control
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
291 uint frame_dt = GetTickCount() - last_frame_time;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
292 last_frame_time = GetTickCount();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
293
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
294 framerate_time_elapsed += frame_dt;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
295 if (framerate_time_elapsed >= 1000)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
296 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
297 framerate = frames_this_second * (1000.0f / framerate_time_elapsed);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
298
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
299 framerate_time_elapsed = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
300 frames_this_second = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
301 render_framerate = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
302 }
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 ++frames_this_second;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
305
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
306 if (debug_information)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
307 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
308 if (render_framerate)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
309 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
310 sprintf(pTmpBuf.data(), "FPS: % .4f", framerate);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
311 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
312 }
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 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
315 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
316 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
317 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
318 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
319 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
320 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
321 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
322
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
323 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
324 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
325 uint uFaceID;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
326 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
327 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
328 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
329 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
330 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
331 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
332 int on_water, _a6;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
333 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
334 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
335 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
336 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
337 }
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 GUI_UpdateWindows();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
340 pParty->UpdatePlayersAndHirelingsEmotions();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
341
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
342 _unused_5B5924_is_travel_ui_drawn = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
343 if (v4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
344 pMouse->bRedraw = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
345 pMouse->ReadCursorWithItem();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
346 pMouse->DrawCursor();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
347 pMouse->Activate();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
348 pRenderer->EndScene();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
349 pRenderer->Present();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
350 pParty->uFlags &= ~2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
351 }
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 //----- (0047A815) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
354 void Engine::DrawParticles()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
355 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
356 pParticleEngine->Draw();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
357 }
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 //----- (0044F192) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
361 void Engine::PrepareBloodsplats()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
362 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
363 for (uint i = 0; i < uNumBloodsplats; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
364 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
365 pBloodsplatContainer->AddBloodsplat(pBloodsplats[i].x, pBloodsplats[i].y, pBloodsplats[i].z,
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
366 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
367 }
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 //----- (0044F120) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
372 void Engine::PushStationaryLights(int a2)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
373 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
374 Game__StationaryLight* pLight;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
375
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
376 for (int i = 0; i < uNumStationaryLights; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
377 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
378 pLight = &pStationaryLights[i];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
379 pStationaryLightsStack->AddLight(pLight->vPosition.x, pLight->vPosition.y, pLight->vPosition.z,
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
380 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
381 }
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 // 4E94D0: using guessed type char _4E94D0_light_type;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
384
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
385 //----- (0044F0FD) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
386 void Engine::_44F0FD()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
387 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
388 ToggleFlags(0x40u);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
389
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
390 if (!(uFlags & 0x40))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
391 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
392 uNumBloodsplats = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
393 field_E0C = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
394 }
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 //----- (0044F0D8) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
398 void Engine::ToggleFlags(uint uMask)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
399 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
400 if (uFlags & uMask)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
401 uFlags &= ~uMask;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
402 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
403 uFlags |= uMask;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
404 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
405
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 //----- (0044F07B) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
408 bool Engine::_44F07B()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
409 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
410 if (!pKeyboardInstance->IsKeyBeingHeld(VK_SHIFT) && !pKeyboardInstance->IsKeyBeingHeld(VK_LSHIFT) &&
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
411 !pKeyboardInstance->IsKeyBeingHeld(VK_LSHIFT) || (pKeyboardInstance->WasKeyPressed(VK_F11) == 0 &&
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
412 pKeyboardInstance->WasKeyPressed(VK_F11)))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
413 return true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
414 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
415 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
416
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
417 //----- (0044EEA7) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
418 bool Engine::_44EEA7()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
419 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
420 //Game *v1; // esi@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
421 //double v2; // st7@2
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
422 float depth; // ST00_4@9
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
423 //bool result; // eax@9
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
424 //unsigned int v5; // eax@14
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
425 __int64 v6; // kr00_8@21
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
426 //unsigned int y; // [sp+4h] [bp-24h]@2
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
427 //unsigned int x; // [sp+8h] [bp-20h]@2
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
428 Vis_SelectionFilter *v10; // [sp+10h] [bp-18h]@2
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
429 Vis_SelectionFilter *v11; // [sp+14h] [bp-14h]@2
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
430 POINT cursor; // [sp+20h] [bp-8h]@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
431
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
432 //v1 = this;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
433 ++qword_5C6DF0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
434 pParticleEngine->UpdateParticles();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
435 pMouseInstance->GetCursorPos(&cursor);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
436
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
437 //x = cursor.y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
438 //y = cursor.x;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
439 if (sub_4637E0_is_there_popup_onscreen())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
440 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
441 v11 = &vis_face_filter;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
442 v10 = &vis_sprite_filter_2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
443 depth = pEngine->pIndoorCameraD3D->GetPickDepth();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
444 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
445 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
446 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
447 if (uFlags2 & GAME_FLAGS_2_TARGETING_MODE)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
448 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
449 v11 = &vis_face_filter;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
450 v10 = &vis_sprite_filter_1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
451 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
452 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
453 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
454 v11 = &vis_face_filter;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
455 v10 = &vis_sprite_filter_4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
456 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
457 depth = 5120.0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
458 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
459 //depth = v2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
460
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
461 PickMouse(depth, cursor.x, cursor.y, false, v10, v11);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
462 pLightmapBuilder->std__vector_000004_size = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
463 pLightmapBuilder->std__vector_183808_size = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
464 pDecalBuilder->std__vector_pDecals_size = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
465 pDecalBuilder->field_308008 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
466 if (!_44F07B())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
467 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
468
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
469 if (uFlags & GAME_FLAGS_1_DRAW_BLV_DEBUGS)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
470 pStru10Instance->bDoNotDrawPortalFrustum = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
471 if ( /*pRenderer->pRenderD3D &&*/ uCurrentlyLoadedLevelType == LEVEL_Outdoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
472 pRenderer->uFogColor = GetLevelFogColor() & 0xFFFFFF;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
473 if (uFlags & 0x0400)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
474 uFlags2 |= 0x01;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
475 /*if ( !pRenderer->pRenderD3D && uCurrentlyLoadedLevelType == LEVEL_Outdoor && pMobileLightsStack->uNumLightsActive )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
476 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
477 uFlags2 |= 0x01;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
478 field_E10 = qword_5C6DF0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
479 }*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
480 v6 = qword_5C6DF0 - field_E10;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
481 if (qword_5C6DF0 - field_E10 == 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
482 uFlags2 |= v6;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
483 if (uNumStationaryLights_in_pStationaryLightsStack != pStationaryLightsStack->uNumLightsActive)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
484 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
485 uFlags2 |= 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
486 uNumStationaryLights_in_pStationaryLightsStack = pStationaryLightsStack->uNumLightsActive;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
487 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
488 return true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
489 }
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 //----- (0044EDE4) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
493 bool Engine::AlterGamma_BLV(BLVFace *pFace, signed int *pColor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
494 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
495 if (uFlags2 & GAME_FLAGS_2_SATURATE_LIGHTMAPS &&
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
496 pFace->uAttributes & FACE_CAN_SATURATE_COLOR)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
497 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
498 *pColor = ReplaceHSV(*pColor, 1.0, fSaturation, -1.0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
499 return true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
500 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
501 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
502 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
503 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
504
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
505 //----- (0044EE30) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
506 bool Engine::AlterGamma_ODM(ODMFace *pFace, signed int *pColor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
507 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
508 if (uFlags2 & GAME_FLAGS_2_SATURATE_LIGHTMAPS &&
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
509 pFace->uAttributes & FACE_CAN_SATURATE_COLOR)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
510 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
511 *pColor = ReplaceHSV(*pColor, 1.0, fSaturation, -1.0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
512 return true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
513 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
514 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
515 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
516 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
517
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 //----- (004645FA) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
520 void Engine::Deinitialize()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
521 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
522 WriteWindowsRegistryInt("startinwindow", 1);//pRenderer->bWindowMode);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
523 //if (pRenderer->bWindowMode)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
524 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
525 WriteWindowsRegistryInt("window X", window->GetX());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
526 WriteWindowsRegistryInt("window Y", window->GetY());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
527 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
528 WriteWindowsRegistryInt("valAlwaysRun", bAlwaysRun);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
529 pItemsTable->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
530 pNPCStats->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
531
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
532 if (pMouse)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
533 pMouse->Deactivate();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
534
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
535 delete pRenderer;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
536 pAudioPlayer->Release();//error
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
537 pNew_LOD->FreeSubIndexAndIO();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
538 pGames_LOD->FreeSubIndexAndIO();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
539 ClipCursor(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
540 Engine::Destroy();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
541 delete pEventTimer;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
542 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
543
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
544 //----- (0044EE7C) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
545 bool Engine::draw_debug_outlines()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
546 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
547 if (uFlags & 0x04)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
548 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
549 pLightmapBuilder->DrawDebugOutlines(-1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
550 pDecalBuilder->DrawDecalDebugOutlines();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
551 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
552 return true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
553 }
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 //----- (0044EC23) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
556 int Engine::_44EC23(struct Polygon *a2, int *a3, signed int a4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
557 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
558 double v4; // st7@4
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
559 //double v5; // ST00_8@4
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
560 signed int v6; // eax@5
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
561 //double v7; // ST00_8@6
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
562 signed int result; // eax@8
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
563 //double v9; // ST00_8@9
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
564 //double v10; // ST00_8@11
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
565 float a2a; // [sp+14h] [bp+8h]@4
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
566 float a3a; // [sp+18h] [bp+Ch]@4
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
567 float a3b; // [sp+18h] [bp+Ch]@6
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
568 float a4a; // [sp+1Ch] [bp+10h]@9
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
569 float a4b; // [sp+1Ch] [bp+10h]@11
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
570
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
571 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
572 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
573 v4 = (double)a4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
574 a2a = v4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
575 *a3 |= 2u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
576 a3a = (1.0 - this->fSaturation) * v4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
577 //v5 = a3a + 6.7553994e15;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
578 //if ( SLODWORD(v5) >= 0 )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
579 if (floorf(a3a + 0.5f) >= 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
580 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
581 a3b = (1.0 - this->fSaturation) * a2a;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
582 //v7 = a3b + 6.7553994e15;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
583 //v6 = LODWORD(v7);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
584 v6 = floorf(a3b + 0.5f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
585 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
586 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
587 v6 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
588 if (a4 >= v6)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
589 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
590 a4a = (1.0 - fSaturation) * a2a;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
591 //v9 = a4a + 6.7553994e15;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
592 //if ( SLODWORD(v9) >= 0 )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
593 if (floorf(a4a + 0.5f) >= 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
594 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
595 a4b = (1.0 - fSaturation) * a2a;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
596 //v10 = a4b + 6.7553994e15;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
597 //result = LODWORD(v10);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
598 result = floorf(a4b + 0.5f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
599 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
600 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
601 result = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
602 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
603 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
604 result = a4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
605 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
606 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
607 result = -1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
608 return result;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
609 }
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 //----- (00465C8B) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
614 Engine *Engine::Create()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
615 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
616 return new Engine;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
617 }
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 //----- (00465CF3) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
620 void Engine::Destroy()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
621 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
622 delete pEngine;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
623 pEngine = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
624 }
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 //----- (0044ED0A) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
627 signed int Engine::_44ED0A(BLVFace *a2, int *a3, signed int a4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
628 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
629 double v4; // st7@3
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
630 //double v5; // ST00_8@3
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
631 signed int v6; // eax@4
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
632 //double v7; // ST00_8@5
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
633 signed int result; // eax@7
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
634 //double v9; // ST00_8@8
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
635 //double v10; // ST00_8@10
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
636 float v11; // [sp+14h] [bp+8h]@3
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
637 float v12; // [sp+18h] [bp+Ch]@3
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
638 float v13; // [sp+18h] [bp+Ch]@5
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
639 float v14; // [sp+1Ch] [bp+10h]@8
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
640 float v15; // [sp+1Ch] [bp+10h]@10
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
641
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
642 if (this->uFlags2 & 2 && a2->uAttributes & 2)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
643 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
644 v4 = (double)a4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
645 v11 = v4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
646 *a3 |= 2u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
647 v12 = (1.0 - this->fSaturation) * v4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
648 //v5 = v12 + 6.7553994e15;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
649 if (floorf(v12 + 0.5f)/* SLODWORD(v5)*/ >= 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
650 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
651 v13 = (1.0 - this->fSaturation) * v11;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
652 //v7 = v13 + 6.7553994e15;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
653 //v6 = LODWORD(v7);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
654 v6 = floorf(v13 + 0.5f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
655 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
656 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
657 v6 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
658 if (a4 >= v6)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
659 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
660 v14 = (1.0 - fSaturation) * v11;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
661 //v9 = v14 + 6.7553994e15;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
662 if (floorf(v14 + 0.5f)/* SLODWORD(v9)*/ >= 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
663 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
664 v15 = (1.0 - fSaturation) * v11;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
665 //v10 = v15 + 6.7553994e15;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
666 //result = LODWORD(v10);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
667 result = floorf(v15 + 0.5f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
668 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
669 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
670 result = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
671 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
672 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
673 result = a4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
674 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
675 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
676 result = -1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
677 return result;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
678 }
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 //----- (0044E4B7) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
682 Engine::Engine()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
683 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
684 uNumStationaryLights = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
685 uNumBloodsplats = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
686 field_E0C = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
687 field_E10 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
688 uNumStationaryLights_in_pStationaryLightsStack = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
689 uFlags = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
690 uFlags2 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
691
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
692 //pThreadWardInstance = new ThreadWard;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
693 pThreadWardInstance = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
694 pParticleEngine = new ParticleEngine;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
695 pMouse = pMouseInstance = new Mouse;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
696 pLightmapBuilder = new LightmapBuilder;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
697 pVisInstance = new Vis;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
698 pStru6Instance = new stru6;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
699 pIndoorCameraD3D = new IndoorCameraD3D;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
700 pStru9Instance = new stru9;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
701 pStru10Instance = new stru10;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
702 //pStru11Instance = new stru11;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
703 pStru11Instance = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
704 //pStru12Instance = new stru12(pStru11Instance);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
705 pStru12Instance = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
706 //pCShow = new CShow;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
707 pCShow = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
708 pKeyboardInstance = new Keyboard;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
709 //pGammaController = new GammaController;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
710
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
711 uFlags |= 0x0800;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
712 uFlags2 |= 0x24;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
713
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
714 _44F0FD();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
715 }
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 //----- (0044E7F3) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
718 Engine::~Engine()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
719 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
720 //delete pGammaController;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
721 delete pKeyboardInstance;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
722 /*delete pCShow;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
723 delete pStru12Instance;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
724 delete pStru11Instance;*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
725 delete pStru10Instance;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
726 delete pStru9Instance;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
727 delete pIndoorCameraD3D;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
728 delete pStru6Instance;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
729 delete pVisInstance;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
730 delete pLightmapBuilder;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
731 delete pMouseInstance;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
732 delete pParticleEngine;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
733 //delete pThreadWardInstance;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
734 }
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 //----- (0044EA5E) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
737 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
738 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
739 /*if (current_screen_type != SCREEN_GAME|| !pRenderer->pRenderD3D)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
740 return false;*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
741
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
742 if (!pVisInstance)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
743 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
744 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
745 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
746 }
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 if (uMouseX >= (signed int)pViewport->uScreen_TL_X &&
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
749 uMouseX <= (signed int)pViewport->uScreen_BR_X &&
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
750 uMouseY >= (signed int)pViewport->uScreen_TL_Y &&
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
751 uMouseY <= (signed int)pViewport->uScreen_BR_Y)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
752 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
753 pVisInstance->PickMouse(fPickDepth, uMouseX, uMouseY, sprite_filter, face_filter);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
754
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
755 if (bOutline)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
756 OutlineSelection();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
757 }
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 return true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
760 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
761 // 4E28F8: using guessed type int current_screen_type;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
762
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
763 //----- (0044EB12) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
764 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
765 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
766 if (current_screen_type == SCREEN_GAME && pVisInstance /*&& pRenderer->pRenderD3D*/)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
767 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
768 bool r = pVisInstance->PickKeyboard(&pVisInstance->default_list, sprite_filter, face_filter);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
769
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
770 if (bOutline)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
771 OutlineSelection();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
772 return r;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
773 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
774 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
775 }
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 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
778 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
779 if (dword_4E28F8_PartyCantJumpIfTrue)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
780 return Result::Generic;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
781
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
782 pVis->PickKeyboard(a3, a4);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
783 if (bOutline)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
784 Game_outline_selection((int)this);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
785 return Result::Success;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
786 }
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 // 4E28F8: using guessed type int current_screen_type;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
789
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
790 //----- (0044EB5A) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
791 void Engine::OutlineSelection()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
792 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
793 if (!pVisInstance)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
794 return;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
795
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
796 if (!pVisInstance->default_list.uNumPointers)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
797 return;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
798
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
799 Vis_ObjectInfo* object_info = pVisInstance->default_list.object_pointers[0];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
800 if (object_info)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
801 switch (object_info->object_type)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
802 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
803 case VisObjectType_Sprite:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
804 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
805 Log::Warning(L"Sprite outline currently unsupported");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
806 return;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
807 }
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 case VisObjectType_Face:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
810 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
811 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
812 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
813 ODMFace* face = (ODMFace *)object_info->object;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
814 if (face->uAttributes & FACE_OUTLINED)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
815 face->uAttributes &= ~FACE_OUTLINED;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
816 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
817 face->uAttributes |= FACE_OUTLINED;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
818 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
819 else if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
820 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
821 BLVFace* face = (BLVFace *)object_info->object;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
822 if (face->uAttributes & FACE_OUTLINED)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
823 face->uAttributes &= ~FACE_OUTLINED;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
824 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
825 face->uAttributes |= FACE_OUTLINED;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
826 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
827 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
828 Error("Invalid level type", uCurrentlyLoadedLevelType);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
829 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
830 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
831
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
832 default:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
833 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
834 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
835 ExitProcess(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
836 }
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 //----- (0042FBDD) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
845 void sub_42FBDD()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
846 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
847 pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
848 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
849 pRenderer->Present();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
850 }
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 //----- (0042FC15) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
853 void CloseWindowBackground()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
854 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
855 pAudioPlayer->PlaySound(SOUND_StartMainChoice02, -2, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
856 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
857 pRenderer->Present();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
858 }
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 //----- (0046BDC0) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
862 void UpdateUserInput_and_MapSpecificStuff()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
863 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
864 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
865 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
866 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
867 return;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
868 }
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 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
871 BLV_UpdateUserInputAndOther();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
872 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
873 ODM_UpdateUserInputAndOther();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
874
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
875 area_of_effect__damage_evaluate();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
876 }
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 //----- (004646F0) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
879 void PrepareWorld(unsigned int _0_box_loading_1_fullscreen)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
880 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
881 //if ( pRenderer->pRenderD3D )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
882 pEngine->pVisInstance->_4C1A02();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
883 pEventTimer->Pause();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
884 pMiscTimer->Pause();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
885 pParty->uFlags = 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
886 CastSpellInfoHelpers::_427D48();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
887 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
888 DoPrepareWorld(0, (_0_box_loading_1_fullscreen == 0) + 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
889 pMiscTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
890 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
891 }
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 //----- (00464866) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
894 void DoPrepareWorld(unsigned int bLoading, int _1_fullscreen_loading_2_box)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
895 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
896 char *v3; // eax@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
897 unsigned int v5; // eax@3
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
898 char Str1[20]; // [sp+Ch] [bp-18h]@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
899 unsigned int v9; // [sp+20h] [bp-4h]@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
900
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
901 v9 = bLoading;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
902 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
903 pDecalBuilder->Reset(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
904 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
905 GUIProgressBar::TYPE_Box);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
906 strcpy(Str1, pCurrentMapName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
907 v3 = strtok(Str1, ".");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
908 strcpy(Str1, v3);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
909 Level_LoadEvtAndStr(Str1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
910 LoadLevel_InitializeLevelEvt();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
911 strcpy(Str1, pCurrentMapName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
912 _strrev(Str1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
913 strtok(Str1, ".");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
914 _strrev(Str1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
915
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
916 for (uint i = 0; i < 1000; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
917 pSpriteObjects[i].uObjectDescID = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
918
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
919 v5 = pMapStats->GetMapInfo(pCurrentMapName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
920 bUnderwater = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
921 uLevelMapStatsID = v5;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
922 pEngine->uFlags2 &= 0xFFFFFFF7u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
923 if (!_stricmp(pCurrentMapName, "out15.odm"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
924 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
925 bUnderwater = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
926 pEngine->uFlags2 |= GAME_FLAGS_2_ALTER_GRAVITY;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
927 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
928 pParty->floor_face_pid = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
929 if (_stricmp(Str1, "blv"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
930 PrepareToLoadODM(v9, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
931 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
932 PrepareToLoadBLV(v9);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
933 pAudioPlayer->SetMapEAX();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
934 _461103_load_level_sub();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
935 if (!_stricmp(pCurrentMapName, "d11.blv") || !_stricmp(pCurrentMapName, "d10.blv"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
936 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
937 //spawning grounds & walls of mist - no loot & exp from monsters
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
938
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
939 for (uint i = 0; i < uNumActors; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
940 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
941 pActors[i].pMonsterInfo.uTreasureType = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
942 pActors[i].pMonsterInfo.uTreasureDiceRolls = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
943 pActors[i].pMonsterInfo.uExp = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
944 }
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 bDialogueUI_InitializeActor_NPC_ID = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
947 OnMapLoad();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
948 pGameLoadingUI_ProgressBar->Progress();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
949 memset(&pRenderer->pBillboardRenderListD3D, 0, sizeof(pRenderer->pBillboardRenderListD3D));
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
950 pGameLoadingUI_ProgressBar->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
951 _flushall();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
952 }
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 void IntegrityTest()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
955 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
956 static_assert(sizeof(MovieHeader) == 44, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
957 static_assert(sizeof(SoundDesc_mm6) == 112, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
958 static_assert(sizeof(SoundDesc) == 120, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
959 static_assert(sizeof(OverlayDesc) == 8, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
960 static_assert(sizeof(ChestDesc) == 36, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
961 static_assert(sizeof(ObjectDesc_mm6) == 52, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
962 static_assert(sizeof(ObjectDesc) == 56, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
963 static_assert(sizeof(DecorationDesc) == 84, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
964 static_assert(sizeof(IconFrame) == 32, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
965 static_assert(sizeof(PlayerFrame) == 10, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
966 static_assert(sizeof(TextureFrame) == 20, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
967 static_assert(sizeof(SpriteFrame) == 60, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
968 static_assert(sizeof(RenderVertexSoft) == 0x30, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
969 static_assert(sizeof(RenderBillboard) == 0x34, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
970 static_assert(sizeof(Texture) == 0x48, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
971 //static_assert(sizeof(RGBTexture) == 0x28, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
972 //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
973 static_assert(sizeof(AudioPlayer) == 0xC84, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
974 static_assert(sizeof(SoundDesc) == 0x78, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
975 static_assert(sizeof(stru339_spell_sound) == 0xAFD8, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
976 //static_assert(sizeof(VideoPlayer) == 0x108 + 4, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
977 static_assert(sizeof(MovieHeader) == 0x2C, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
978 static_assert(sizeof(DecorationDesc) == 0x54, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
979 static_assert(sizeof(ObjectDesc) == 0x38, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
980 static_assert(sizeof(OverlayDesc) == 0x8, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
981 static_assert(sizeof(ChestDesc) == 0x24, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
982 static_assert(sizeof(TileDesc) == 0x1A, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
983 static_assert(sizeof(MonsterDesc_mm6) == 148, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
984 static_assert(sizeof(MonsterDesc) == 152, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
985 static_assert(sizeof(Timer) == 0x28, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
986 static_assert(sizeof(OtherOverlay) == 0x14, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
987 static_assert(sizeof(ItemGen) == 0x24, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
988 static_assert(sizeof(SpriteObject) == 0x70, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
989 static_assert(sizeof(ItemDesc) == 0x30, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
990 static_assert(sizeof(ItemsTable) == 0x117A0, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
991 static_assert(sizeof(Chest) == 0x14CC, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
992 static_assert(sizeof(MapInfo) == 0x44, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
993 static_assert(sizeof(SpellInfo) == 0x24, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
994 static_assert(sizeof(SpellData) == 0x14, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
995 static_assert(sizeof(SpellBuff) == 0x10, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
996 static_assert(sizeof(AIDirection) == 0x1C, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
997 static_assert(sizeof(ActorJob) == 0xC, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
998 static_assert(sizeof(Actor) == 0x344, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
999 static_assert(sizeof(LevelDecoration) == 0x20, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1000 static_assert(sizeof(KeyboardActionMapping) == 0x20C, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1001 static_assert(sizeof(UIAnimation) == 0xD, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1002 static_assert(sizeof(SpawnPointMM7) == 0x18, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1003 static_assert(sizeof(ODMFace) == 0x134, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1004 static_assert(sizeof(BSPNode) == 0x8, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1005 static_assert(sizeof(BSPModel) == 0xBC, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1006 static_assert(sizeof(OutdoorLocation) == 0x1C28C, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1007 static_assert(sizeof(BLVFace) == 0x60, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1008 static_assert(sizeof(BLVFaceExtra) == 0x24, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1009 static_assert(sizeof(BLVSector) == 0x74, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1010 static_assert(sizeof(BLVLightMM7) == 0x10, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1011 static_assert(sizeof(BLVDoor) == 0x50, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1012 static_assert(sizeof(IndoorLocation) == 0x690, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1013 //static_assert(sizeof(ODMRenderParams) == 0x74, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1014 static_assert(sizeof(Mouse) == 0x114, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1015 static_assert(sizeof(Particle_sw) == 0x68, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1016 static_assert(sizeof(Particle) == 0x68, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1017 static_assert(sizeof(ParticleEngine) == 0xE430, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1018 static_assert(sizeof(Lightmap) == 0xC1C, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1019 static_assert(sizeof(LightmapBuilder) == 0x3CBC38, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1020 static_assert(sizeof(Vis_SelectionList) == 0x2008, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1021 static_assert(sizeof(Vis) == 0x20D0, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1022 static_assert(sizeof(PlayerBuffAnim) == 0x10, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1023 static_assert(sizeof(ProjectileAnim) == 0x1C, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1024 static_assert(sizeof(stru6) == 0x5F8, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1025 static_assert(sizeof(IndoorCameraD3D_Vec3) == 0x10, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1026 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
1027 //static_assert(sizeof(IndoorCameraD3D) == 0x1A1384, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1028 static_assert(sizeof(StationaryLight) == 0xC, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1029 static_assert(sizeof(LightsStack_StationaryLight_) == 0x12C8, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1030 static_assert(sizeof(MobileLight) == 0x12, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1031 static_assert(sizeof(LightsStack_MobileLight_) == 0x1C28, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1032 static_assert(sizeof(Engine) == 0xE78, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1033 static_assert(sizeof(stru141_actor_collision_object) == 0xA8, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1034 static_assert(sizeof(ActionQueue) == 0x7C, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1035 static_assert(sizeof(NPCData) == 0x4C, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1036 static_assert(sizeof(NPCStats) == 0x17FFC, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1037 static_assert(sizeof(BspRenderer) == 0x53740, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1038 static_assert(sizeof(PaletteManager) == 0x267AF0, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1039 static_assert(sizeof(ViewingParams) == 0x26C, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1040 //static_assert(sizeof(IndoorCamera) == 0x50, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1041 static_assert(sizeof(Bloodsplat) == 0x28, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1042 static_assert(sizeof(BloodsplatContainer) == 0xA0C, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1043 static_assert(sizeof(TrailParticle) == 0x18, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1044 static_assert(sizeof(EventIndex) == 0xC, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1045 static_assert(sizeof(_2devent) == 0x34, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1046 static_assert(sizeof(MapsLongTimer) == 0x20, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1047 static_assert(sizeof(SavegameHeader) == 0x64, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1048 static_assert(sizeof(SavegameList) == 0x3138, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1049 static_assert(sizeof(StorylineText) == 0x160, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1050 static_assert(sizeof(FactionTable) == 0x1EF1, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1051 static_assert(sizeof(Decal) == 0xC20, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1052 static_assert(sizeof(DecalBuilder) == 0x30C038, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1053 static_assert(sizeof(MonsterInfo) == 0x58, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1054 static_assert(sizeof(MonsterStats) == 0x5BA0, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1055 static_assert(sizeof(RenderD3D) == 0x148, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1056 // static_assert(sizeof(Render) == 0x129844, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1057 static_assert(sizeof(Player) == 0x1B3C, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1058 static_assert(sizeof(PartyTimeStruct) == 0x678, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1059 static_assert(sizeof(Party) == 0x16238, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1060 static_assert(sizeof(GUIButton) == 0xBC, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1061 static_assert(sizeof(GUIWindow) == 0x54, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1062 //static_assert(sizeof(GUIProgressBar) == 0x1B8, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1063 static_assert(sizeof(GUIFont) == 0x1020, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1064 // static_assert(sizeof(stru262_TurnBased) == 0x40, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1065 //static_assert(sizeof(ArcomageGame) == 0xFB, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1066 static_assert(sizeof(CastSpellInfo) == 0x14, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1067 static_assert(sizeof(ArcomageCard) == 0x6C, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1068 static_assert(sizeof(stru320) == 0x3FC, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1069 static_assert(sizeof(TravelInfo) == 0x20, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1070 static_assert(sizeof(stru336) == 0x798, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1071 static_assert(sizeof(Vec3_short_) == 6, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1072 static_assert(sizeof(BLVFace) == 96, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1073 static_assert(sizeof(BLVFaceExtra) == 36, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1074 static_assert(sizeof(BLVSector) == 116, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1075 static_assert(sizeof(LevelDecoration) == 32, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1076 static_assert(sizeof(BLVLightMM7) == 16, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1077 static_assert(sizeof(BSPNode) == 8, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1078 static_assert(sizeof(SpawnPointMM7) == 24, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1079 static_assert(sizeof(DDM_DLV_Header) == 40, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1080 static_assert(sizeof(Actor) == 836, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1081 static_assert(sizeof(SpriteObject) == 112, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1082 static_assert(sizeof(Chest) == 5324, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1083 static_assert(sizeof(stru123) == 0xC8, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1084 static_assert(sizeof(BLVMapOutline) == 12, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1085 static_assert(sizeof(LODSprite) == 0x28, "Wrong type size");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1086 }
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 //----- (004647AB) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1090 void FinalInitialization()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1091 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1092 pViewport->SetScreen(viewparams->uSomeX, viewparams->uSomeY, viewparams->uSomeZ, viewparams->uSomeW);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1093 pViewport->SetFOV(flt_6BE3A0 * 65536.0f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1094
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1095 //pIndoorCamera = new IndoorCamera;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1096 //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
1097 // viewparams->uScreen_BttmR_Y - viewparams->uScreen_topL_Y + 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1098
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1099 InitializeTurnBasedAnimations(&stru_50C198);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1100 pBitmaps_LOD->_inlined_sub1();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1101 pSprites_LOD->_inlined_sub1();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1102 pIcons_LOD->_inlined_sub1();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1103 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1104 // 6BE3A0: using guessed type float flt_6BE3A0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1105
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 //----- (00464E17) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1109 bool __fastcall CheckMM7CD(char c)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1110 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1111 char DstBuf[256] = { 0 };
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1112 char strCommand[256] = { 0 }; // [sp+10Ch] [bp-118h]@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1113 char Filename[20] = { 0 }; // [sp+20Ch] [bp-18h]@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1114
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1115 wchar_t pMagicPath[1024];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1116 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
1117 if (GetFileAttributesW(pMagicPath) == -1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1118 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1119
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1120 //Open CD audio
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1121 wsprintfA(strCommand, "open %c: type cdaudio alias CD", c);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1122 if (!mciSendStringA(strCommand, DstBuf, 255, 0))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1123 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1124 wsprintfA(strCommand, "info CD UPC wait");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1125 mciSendStringA(strCommand, DstBuf, 255, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1126 wsprintfA(strCommand, "close CD");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1127 mciSendStringA(strCommand, DstBuf, 255, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1128 }
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 memcpy(Filename, "X:\\anims\\magic7.vid", sizeof(Filename));
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1131 *Filename = c;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1132
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1133 FILE* f = fopen(Filename, "rb");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1134 if (!f)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1135 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1136
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1137 if (!fseek(f, 0, SEEK_END))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1138 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1139 if (!fseek(f, -100, SEEK_CUR))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1140 fread(DstBuf, 1, 0x64u, f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1141
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1142 fclose(f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1143 return true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1144 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1145 fclose(f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1146 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1147 }
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 //----- (00464F1B) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1150 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
1151 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1152 char v4; // zf@3
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1153 int v6; // eax@10
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1154 int v7; // eax@11
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1155 int v8; // eax@12
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1156 int v9; // eax@13
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1157 BOOL(__stdcall *v10)(HWND, int, LPCSTR); // edi@15
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1158 const CHAR *v11; // [sp-Ch] [bp-Ch]@15
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1159 INT_PTR v12; // [sp-4h] [bp-4h]@5
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1160
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1161 if (a2 == 272)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1162 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1163 hInsertCDWindow = hDlg;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1164 v6 = (GetUserDefaultLangID() & 0x3FF) - 7;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1165 if (v6)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1166 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1167 v7 = v6 - 3;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1168 if (v7)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1169 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1170 v8 = v7 - 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1171 if (v8)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1172 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1173 v9 = v8 - 4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1174 if (v9)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1175 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1176 if (v9 != 5)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1177 return 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1178 SetWindowTextA(hDlg, "Wloz CD-ROM numer 2");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1179 v10 = SetDlgItemTextA;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1180 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
1181 v11 = "Odwolaj";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1182 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1183 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1184 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1185 SetWindowTextA(hDlg, "Inserire il secondo CD");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1186 v10 = SetDlgItemTextA;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1187 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
1188 v11 = "Annulla";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1189 }
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 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1192 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1193 SetWindowTextA(hDlg, "Insérez le CD 2");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1194 v10 = SetDlgItemTextA;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1195 SetDlgItemTextA(hDlg, 1010, "Insérez Might & Magic® VII CD 2.");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1196 v11 = "Supprimer";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1197 }
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 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1200 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1201 SetWindowTextA(hDlg, "Por favor, inserte disco 2");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1202 v10 = SetDlgItemTextA;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1203 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
1204 v11 = "Cancelar";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1205 }
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 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1208 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1209 SetWindowTextA(hDlg, "Bitte CD 2 einlegen");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1210 v10 = SetDlgItemTextA;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1211 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
1212 v11 = "Abbrechen";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1213 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1214 v10(hDlg, 2, v11);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1215 return 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1216 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1217 if (a2 == 273)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1218 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1219 if (a3 == 2)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1220 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1221 v12 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1222 EndDialog(hDlg, v12);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1223 return 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1224 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1225 v4 = a3 == 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1226 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1227 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1228 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1229 v4 = a2 == 1025;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1230 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1231 if (v4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1232 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1233 v12 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1234 EndDialog(hDlg, v12);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1235 return 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1236 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1237 return 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1238 }
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 //----- (00465061) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1241 bool __fastcall FindMM7CD(HWND hWnd, char *pCDDrive)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1242 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1243 char drive[4] = { 'X', ':', '\\', 0 };
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1244
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1245 bool bGotCDFromRegistry = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1246
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1247 HKEY hSoftware = nullptr,
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1248 hNWC = nullptr,
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1249 hMM7 = nullptr,
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1250 hVersion = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1251 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
1252 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1253 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
1254 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1255 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
1256 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1257 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
1258 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1259 DWORD cbData = 3;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1260 if (!RegQueryValueExA(hVersion, "CDDrive", 0, 0, (BYTE *)drive, &cbData))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1261 bGotCDFromRegistry = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1262 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1263 RegCloseKey(hVersion);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1264 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1265 RegCloseKey(hMM7);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1266 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1267 RegCloseKey(hNWC);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1268 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1269 RegCloseKey(hSoftware);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1270
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1271 if (bGotCDFromRegistry)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1272 if (CheckMM7CD(*drive))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1273 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1274 cMM7GameCDDriveLetter = *drive;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1275 return true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1276 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1277
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1278 while (true)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1279 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1280 for (uint i = 0; i < 26; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1281 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1282 drive[0] = 'A' + i;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1283
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1284 if (GetDriveTypeA(drive) == DRIVE_CDROM)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1285 if (CheckMM7CD(*drive))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1286 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1287 cMM7GameCDDriveLetter = *drive;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1288 WriteWindowsRegistryString("CDDrive", drive);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1289 return true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1290 }
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 if (DialogBoxParamA(GetModuleHandleW(nullptr), "InsertCD", hWnd, (DLGPROC)InsertMM7CDDialogFunc, 0))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1294 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1295 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1296 }
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 //----- (004651F4) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1300 bool MM7_Initialize(int game_width, int game_height)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1301 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1302 wchar_t pCurrentDir[1024];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1303 _wgetcwd(pCurrentDir, 1024);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1304
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1305 wchar_t pMM6IniFile[1024];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1306 wsprintfW(pMM6IniFile, L"%s\\mm6.ini", pCurrentDir);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1307
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1308 bCanLoadFromCD = GetPrivateProfileIntW(L"settings", L"use_cd", 1, pMM6IniFile);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1309 if (bNoCD)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1310 bCanLoadFromCD = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1311 if (bCanLoadFromCD)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1312 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1313 Log::Warning(L"Checking for CD...");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1314 if (!FindMM7CD(nullptr, &cMM7GameCDDriveLetter))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1315 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1316 Log::Warning(L"...done.");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1317 }
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 srand(GetTickCount());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1321
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1322 pEventTimer = Timer::Create();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1323 pEventTimer->Initialize();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1324 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
1325
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1326 bool use_d3d11 = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1327 if (use_d3d11)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1328 pRenderer = RenderD3D11::Create();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1329 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1330 pRenderer = Render::Create();//Create DirectX
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1331 if (!pRenderer)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1332 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1333 Log::Warning(L"Render creation failed");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1334 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1335 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1336 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1337 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1338 //bool bWindowMode = ReadWindowsRegistryInt("startinwindow", false);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1339 //uint uDefaultDevice = ReadWindowsRegistryInt("D3D Device", 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1340
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1341 if (!pRenderer->Initialize(window/*, bColoredLights, uLevelOfDetail, bTinting*/))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1342 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1343 Log::Warning(L"Render failed to initialize");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1344 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1345 }
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 game_starting_year = 1168;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1349
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1350 pParty = new Party;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1351 memset(&pParty->pHirelings, 0, sizeof(pParty->pHirelings));
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1352 pParty->uWalkSpeed = GetPrivateProfileIntW(L"debug", L"walkspeed", 384, pMM6IniFile);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1353 pParty->uDefaultEyelevel = GetPrivateProfileIntW(L"party", L"eyelevel", 160, pMM6IniFile);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1354 pParty->sEyelevel = pParty->uDefaultEyelevel;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1355 pParty->uDefaultPartyHeight = GetPrivateProfileIntW(L"party", L"height", 192, pMM6IniFile);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1356 pParty->uPartyHeight = pParty->uDefaultPartyHeight;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1357
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1358 MM6_Initialize(pMM6IniFile);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1359
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1360 pKeyActionMap = new KeyboardActionMapping;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1361
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1362 OnTimer(1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1363 GameUI_StatusBar_UpdateTimedString(1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1364 pEngine = Engine::Create();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1365 pMouse = pEngine->pMouseInstance;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1366
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 pIcons_LOD = new LODFile_IconsBitmaps;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1369 if (!pIcons_LOD->Load("data\\icons.lod", "icons"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1370 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1371 MessageBoxW(nullptr, L"Some files are missing\n\nPlease Reinstall.",
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1372 L"Files Missing", MB_ICONEXCLAMATION);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1373 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1374 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1375 pIcons_LOD->dword_011BA4 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1376
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1377 pEvents_LOD = new LODFile_IconsBitmaps;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1378 if (!pEvents_LOD->Load("data\\events.lod", "icons"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1379 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1380 MessageBoxW(nullptr, L"Some files are missing\n\nPlease Reinstall.",
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1381 L"Files Missing", MB_ICONEXCLAMATION);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1382 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1383 }
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 InitializeGameText();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1386
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1387 pBitmaps_LOD = new LODFile_IconsBitmaps;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1388 if (!pBitmaps_LOD->Load("data\\bitmaps.lod", "bitmaps"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1389 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1390 MessageBoxA(nullptr, pGlobalTXT_LocalizationStrings[63],
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1391 pGlobalTXT_LocalizationStrings[184], MB_ICONEXCLAMATION);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1392 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1393 }
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 pSprites_LOD = new LODFile_Sprites;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1396 if (!pSprites_LOD->LoadSprites("data\\sprites.lod"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1397 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1398 MessageBoxA(nullptr,
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1399 pGlobalTXT_LocalizationStrings[63],
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1400 pGlobalTXT_LocalizationStrings[184], MB_ICONEXCLAMATION);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1401 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1402 }
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 #if 0
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1406 if (_access("../MM_VI/data/icons.lod", 0) == 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1407 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1408 pIcons_LOD_mm6 = new LODFile_IconsBitmaps;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1409 if (!pIcons_LOD_mm6->Load("../MM_VI/data/icons.lod", "icons"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1410 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1411 delete pIcons_LOD_mm6;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1412 pIcons_LOD_mm6 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1413 Log::Warning(L"Unable to load mm6:icons.lod");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1414 }
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 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1417 Log::Warning(L"Unable to find mm6:icons.lod");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1418
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1419 if (_access("../MM_VI/data/bitmaps.lod", 0) == 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1420 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1421 pBitmaps_LOD_mm6 = new LODFile_IconsBitmaps;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1422 if (!pBitmaps_LOD_mm6->Load("../MM_VI/data/bitmaps.lod", "bitmaps"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1423 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1424 delete pBitmaps_LOD_mm6;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1425 pBitmaps_LOD_mm6 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1426 Log::Warning(L"Unable to load mm6:bitmaps.lod");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1427 }
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 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1430 Log::Warning(L"Unable to find mm6:bitmaps.lod");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1431
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1432 auto mm6_sprite_container_name = bUseLoResSprites ? "../MM_VI/data/spriteLO.lod"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1433 : "../MM_VI/data/sprites.lod";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1434 if (_access(mm6_sprite_container_name, 0) == 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1435 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1436 pSprites_LOD_mm6 = new LODFile_Sprites;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1437 if (!pSprites_LOD_mm6->LoadSprites(mm6_sprite_container_name))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1438 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1439 delete pSprites_LOD_mm6;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1440 pSprites_LOD_mm6 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1441 Log::Warning(L"Unable to load mm6:sprites.lod");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1442 }
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 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1445 Log::Warning(L"Unable to find mm6:sprites.lod");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1446
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 if (_access("../mm8/data/icons.lod", 0) == 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1449 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1450 pIcons_LOD_mm8 = new LODFile_IconsBitmaps;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1451 if (!pIcons_LOD_mm8->Load("../mm8/data/icons.lod", "icons"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1452 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1453 delete pIcons_LOD_mm8;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1454 pIcons_LOD_mm8 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1455 Log::Warning(L"Unable to load mm8:icons.lod");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1456 }
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 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1459 Log::Warning(L"Unable to find mm8:icons.lod");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1460
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1461
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1462 if (_access("../mm8/data/bitmaps.lod", 0) == 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1463 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1464 pBitmaps_LOD_mm8 = new LODFile_IconsBitmaps;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1465 if (!pBitmaps_LOD_mm8->Load("../mm8/data/bitmaps.lod", "bitmaps"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1466 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1467 delete pBitmaps_LOD_mm8;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1468 pBitmaps_LOD_mm8 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1469 Log::Warning(L"Unable to load mm8:bitmaps.lod");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1470 }
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 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1473 Log::Warning(L"Unable to find mm8:bitmaps.lod");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1474
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 if (_access("../mm8/data/sprites.lod", 0) == 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1477 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1478 pSprites_LOD_mm8 = new LODFile_Sprites;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1479 if (!pSprites_LOD_mm8->LoadSprites("../mm8/data/sprites.lod"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1480 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1481 delete pSprites_LOD_mm8;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1482 pSprites_LOD_mm8 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1483 Log::Warning(L"Unable to load mm8:sprites.lod");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1484 }
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 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1487 Log::Warning(L"Unable to find mm8:sprites.lod");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1488 #endif
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1489
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 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
1492 *sft_mm8 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1493 void *sft_mm7 = pEvents_LOD->LoadRaw("dsft.bin", 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1494 pSpriteFrameTable = new SpriteFrameTable;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1495 pSpriteFrameTable->FromFile(sft_mm6, sft_mm7, sft_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1496 free(sft_mm6);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1497 free(sft_mm7);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1498 free(sft_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1499
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1500 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
1501 *tft_mm8 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1502 void *tft_mm7 = pEvents_LOD->LoadRaw("dtft.bin", 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1503 pTextureFrameTable = new TextureFrameTable;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1504 pTextureFrameTable->FromFile(tft_mm6, tft_mm7, tft_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1505 free(tft_mm6);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1506 free(tft_mm7);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1507 free(tft_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1508
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1509 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
1510 *tiles_mm8 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1511 void *tiles_mm7 = pEvents_LOD->LoadRaw("dtile.bin", 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1512 pTileTable = new TileTable;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1513 pTileTable->FromFile(tiles_mm6, tiles_mm7, tiles_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1514 free(tiles_mm6);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1515 free(tiles_mm7);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1516 free(tiles_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1517
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1518 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
1519 *pft_mm8 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1520 void *pft_mm7 = pEvents_LOD->LoadRaw("dpft.bin", 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1521 pPlayerFrameTable = new PlayerFrameTable;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1522 pPlayerFrameTable->FromFile(pft_mm6, pft_mm7, pft_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1523 free(pft_mm6);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1524 free(pft_mm7);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1525 free(pft_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1526
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1527 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
1528 *ift_mm8 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1529 void *ift_mm7 = pEvents_LOD->LoadRaw("dift.bin", 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1530 pIconsFrameTable = new IconFrameTable;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1531 pIconsFrameTable->FromFile(ift_mm6, ift_mm7, ift_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1532 free(ift_mm6);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1533 free(ift_mm7);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1534 free(ift_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1535
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1536 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
1537 *decs_mm8 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1538 void *decs_mm7 = pEvents_LOD->LoadRaw("ddeclist.bin", 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1539 pDecorationList = new DecorationList;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1540 pDecorationList->FromFile(decs_mm6, decs_mm7, decs_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1541 free(decs_mm6);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1542 free(decs_mm7);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1543 free(decs_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1544
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1545 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
1546 *objs_mm8 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1547 void *objs_mm7 = pEvents_LOD->LoadRaw("dobjlist.bin", 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1548 pObjectList = new ObjectList;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1549 pObjectList->FromFile(objs_mm6, objs_mm7, objs_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1550 free(objs_mm6);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1551 free(objs_mm7);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1552 free(objs_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1553
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1554 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
1555 *mons_mm8 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1556 void *mons_mm7 = pEvents_LOD->LoadRaw("dmonlist.bin", 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1557 pMonsterList = new MonsterList;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1558 pMonsterList->FromFile(mons_mm6, mons_mm7, mons_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1559 free(mons_mm6);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1560 free(mons_mm7);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1561 free(mons_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1562
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1563 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
1564 *chests_mm8 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1565 void *chests_mm7 = pEvents_LOD->LoadRaw("dchest.bin", 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1566 pChestList = new ChestList;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1567 pChestList->FromFile(chests_mm6, chests_mm7, chests_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1568 free(chests_mm6);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1569 free(chests_mm7);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1570 free(chests_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1571
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1572 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
1573 *overlays_mm8 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1574 void *overlays_mm7 = pEvents_LOD->LoadRaw("doverlay.bin", 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1575 pOverlayList = new OverlayList;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1576 pOverlayList->FromFile(overlays_mm6, overlays_mm7, overlays_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1577 free(overlays_mm6);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1578 free(overlays_mm7);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1579 free(overlays_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1580
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1581 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
1582 *sounds_mm8 = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1583 void *sounds_mm7 = pEvents_LOD->LoadRaw("dsounds.bin", 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1584 pSoundList = new SoundList;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1585 pSoundList->FromFile(sounds_mm6, sounds_mm7, sounds_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1586 free(sounds_mm6);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1587 free(sounds_mm7);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1588 free(sounds_mm8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1589 }
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 if (dword_6BE368_debug_settings_2 & DEBUG_SETTINGS_RUN_IN_WIDOW)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1595 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1596 //window->SetWindowedMode(game_width, game_height);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1597 pRenderer->SwitchToWindow();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1598 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1599 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1600 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1601 __debugbreak(); // Nomad
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1602 window->SetFullscreenMode();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1603 pRenderer->InitializeFullscreen();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1604 }
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 uSoundVolumeMultiplier = min(9, ReadWindowsRegistryInt("soundflag", 9));
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1607 uMusicVolimeMultiplier = min(9, ReadWindowsRegistryInt("musicflag", 9));
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1608 uVoicesVolumeMultiplier = min(9, ReadWindowsRegistryInt("CharVoices", 9));
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1609 bShowDamage = ReadWindowsRegistryInt("ShowDamage", 1) != 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1610
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1611 uGammaPos = min(4, ReadWindowsRegistryInt("GammaPos", 4));
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1612 //pEngine->pGammaController->Initialize(uGammaPos * 0.1 + 0.6);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1613
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1614 if (ReadWindowsRegistryInt("Bloodsplats", 1))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1615 pEngine->uFlags2 |= GAME_FLAGS_2_DRAW_BLOODSPLATS;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1616 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1617 pEngine->uFlags2 &= ~GAME_FLAGS_2_DRAW_BLOODSPLATS;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1618
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1619 uTurnSpeed = ReadWindowsRegistryInt("TurnDelta", 3);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1620
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1621 if (!bNoSound)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1622 pAudioPlayer->Initialize();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1623
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1624 pMediaPlayer = new Media::MPlayer();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1625 pMediaPlayer->Initialize(window);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1626
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1627 dword_6BE364_game_settings_1 |= GAME_SETTINGS_4000;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1628
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1629 switch (uTurnSpeed)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1630 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1631 case 0: // undefined turn option
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1632 __debugbreak(); // really shouldn't use this mode
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1633 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
1634 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1635
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1636 case 1: // 16x
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1637 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
1638 uTurnSpeed = 128;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1639 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1640
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1641 case 2: // 32x
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1642 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
1643 uTurnSpeed = 64;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1644 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1645
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1646 case 3: // smooth
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1647 uTurnSpeed = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1648 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1649 }
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 return true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1652 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1653
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1654 //----- (00465D0B) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1655 void SecondaryInitialization()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1656 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1657 pMouse->Initialize(window);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1658
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1659 pItemsTable = new ItemsTable;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1660 pItemsTable->Initialize();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1661
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1662 //pBitmaps_LOD->can_load_hardware_sprites = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1663 //pBitmaps_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1664 pBitmaps_LOD->SetupPalettes(5, 6, 5);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1665 //pIcons_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1666 pIcons_LOD->SetupPalettes(5, 6, 5);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1667 //pPaletteManager->SetColorChannelInfo(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1668 pPaletteManager->SetColorChannelInfo(5, 6, 5);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1669
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1670 pPaletteManager->SetMistColor(128, 128, 128);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1671 pPaletteManager->RecalculateAll();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1672 //pSprites_LOD->can_load_hardware_sprites = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1673 pObjectList->InitializeSprites();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1674 pOverlayList->InitializeSprites();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1675
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1676 if (!bNoSound)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1677 pSoundList->Initialize();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1678
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 for (uint i = 0; i < 4; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1681 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1682 static const char *pUIAnimNames[4] =
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1683 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1684 "glow03", "glow05",
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1685 "torchA", "wizeyeA"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1686 };
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1687 static unsigned short _4E98D0[4][4] =
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1688 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1689 { 479, 0, 329, 0 },
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1690 { 585, 0, 332, 0 },
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1691 { 468, 0, 0, 0 },
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1692 { 606, 0, 0, 0 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1693 };
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1694
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1695 pUIAnims[i]->uIconID = pIconsFrameTable->FindIcon(pUIAnimNames[i]);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1696 pIconsFrameTable->InitializeAnimation(pUIAnims[i]->uIconID);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1697
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1698 pUIAnims[i]->uAnimLength = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1699 pUIAnims[i]->uAnimTime = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1700 pUIAnims[i]->x = _4E98D0[i][0];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1701 pUIAnims[i]->y = _4E98D0[i][2];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1702 }
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 for (unsigned int i = 0; i < pObjectList->uNumObjects; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1705 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1706 pObjectList->pObjects[i].uParticleTrailColor = pObjectList->pObjects[i].uParticleTrailColorB |
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1707 ((unsigned int)pObjectList->pObjects[i].uParticleTrailColorG << 8) |
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1708 ((unsigned int)pObjectList->pObjects[i].uParticleTrailColorR << 16);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1709 }
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 MainMenuUI_Create();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1712 pEngine->pStru6Instance->LoadAnimations();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1713
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1714 for (uint i = 0; i < 7; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1715 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1716 char container_name[64];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1717 sprintf(container_name, "HDWTR%03u", i);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1718 pRenderer->pHDWaterBitmapIDs[i] = pBitmaps_LOD->LoadTexture(container_name);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1719 }
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 pNPCStats = new NPCStats;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1722 memset(pNPCStats->pNPCData, 0, 0x94BCu);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1723 pNPCStats->Initialize();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1724
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1725 Initialize_GlobalEVT();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1726 pBitmaps_LOD->_inlined_sub0();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1727 pSprites_LOD->_inlined_sub0();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1728 pPaletteManager->LockAll();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1729
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1730 _mkdir("Saves");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1731 for (uint i = 0; i < 5; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1732 for (uint j = 0; j < 6; ++j)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1733 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1734 sprintf(pTmpBuf.data(), "data\\lloyd%d%d.pcx", i, j);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1735 remove(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1736 }
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 Initialize_GamesLOD_NewLOD();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1739 _576E2C_current_minimap_zoom = 512;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1740 dword_576E28 = 9;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1741 }
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 int max_flight_height = 4000; //maximum altitude
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1744 bool use_MMT = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1745 bool use_music_folder = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1746 bool for_refactoring = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1747
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1748 //----- (00462C94) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1749 bool MM_Main(const wchar_t *pCmdLine)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1750 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1751 IntegrityTest();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1752
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1753 lua = new LuaVM;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1754 lua->Initialize();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1755
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1756 bool bNoMargareth = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1757 if (pCmdLine && *pCmdLine)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1758 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1759 //if (wcsstr(pCmdLine, L"-usedefs"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1760 // bDebugResouces = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1761 if (wcsstr(pCmdLine, L"-window"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1762 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_RUN_IN_WIDOW;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1763
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1764 if (wcsstr(pCmdLine, L"-nointro"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1765 bNoIntro = true;//dword_6BE364_game_settings_1 |= 4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1766 if (wcsstr(pCmdLine, L"-nologo"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1767 bNoLogo = true;//dword_6BE364_game_settings_1 |= 8;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1768 if (wcsstr(pCmdLine, L"-nosound"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1769 bNoSound = true; //dword_6BE364_game_settings_1 |= 0x10;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1770
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1771 bWalkSound = ReadWindowsRegistryInt("WalkSound", 1) != 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1772 if (wcsstr(pCmdLine, L"-nowalksound"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1773 bWalkSound = false;//dword_6BE364_game_settings_1 |= 0x20;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1774 if (wcsstr(pCmdLine, L"-novideo"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1775 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1776 dword_6BE364_game_settings_1 |= GAME_SETTINGS_NO_HOUSE_ANIM;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1777 bNoVideo = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1778 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1779 if (wcsstr(pCmdLine, L"-nocd"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1780 bNoCD = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1781 if (wcsstr(pCmdLine, L"-nomarg"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1782 bNoMargareth = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1783 }
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 //_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
1786
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1787 if (!MM7_Initialize(640, 480))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1788 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1789 Log::Warning(L"MM init: failed");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1790 pEngine->Deinitialize();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1791 return 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1792 }
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 pEventTimer->Pause();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1795
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1796 SetUserInterface(PartyAlignment_Neutral, false);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1797
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1798 ShowLogoVideo();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1799 //ShowIntroVideo_and_LoadingScreen();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1800 WriteWindowsRegistryInt("Ran once", 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1801 dword_6BE364_game_settings_1 |= GAME_SETTINGS_4000;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1802 SecondaryInitialization();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1803 //pRenderer->SetRasterClipRect(0, 0, window->GetWidth() - 1, window->GetHeight() - 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1804 FinalInitialization();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1805
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1806 //Ritor1: include
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1807 if (use_MMT)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1808 MMT_MainMenu_Loop();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1809
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1810 Log::Warning(L"MM: entering main loop");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1811 while (1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1812 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1813 //MainMenuWindow* main_menu_window = MainMenuWindow::Create();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1814 //window->AddControl(main_menu_window);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1815 MainMenu_Loop();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1816 uGameState = GAME_STATE_PLAYING;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1817 while (1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1818 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1819 if (uGameState == GAME_FINISHED || GetCurrentMenuID() == MENU_EXIT_GAME)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1820 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1821 pEngine->Deinitialize();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1822 return true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1823 }
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 if (GetCurrentMenuID() == MENU_NEWGAME)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1826 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1827 if (use_music_folder)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1828 alSourceStop(mSourceID);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1829 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1830 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1831 if (pAudioPlayer->hAILRedbook)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1832 AIL_redbook_stop(pAudioPlayer->hAILRedbook);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1833 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1834 pParty->Reset();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1835 pOtherOverlayList->Reset();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1836 strcpy(pCurrentMapName, pStartingMapName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1837 pParty->CreateDefaultParty(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1838 PlayerCreationUI_Initialize();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1839 if (PlayerCreationUI_Loop())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1840 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1841 DeleteCCharFont();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1842 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1843 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1844 DeleteCCharFont();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1845 bFlashQuestBook = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1846 pMediaPlayer->PlayFullscreenMovie(MOVIE_Emerald, true);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1847 SaveNewGame();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1848 if (bNoMargareth)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1849 _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
1850 Game_Loop();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1851 if (uGameState == GAME_STATE_NEWGAME_OUT_GAMEMENU)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1852 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1853 SetCurrentMenuID(MENU_NEWGAME);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1854 uGameState = GAME_STATE_PLAYING;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1855 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1856 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1857 else if (uGameState == GAME_STATE_GAME_QUITTING_TO_MAIN_MENU)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1858 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1859 assert(false && "Invalid game state");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1860 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1861 if (GetCurrentMenuID() == MENU_CREDITS)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1862 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1863 if (use_music_folder)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1864 alSourceStop(mSourceID);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1865 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1866 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1867 if (pAudioPlayer->hAILRedbook)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1868 AIL_redbook_stop(pAudioPlayer->hAILRedbook);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1869 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1870 MainMenuUI_Credits_Loop();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1871 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1872 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1873 if (GetCurrentMenuID() == MENU_5 || GetCurrentMenuID() == MENU_LoadingProcInMainMenu)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1874 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1875 uGameState = GAME_STATE_PLAYING;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1876 Game_Loop();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1877 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1878 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1879 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1880 if (GetCurrentMenuID() == MENU_DebugBLVLevel)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1881 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1882 pMouse->ChangeActivation(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1883 pParty->Reset();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1884 pParty->CreateDefaultParty(1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1885
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1886 __debugbreak();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1887 /*extern void CreateDefaultBLVLevel();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1888 CreateDefaultBLVLevel();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1889
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1890 OPENFILENAMEA ofn;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1891 if ( !GetOpenFileNameA((LPOPENFILENAMEA)&ofn) )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1892 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1893 pMouse->ChangeActivation(1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1894 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1895 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1896 _chdir("..\\");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1897 strcpy(pCurrentMapName, ofn.lpstrFileTitle);*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1898 pMouse->ChangeActivation(1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1899 Game_Loop();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1900 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1901 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1902 if (uGameState == GAME_STATE_LOADING_GAME)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1903 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1904 SetCurrentMenuID(MENU_5);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1905 uGameState = GAME_STATE_PLAYING;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1906 continue;
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 if (uGameState == GAME_STATE_NEWGAME_OUT_GAMEMENU)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1909 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1910 SetCurrentMenuID(MENU_NEWGAME);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1911 uGameState = GAME_STATE_PLAYING;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1912 continue;
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 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
1915 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1916 pAudioPlayer->StopChannels(-1, -1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1917 uGameState = GAME_STATE_PLAYING;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1918 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1919 }
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 (!bNoSound)
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 if (use_music_folder)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1924 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1925 PlayAudio(L"Music\\14.mp3");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1926 alSourcef(mSourceID, AL_GAIN, pSoundVolumeLevels[uMusicVolimeMultiplier]);
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 else if (pAudioPlayer->hAILRedbook)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1929 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1930 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1931 AIL_redbook_stop(pAudioPlayer->hAILRedbook);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1932 unsigned int startms, end_ms;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1933 AIL_redbook_track_info(pAudioPlayer->hAILRedbook, 14, &startms, &end_ms);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1934 AIL_redbook_play(pAudioPlayer->hAILRedbook, startms + 1, end_ms);
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1937 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1938 //lua_close(L);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1939 pEngine->Deinitialize();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1940 return 1;
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1944
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1945 //----- (00466082) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1946 void MM6_Initialize(const wchar_t *pIniFilename)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1947 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1948 size_t v2; // eax@31
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1949 size_t v3; // ebx@32
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1950 size_t v4; // edi@36
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1951 char pDefaultGroundTexture[16]; // [sp+FCh] [bp-8Ch]@32
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1952 unsigned int v9; // [sp+184h] [bp-4h]@28
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1953
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1954 //_getcwd(v5, 120);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1955 //sprintfex(pIniFilename, "%s\\mm6.ini", v5);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1956 viewparams = new ViewingParams;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1957 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
1958 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
1959 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
1960 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
1961 game_viewport_width = game_viewport_z - game_viewport_x;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1962 game_viewport_height = game_viewport_w - game_viewport_y + 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1963
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1964
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1965 pAudioPlayer = new AudioPlayer;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1966 pAudioPlayer->uMixerChannels = GetPrivateProfileIntW(L"settings", L"mixerchannels", 16, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1967 if (pAudioPlayer->uMixerChannels > 16)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1968 pAudioPlayer->uMixerChannels = 16;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1969
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1970
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1971 if (GetPrivateProfileIntW(L"debug", L"nomonster", 0, pIniFilename))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1972 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_NO_ACTORS;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1973 if (ReadWindowsRegistryInt("startinwindow", 0))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1974 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_RUN_IN_WIDOW;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1975 if (GetPrivateProfileIntW(L"debug", L"showFR", 0, pIniFilename))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1976 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_0002_SHOW_FR;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1977 if (GetPrivateProfileIntW(L"debug", L"nodamage", 0, pIniFilename))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1978 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_NO_DAMAGE;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1979 if (GetPrivateProfileIntW(L"debug", L"nodecoration", 0, pIniFilename))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1980 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_NO_DECORATIONS;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1981
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1982 wchar_t pStartingMapNameW[1024];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1983 GetPrivateProfileStringW(L"file", L"startmap", L"out01.odm", pStartingMapNameW, 0x20u, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1984 sprintf(pStartingMapName, "%S", pStartingMapNameW);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1985
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1986 v9 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1987 if (strlen(pStartingMapName))
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 do
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1990 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1991 if (pStartingMapName[v9] == ' ')
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1992 pStartingMapName[v9] = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1993 ++v9;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1994 v2 = strlen(pStartingMapName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1995 } while (v9 < v2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1996 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1997
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1998 pODMRenderParams = new ODMRenderParams;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1999 pODMRenderParams->outdoor_no_mist = GetPrivateProfileIntW(L"debug", L"noMist", 0, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2000 pODMRenderParams->bNoSky = GetPrivateProfileIntW(L"outdoor", L"nosky", 0, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2001 pODMRenderParams->bDoNotRenderDecorations = GetPrivateProfileIntW(L"render", L"nodecorations", 0, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2002 pODMRenderParams->outdoor_no_wavy_water = GetPrivateProfileIntW(L"outdoor", L"nowavywater", 0, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2003 outdoor_grid_band_1 = GetPrivateProfileIntW(L"outdoor", L"gridband1", 10, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2004 outdoor_grid_band_2 = GetPrivateProfileIntW(L"outdoor", L"gridband2", 15, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2005 outdoor_grid_band_3 = GetPrivateProfileIntW(L"outdoor", L"gridband3", 25, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2006 pODMRenderParams->terrain_gamma = GetPrivateProfileIntW(L"outdoor", L"ter_gamma", 0, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2007 pODMRenderParams->building_gamme = GetPrivateProfileIntW(L"outdoor", L"bld_gamma", 0, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2008 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
2009 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
2010
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2011 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
2012
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2013 wchar_t pDefaultSkyTextureW[1024];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2014 GetPrivateProfileStringW(L"textures", L"sky", L"plansky1", pDefaultSkyTextureW, 0x10u, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2015 sprintf(pDefaultSkyTexture.data(), "%S", pDefaultSkyTextureW);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2016
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2017 wchar_t pDefaultGroundTextureW[1024];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2018 GetPrivateProfileStringW(L"textures", L"default", L"dirt", pDefaultGroundTextureW, 0x10u, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2019 sprintf(pDefaultGroundTexture, "%S", pDefaultGroundTextureW);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2020
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2021 wchar_t pFloat[1024];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2022 GetPrivateProfileStringW(L"debug", L"recmod1", L"1.0", pFloat, 0x10u, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2023 swscanf(pFloat, L"%f", &flt_6BE3A4_debug_recmod1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2024
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2025 GetPrivateProfileStringW(L"debug", L"recmod2", L"1.0", pFloat, 0x10u, pIniFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2026 swscanf(pFloat, L"%f", &flt_6BE3A8_debug_recmod2);
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 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
2029
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2030 v3 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2031 if (strlen(pDefaultSkyTexture.data()))
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 do
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2034 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2035 if (pDefaultSkyTexture[v3] == ' ')
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2036 pDefaultSkyTexture[v3] = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2037 ++v3;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2038 } while (v3 < strlen(pDefaultSkyTexture.data()));
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2039 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2040 v4 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2041 if (strlen(pDefaultGroundTexture))
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 do
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2044 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2045 if (pDefaultGroundTexture[v4] == ' ')
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2046 pDefaultGroundTexture[v4] = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2047 ++v4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2048 } while (v4 < strlen(pDefaultGroundTexture));
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2049 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2050
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2051 MM7Initialization();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2052 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2053
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2054 //----- (004666D5) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2055 void MM7Initialization()
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 (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
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 /*if (byte_6BE388_graphicsmode == 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2060 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2061 outdoor_grid_band_1 = 10;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2062 outdoor_grid_band_2 = 15;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2063 outdoor_grid_band_3 = 20;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2064 pODMRenderParams->shading_dist_mist = 8192;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2065 pODMRenderParams->bNoSky = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2066 LOBYTE(viewparams->field_20) = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2067 }*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2068 pODMRenderParams->shading_dist_shade = 2048;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2069 pODMRenderParams->terrain_gamma = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2070 pODMRenderParams->building_gamme = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2071 pODMRenderParams->shading_dist_shademist = 4096;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2072 pODMRenderParams->outdoor_no_wavy_water = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2073 //_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
2074 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2075 pODMRenderParams->outdoor_grid_band_3 = outdoor_grid_band_3;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2076 pODMRenderParams->uPickDepth = outdoor_grid_band_3 * 512;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2077 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2078 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2079 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2080 LOBYTE(viewparams->field_20) = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2081 pParty->uFlags |= 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2082 viewparams->uSomeY = viewparams->uScreen_topL_Y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2083 viewparams->uSomeX = viewparams->uScreen_topL_X;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2084 viewparams->uSomeZ = viewparams->uScreen_BttmR_X;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2085 viewparams->uSomeW = viewparams->uScreen_BttmR_Y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2086
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2087 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
2088 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2089 pODMRenderParams->Initialize();
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2092 //----- (004610AA) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2093 void __fastcall PrepareToLoadODM(unsigned int bLoading, ODMRenderParams *a2)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2094 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2095 pGameLoadingUI_ProgressBar->Reset(27);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2096 pSoundList->_4A9D79(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2097 uCurrentlyLoadedLevelType = LEVEL_Outdoor;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2098 ODM_LoadAndInitialize(pCurrentMapName, a2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2099 if (!bLoading)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2100 TeleportToStartingPoint(uLevel_StartingPointType);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2101 viewparams->_443365();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2102 PlayLevelMusic();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2103 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2104 // 6BE35C: using guessed type int uLevel_StartingPointType;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2105
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2106
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 //----- (004BF91E) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2109 unsigned int GameOverMenu(void *ecx0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2110 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2111 const char *v1; // eax@2
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2112 unsigned int result; // eax@3
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2113 const char *v6; // eax@10
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2114 const char *v7; // edx@10
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2115 const char *v8; // ecx@12
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2116 const char *v9; // eax@14
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2117 unsigned int v10; // eax@25
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2118 GUIWindow pWindow; // [sp+34h] [bp-9Ch]@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2119 unsigned int v14; // [sp+A4h] [bp-2Ch]@5
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2120 void *v15; // [sp+A8h] [bp-28h]@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2121 const char *pInString; // [sp+ACh] [bp-24h]@5
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2122 unsigned int v17; // [sp+B0h] [bp-20h]@5
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2123 unsigned int v18; // [sp+B4h] [bp-1Ch]@5
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2124 unsigned int v19; // [sp+B8h] [bp-18h]@5
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2125 int v20; // [sp+BCh] [bp-14h]@7
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2126 GUIFont *pFont; // [sp+C4h] [bp-Ch]@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2127 unsigned __int64 v23; // [sp+C8h] [bp-8h]@5
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2128 MSG msg;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2129
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2130 v15 = ecx0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2131
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2132 RGBTexture _this; // [sp+Ch] [bp-C4h]@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2133 //RGBTexture::RGBTexture(&this);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2134
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2135 dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_4000;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2136 bGameoverLoop = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2137 pMediaPlayer->bStopBeforeSchedule = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2138 pAudioPlayer->StopChannels(-1, -1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2139 pRenderer->BeginScene();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2140 pRenderer->ClearBlack();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2141 pRenderer->EndScene();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2142 pRenderer->Present();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2143 //pMediaPlayer->pResetflag = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2144 _449B57_test_bit(pParty->_quest_bits, 99);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2145 _this.Load("winbg.pcx", 2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2146 pRenderer->BeginScene();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2147 pRenderer->DrawTextureRGB(0, 0, &_this);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2148 pRenderer->EndScene();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2149 free(_this.pPixels);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2150 _this.pPixels = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2151 window_SpeakInHouse = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_MainMenu, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2152 pWindow.uFrameX = 75;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2153 pWindow.uFrameY = 60;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2154 pWindow.uFrameWidth = 469;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2155 pWindow.uFrameHeight = 338;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2156 pWindow.uFrameZ = 543;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2157 pWindow.uFrameW = 397;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2158 pFont = LoadFont("endgame.fnt", "FONTPAL", NULL);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2159 if (pParty->IsPartyGood())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2160 v1 = pGlobalTXT_LocalizationStrings[675];//"Splendid job! With the activation of the Gate, a thousand worlds lie at your feet. Perhaps on one of them you will find the Ancients themselves, and return with the fruits their great civilization has to offer your world and your kingdom."
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2161 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2162 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2163 result = pParty->IsPartyEvil();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2164 if (!(short)result)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2165 return result;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2166 v1 = pGlobalTXT_LocalizationStrings[676];//"Brilliant! The completion of the Heavenly Forge has provided enough Ancient weapons to crush all resistance to your plans. Soon the world will bow to your every whim! Still, you can't help but wonder what was beyond the Gate the other side was trying so hard to build."
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 pInString = v1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2169 v23 = pParty->uTimePlayed - 138240;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2170 v19 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 24;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2171 v14 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 24 / 0x1C / 0xC;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2172 v18 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 24 / 0x1C % 0xC;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2173 v17 = v19 % 0x1C;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2174 if (!v19)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2175 v19 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2176 pRenderer->BeginScene();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2177 pWindow.DrawTitleText(pFont, 1, 0x23, 1, pGlobalTXT_LocalizationStrings[9], 3);//Congratulations!
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2178 v23 = 0i64;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2179 v20 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2180 for (uint i = 0; i < 4; i++)
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 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[129], pParty->pPlayers[i].pName, pParty->pPlayers[i].GetBaseLevel(), pClassNames[pParty->pPlayers[i].classType]);//%s the Level %u %s
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2183 pWindow.DrawTitleText(pFont, 1, i * (LOBYTE(pFont->uFontHeight) - 2) + LOBYTE(pFont->uFontHeight) + 46, 1, pTmpBuf.data(), 3);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2184 v23 += pParty->pPlayers[i].uExperience;//__PAIR__(*(int *)(i - 4), *(int *)(i - 8));
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2185 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2186 v23 = (signed __int64)v23 / v19;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2187 v6 = FitTextInAWindow(pInString, pFont, &pWindow, 0xC, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2188 pWindow.DrawTitleText(pFont, 1, 5 * (LOBYTE(pFont->uFontHeight) + 11), 1, v6, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2189 strcpy(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[37]);//Total Time:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2190
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2191 v7 = pGlobalTXT_LocalizationStrings[56];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2192 if (v17 != 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2193 v7 = pGlobalTXT_LocalizationStrings[57];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2194
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2195 v8 = pGlobalTXT_LocalizationStrings[146];//Month
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2196 if (v18 != 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2197 v8 = pGlobalTXT_LocalizationStrings[148];//Months
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 v9 = pGlobalTXT_LocalizationStrings[245];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2200 if (v14 != 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2201 v9 = pGlobalTXT_LocalizationStrings[132];
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 sprintf(pTmpBuf2.data(), " %lu %s, %lu %s, %lu %s ", v14, v9, v18, v8, v17, v7);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2204 strcat(pTmpBuf.data(), pTmpBuf2.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2205 pWindow.DrawTitleText(pFont, 1, pWindow.uFrameHeight - 2 * LOBYTE(pFont->uFontHeight) - 5, 1, pTmpBuf.data(), 3);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2206 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[94], v23);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2207 pWindow.DrawTitleText(pFont, 1, pWindow.uFrameHeight, 1, pTmpBuf.data(), 3);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2208 dword_6BE364_game_settings_1 |= GAME_SETTINGS_4000;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2209 pRenderer->EndScene();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2210 pRenderer->Present();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2211 //if ( pRenderer->pRenderD3D )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2212 pRenderer->pBeforePresentFunction();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2213 pRenderer->SaveWinnersCertificate("MM7_Win.Pcx");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2214 free(pFont);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2215 window_SpeakInHouse->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2216 window_SpeakInHouse = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2217 if (v15 == (void *)2)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2218 result = pMessageQueue_50CBD0->uNumMessages;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2219 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2220 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2221 LODWORD(v23) = GetTickCount() + 5000;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2222 while ((unsigned int)v23 > GetTickCount())
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 while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2225 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2226 if (msg.message == WM_QUIT)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2227 Engine_DeinitializeAndTerminate(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2228 TranslateMessage(&msg);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2229 DispatchMessage(&msg);
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 if (pMessageQueue_50CBD0->uNumMessages)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2232 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2233 LOBYTE(v10) = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2234 pMessageQueue_50CBD0->uNumMessages = v10;
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 pKeyActionMap->ResetKeys();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2237 pKeyActionMap->uLastKeyPressed = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2238 do
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2239 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2240 while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2241 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2242 if (msg.message == WM_QUIT)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2243 Engine_DeinitializeAndTerminate(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2244 TranslateMessage(&msg);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2245 DispatchMessage(&msg);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2246 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2247 } while (!pKeyActionMap->uLastKeyPressed);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2248 result = pMessageQueue_50CBD0->uNumMessages;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2249 if (pMessageQueue_50CBD0->uNumMessages)
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 result = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2252 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2253 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2254 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2255 if (v15)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2256 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2257 /*if ( (signed int)result < 40 )
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 pMessageQueue_50CBD0->pMessages[result].eType = UIMSG_Quit;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2260 }*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2261 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Quit, 1, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2262 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2263 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2264 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2265 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_ShowFinalWindow, 1, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2266 /*if ( (signed int)result < 40 )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2267 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2268 pMessageQueue_50CBD0->pMessages[result].eType = UIMSG_C5;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2269 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2270 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2271 *(&pMessageQueue_50CBD0->uNumMessages + result) = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2272 ++pMessageQueue_50CBD0->uNumMessages;
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2275 bGameoverLoop = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2276 return result;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2277 }
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 //----- (00464479) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2280 void ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2281 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2282 int v0; // esi@9
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 if (pMouse)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2285 pMouse->SetCursorBitmap("MICON1");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2286
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2287 pPaletteManager->ResetNonLocked();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2288 pBitmaps_LOD->ReleaseAll2();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2289 pSprites_LOD->DeleteSomeOtherSprites();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2290 pIcons_LOD->ReleaseAll2();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2291
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2292 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2293 pIndoor->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2294 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2295 pOutdoor->Release();
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 pAudioPlayer->StopChannels(-1, -1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2298 pSoundList->_4A9D79(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2299 uCurrentlyLoadedLevelType = LEVEL_null;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2300 pSpriteFrameTable->ResetSomeSpriteFlags();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2301 v0 = uNumVisibleWindows;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2302 pParty->armageddon_timer = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2303 while (v0 > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2304 pWindowList[pVisibleWindowsIdxs[v0--] - 1].Release();
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 //----- (00461103) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2308 void _461103_load_level_sub()
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 int v4; // edx@8
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2311 signed int v6; // esi@14
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2312 signed int v8; // ecx@16
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2313 int v12; // esi@25
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2314 int v13; // eax@26
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2315 __int16 v14; // ax@41
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2316 signed int v17; // [sp+14h] [bp-48h]@3
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2317 signed int v18; // [sp+14h] [bp-48h]@23
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2318 int v19; // [sp+18h] [bp-44h]@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2319 signed int v20; // [sp+18h] [bp-44h]@14
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2320 int v21[16]; // [sp+1Ch] [bp-40h]@17
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2321
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2322 GenerateItemsInChest();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2323 pGameLoadingUI_ProgressBar->Progress();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2324 pParty->uFlags |= 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2325 pParty->field_7B5_in_arena_quest = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2326 dword_5C6DF8 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2327 pNPCStats->uNewlNPCBufPos = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2328 v19 = pMapStats->GetMapInfo(pCurrentMapName);
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 //v15 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2331 for (uint i = 0; i < uNumActors; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2332 //if ( (signed int)uNumActors > 0 )
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 //Actor* pActor = &pActors[i];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2335 //v2 = (char *)&pActors[0].uNPC_ID;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2336 //do
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2337 //{
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2338 //v3 = pActors[i].pMonsterInfo.uID;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2339 v17 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2340 if (pActors[i].pMonsterInfo.uID >= 115 && pActors[i].pMonsterInfo.uID <= 186
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2341 || pActors[i].pMonsterInfo.uID >= 232 && pActors[i].pMonsterInfo.uID <= 249)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2342 v17 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2343 //v1 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2344 v4 = (pActors[i].pMonsterInfo.uID - 1) % 3;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2345 if (2 == v4)
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 if (pActors[i].sNPC_ID && pActors[i].sNPC_ID < 5000)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2348 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2349 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2350 else
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 if (v4 != 1)
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 if (v4 == 0 && pActors[i].sNPC_ID == 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2355 pActors[i].sNPC_ID = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2356 continue;
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2359 if (pActors[i].sNPC_ID > 0 && pActors[i].sNPC_ID < 5000)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2360 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2361 if (v17)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2362 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2363 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
2364 v14 = LOWORD(pNPCStats->uNewlNPCBufPos) + 5000;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2365 ++pNPCStats->uNewlNPCBufPos;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2366 pActors[i].sNPC_ID = v14;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2367 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2368 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2369 pActors[i].sNPC_ID = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2370 //++v15;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2371 //v2 += 836;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2372 //}
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2373 //while ( v15 < (signed int)uNumActors );
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2376 pGameLoadingUI_ProgressBar->Progress();
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 //v5 = uNumActors;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2379 v6 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2380 v20 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2381 //v16 = v1;
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 for (uint i = 0; i < uNumActors; ++i)
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 //v7 = (char *)&pActors[0].pMonsterInfo;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2386 //do
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2387 //{
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2388 for (v8 = 0; v8 < v6; ++v8)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2389 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2390 if (v21[v8] == pActors[i].pMonsterInfo.uID - 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2391 break;
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2394 if (v8 == v6)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2395 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2396 v21[v6++] = pActors[i].pMonsterInfo.uID - 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2397 v20 = v6;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2398 if (v6 == 16)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2399 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2400 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2401 //++v16;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2402 //v7 += 836;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2403 //}
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2404 //while ( v16 < (signed int)v5 );
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2405 }
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 pGameLoadingUI_ProgressBar->Progress();
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 (int _v0 = 0; _v0 < v6; ++_v0)
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 for (v18 = 4; v18; --v18)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2412 pSoundList->LoadSound(pMonsterList->pMonsters[v21[_v0]].pSoundSampleIDs[4 - v18], 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2413 v12 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2414 do
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2415 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
2416 while (v13);
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 //v0 = pGameLoadingUI_ProgressBar;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2419 //v1 = 0;
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 pGameLoadingUI_ProgressBar->Progress();
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 if (dword_6BE368_debug_settings_2 & DEBUG_SETTINGS_NO_ACTORS)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2424 uNumActors = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2425 if (dword_6BE368_debug_settings_2 & DEBUG_SETTINGS_NO_DECORATIONS)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2426 uNumLevelDecorations = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2427 init_event_triggers();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2428
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2429 pGameLoadingUI_ProgressBar->Progress();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2430
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2431 pEngine->pIndoorCameraD3D->vPartyPos.x = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2432 pEngine->pIndoorCameraD3D->vPartyPos.y = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2433 pEngine->pIndoorCameraD3D->vPartyPos.z = 100;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2434 pEngine->pIndoorCameraD3D->sRotationX = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2435 pEngine->pIndoorCameraD3D->sRotationY = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2436 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2437 uLevel_StartingPointType = MapStartPoint_Party;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2438 pSprites_LOD->_461397();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2439 pPaletteManager->LockTestAll();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2440 if (pParty->pPickedItem.uItemID != 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2441 pMouse->SetCursorBitmapFromItemID(pParty->pPickedItem.uItemID);
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2444 //----- (0042F3D6) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2445 void InitializeTurnBasedAnimations(void *_this)
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 for (unsigned int i = 0; i < pIconIDs_Turn.size(); ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2448 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2449 char icon_name[32];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2450 sprintf(icon_name, "turn%u", i);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2451 pIconIDs_Turn[i] = pIconsFrameTable->FindIcon(icon_name);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2452 pIconsFrameTable->InitializeAnimation(pIconIDs_Turn[i]);
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2455 uIconID_TurnStop = pIconsFrameTable->FindIcon("turnstop");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2456 uIconID_TurnHour = pIconsFrameTable->FindIcon("turnhour");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2457 uIconID_TurnStart = pIconsFrameTable->FindIcon("turnstart");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2458 uIconID_CharacterFrame = pIconsFrameTable->FindIcon("aframe1");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2459 uSpriteID_Spell11 = pSpriteFrameTable->FastFindSprite("spell11");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2460
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2461 pIconsFrameTable->InitializeAnimation(uIconID_TurnHour);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2462 pIconsFrameTable->InitializeAnimation(uIconID_TurnStop);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2463 pIconsFrameTable->InitializeAnimation(uIconID_TurnStart);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2464 pIconsFrameTable->InitializeAnimation(uIconID_CharacterFrame);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2465 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2466
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2467 //----- (0046BDA8) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2468 unsigned int GetGravityStrength()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2469 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2470 int v0; // eax@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2471
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2472 v0 = ~LOBYTE(pEngine->uFlags2) & 8;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2473 LOBYTE(v0) = v0 | 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2474 return (unsigned int)v0 >> 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2475 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2476
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2477 //----- (00448B45) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2478 void GameUI_StatusBar_UpdateTimedString(unsigned int bForceHide)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2479 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2480 if (bForceHide || GameUI_Footer_TimeLeft && GetTickCount() >= GameUI_Footer_TimeLeft)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2481 GameUI_Footer_TimeLeft = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2482 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2483
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2484 //----- (0044861E) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2485 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
2486 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2487 unsigned int texture; // eax@2
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 if (uFaceCog)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2490 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2491 texture = pBitmaps_LOD->LoadTexture(pFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2492 if (texture != -1 ? (int)&pBitmaps_LOD->pTextures[texture] : 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2493 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2494 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
2495
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2496 if (uCurrentlyLoadedLevelType == 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2497 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2498 if ((signed int)pIndoor->uNumFaceExtras > 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2499 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2500 for (uint i = 1; i < (signed int)pIndoor->uNumFaceExtras; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2501 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2502 if (pIndoor->pFaceExtras[i].sCogNumber == uFaceCog)
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 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
2505 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2506 pIndoor->pFaces[pIndoor->pFaceExtras[i].field_C].uBitmapID = pTextureFrameTable->FindTextureByName(pFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2507 if (pIndoor->pFaces[pIndoor->pFaceExtras[i].field_C].uBitmapID)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2508 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2509 pTextureFrameTable->LoadAnimationSequenceAndPalettes(pIndoor->pFaces[pIndoor->pFaceExtras[i].field_C].uBitmapID);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2510 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2511 else
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 pIndoor->pFaces[pIndoor->pFaceExtras[i].field_C].uBitmapID = texture;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2514 pIndoor->pFaces[pIndoor->pFaceExtras[i].field_C].uAttributes &= 0xFFFFBFFF;
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2517 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2518 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2519 pIndoor->pFaces[pIndoor->pFaceExtras[i].field_C].uBitmapID = texture;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2520 }
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2523 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2524 pParty->uFlags |= 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2525 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2526 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2527 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2528 for (uint j = 0; j < (unsigned int)pOutdoor->uNumBModels; ++j)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2529 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2530 for (uint i = 0; i < pOutdoor->pBModels[j].uNumFaces; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2531 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2532 if (pOutdoor->pBModels[j].pFaces[i].sCogNumber == uFaceCog)
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 if (pOutdoor->pBModels[j].pFaces[i].uAttributes & FACE_TEXTURE_FRAME)
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 pOutdoor->pBModels[j].pFaces[i].uTextureID = pTextureFrameTable->FindTextureByName(pFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2537 if (pOutdoor->pBModels[j].pFaces[i].uTextureID)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2538 pTextureFrameTable->LoadAnimationSequenceAndPalettes(pOutdoor->pBModels[j].pFaces[i].uTextureID);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2539 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2540 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2541 pOutdoor->pBModels[j].pFaces[i].uTextureID = texture;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2542 pOutdoor->pBModels[j].pFaces[i].uAttributes &= 0xFFFFBFFF;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2543 }
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 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2546 pOutdoor->pBModels[j].pFaces[i].uTextureID = texture;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2547 }
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2550 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2551 pParty->uFlags |= 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2552 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2553 }
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2556 //----- (0044892E) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2557 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
2558 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2559 if (sCogNumber)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2560 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2561 if (uCurrentlyLoadedLevelType == 1)
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 for (uint i = 1; i < (unsigned int)pIndoor->uNumFaceExtras; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2564 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2565 if (pIndoor->pFaceExtras[i].sCogNumber == sCogNumber)
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 if (on)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2568 pIndoor->pFaces[pIndoor->pFaceExtras[i].field_C].uAttributes |= bit;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2569 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2570 pIndoor->pFaces[pIndoor->pFaceExtras[i].field_C].uAttributes &= ~bit;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2571 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2572 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2573 pParty->uFlags |= 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2574 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2575 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2576 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2577 for (uint j = 0; j < (unsigned int)pOutdoor->uNumBModels; ++j)
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 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
2580 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2581 if (pOutdoor->pBModels[j].pFaces[i].sCogNumber == sCogNumber)
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 if (on)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2584 pOutdoor->pBModels[j].pFaces[i].uAttributes |= bit;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2585 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2586 pOutdoor->pBModels[j].pFaces[i].uAttributes &= ~bit;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2587 }
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2590 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2591 pParty->uFlags |= 2;
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2595 //----- (0044882F) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2596 void __fastcall SetDecorationSprite(uint16_t uCog, bool bHide, const char *pFileName)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2597 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2598 for (size_t i = 0; i < uNumLevelDecorations; i++)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2599 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2600 if (pLevelDecorations[i].uCog == uCog)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2601 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2602 if (pFileName && strcmp(pFileName, "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 pLevelDecorations[i].uDecorationDescID = pDecorationList->GetDecorIdByName(pFileName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2605 pDecorationList->InitializeDecorationSprite(pLevelDecorations[i].uDecorationDescID);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2606 }
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 if (bHide)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2609 pLevelDecorations[i].uFlags &= ~LEVEL_DECORATION_INVISIBLE;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2610 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2611 pLevelDecorations[i].uFlags |= LEVEL_DECORATION_INVISIBLE;
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 pParty->uFlags |= 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2614 }
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2618 //----- (004356FF) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2619 void back_to_game()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2620 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2621 dword_507BF0_is_there_popup_onscreen = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2622 dword_4E455C = 1;
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 extern int no_rightlick_in_inventory;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2625 no_rightlick_in_inventory = false;
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 if (pGUIWindow_ScrollWindow)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2628 free_book_subwindow();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2629 if (!current_screen_type && !pGUIWindow_Settings)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2630 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2631 viewparams->bRedrawGameUI = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2632 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2633
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2634 //----- (00494035) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2635 void _494035_timed_effects__water_walking_damage__etc()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2636 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2637 signed __int64 v0; // qax@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2638 unsigned int v4; // edi@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2639 // signed int v12; // edi@29
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2640 int v24; // ecx@60
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2641 int v26; // ecx@64
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2642 int v28; // ecx@68
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2643 int v30; // ecx@72
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2644 int v32; // ecx@76
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2645 int v34; // ecx@80
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2646 int v36; // ecx@84
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2647 int v38; // ecx@88
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2648 int v40; // ecx@92
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2649 int v42; // ecx@96
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2650 bool v43; // ebx@102
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2651 bool v46; // edi@111
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2652 // unsigned int v56; // [sp-8h] [bp-38h]@55
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2653 // int v59; // [sp-4h] [bp-34h]@55
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2654 // unsigned int v61; // [sp+14h] [bp-1Ch]@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2655 signed int a2a; // [sp+18h] [bp-18h]@47
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2656 signed int old_day; // [sp+1Ch] [bp-14h]@47
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2657 signed int old_hour;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2658
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2659 old_day = pParty->uDaysPlayed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2660 old_hour = pParty->uCurrentHour;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2661 //auto prev_time = pEventTimer->uTimeElapsed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2662 pParty->uTimePlayed += pEventTimer->uTimeElapsed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2663 v0 = ((signed __int64)(pParty->uTimePlayed * 0.234375) / 60) / 60i64;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2664 v4 = (unsigned int)(((unsigned int)v0 / 24) / 7) >> 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2665 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
2666 pParty->uCurrentMinute = ((signed __int64)(pParty->uTimePlayed * 0.234375) / 60) % 60;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2667 pParty->uCurrentHour = v0 % 24;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2668 pParty->uCurrentMonthWeek = ((unsigned int)v0 / 24) / 7 & 3;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2669 pParty->uDaysPlayed = (unsigned int)((unsigned int)v0 / 24) % 28;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2670 pParty->uCurrentMonth = v4 % 12;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2671 pParty->uCurrentYear = v4 / 0xC + game_starting_year;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2672 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
2673 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2674 pParty->pHirelings[0].bHasUsedTheAbility = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2675 pParty->pHirelings[1].bHasUsedTheAbility = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2676
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2677 for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2678 pNPCStats->pNewNPCData[i].bHasUsedTheAbility = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2679
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2680 ++pParty->days_played_without_rest;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2681 if (pParty->days_played_without_rest > 1)
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 for (uint i = 0; i < 4; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2684 pParty->pPlayers[i].SetCondWeakWithBlockCheck(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2685
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2686 if (pParty->uNumFoodRations)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2687 Party::TakeFood(1);
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 for (uint i = 0; i < 4; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2690 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
2691
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2692 if (pParty->days_played_without_rest > 3)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2693 for (uint i = 0; i < 4; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2694 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2695 pParty->pPlayers[i].Zero();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2696 if (!pParty->pPlayers[i].IsPertified() && !pParty->pPlayers[i].IsEradicated()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2697 && !pParty->pPlayers[i].IsDead())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2698 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2699 if (rand() % 100 < 5 * pParty->days_played_without_rest)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2700 pParty->pPlayers[i].SetCondDeadWithBlockCheck(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2701 if (rand() % 100 < 10 * pParty->days_played_without_rest)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2702 pParty->pPlayers[i].SetCondInsaneWithBlockCheck(0);
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2706 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2707 pOutdoor->SetFog();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2708
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2709 for (uint i = 0; i < 4; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2710 pParty->pPlayers[i].uNumDivineInterventionCastsThisDay = 0;
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2713 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
2714 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2715 pParty->field_6FC = (signed __int64)pParty->uTimePlayed + 128;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2716 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2717 for (uint pl = 1; pl <= 4; ++pl)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2718 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2719 if (pPlayers[pl]->WearsItem(ITEM_RELIC_HARECS_LEATHER, EQUIP_ARMOUR)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2720 || pPlayers[pl]->HasEnchantedItemEquipped(71)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2721 || pPlayers[pl]->pPlayerBuffs[PLAYER_BUFF_WATER_WALK].uExpireTime > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2722 pPlayers[pl]->PlayEmotion(CHARACTER_EXPRESSION_37, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2723 else
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 (!pPlayers[pl]->HasUnderwaterSuitEquipped())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2726 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2727 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
2728 if (pParty->uFlags & 4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2729 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2730 strcpy(GameUI_Footer_TimedString.data(), pGlobalTXT_LocalizationStrings[660]);// Âû òîíåòå!
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2731 GameUI_Footer_TimeLeft = 128;
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2734 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2735 pPlayers[pl]->PlayEmotion(CHARACTER_EXPRESSION_37, 0);
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 }
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 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
2740 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2741 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2742 pParty->field_6FC = (signed __int64)pParty->uTimePlayed + 128;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2743
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2744 for (uint pl = 1; pl <= 4; pl++)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2745 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2746 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
2747 if (pParty->uFlags & 0x200)
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 strcpy(GameUI_Footer_TimedString.data(), pGlobalTXT_LocalizationStrings[661]); //Âû ãîðèòå!
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2750 GameUI_Footer_TimeLeft = 128;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2751 }
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2754 _493938_regenerate();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2755 uint party_condition_flag = 4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2756 a2a = pEventTimer->uTimeElapsed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2757 if (pParty->uFlags2 & PARTY_FLAGS_2_RUNNING)//çàìåäëåíèå âîññòàíîâëåíèÿ ïðè áåãå
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 a2a *= 0.5f;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2760 if (a2a < 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2761 a2a = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2762 }
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]->uTimeToRecovery)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2767 pPlayers[pl]->Recover(a2a);//âîññòàíîâëåíèå àêòèâíîñòè
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2768 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
2769 || (signed __int64)pPlayers[pl]->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2770 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2771 if (pPlayers[pl]->sHealth < 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2772 pPlayers[pl]->SetCondition(Condition_Unconcious, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2773 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2774 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2775 pPlayers[pl]->SetCondition(Condition_Dead, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2776 if (pPlayers[pl]->field_E0)
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 v24 = pPlayers[pl]->field_E0 - pEventTimer->uTimeElapsed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2779 if (v24 > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2780 pPlayers[pl]->field_E0 = v24;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2781 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2782 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2783 pPlayers[pl]->field_E0 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2784 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2785 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2786 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2787 if (pPlayers[pl]->field_E4)
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 v26 = pPlayers[pl]->field_E4 - pEventTimer->uTimeElapsed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2790 if (v26 > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2791 pPlayers[pl]->field_E4 = v26;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2792 else
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 pPlayers[pl]->field_E4 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2795 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2796 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2797 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2798 if (pPlayers[pl]->field_E8)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2799 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2800 v28 = pPlayers[pl]->field_E8 - pEventTimer->uTimeElapsed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2801 if (v28 > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2802 pPlayers[pl]->field_E8 = v28;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2803 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2804 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2805 pPlayers[pl]->field_E8 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2806 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2807 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2808 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2809 if (pPlayers[pl]->field_EC)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2810 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2811 v30 = pPlayers[pl]->field_EC - pEventTimer->uTimeElapsed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2812 if (v30 > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2813 pPlayers[pl]->field_EC = v30;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2814 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2815 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2816 pPlayers[pl]->field_EC = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2817 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2818 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2819 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2820 if (pPlayers[pl]->field_F0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2821 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2822 v32 = pPlayers[pl]->field_F0 - pEventTimer->uTimeElapsed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2823 if (v32 > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2824 pPlayers[pl]->field_F0 = v32;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2825 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2826 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2827 pPlayers[pl]->field_F0 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2828 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2829 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2830 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2831 if (pPlayers[pl]->field_F4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2832 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2833 v34 = pPlayers[pl]->field_F4 - pEventTimer->uTimeElapsed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2834 if (v34 > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2835 pPlayers[pl]->field_F4 = v34;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2836 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2837 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2838 pPlayers[pl]->field_F4 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2839 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2840 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2841 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2842 if (pPlayers[pl]->field_F8)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2843 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2844 v36 = pPlayers[pl]->field_F8 - pEventTimer->uTimeElapsed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2845 if (v36 > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2846 pPlayers[pl]->field_F8 = v36;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2847 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2848 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2849 pPlayers[pl]->field_F8 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2850 viewparams->bRedrawGameUI = true;
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2853 if (pPlayers[pl]->field_FC)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2854 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2855 v38 = pPlayers[pl]->field_FC - pEventTimer->uTimeElapsed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2856 if (v38 > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2857 pPlayers[pl]->field_FC = v38;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2858 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2859 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2860 pPlayers[pl]->field_FC = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2861 viewparams->bRedrawGameUI = true;
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 if (pPlayers[pl]->field_100)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2865 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2866 v40 = pPlayers[pl]->field_100 - pEventTimer->uTimeElapsed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2867 if (v40 > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2868 pPlayers[pl]->field_100 = v40;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2869 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2870 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2871 pPlayers[pl]->field_100 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2872 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2873 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2874 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2875 if (pPlayers[pl]->field_104)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2876 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2877 v42 = pPlayers[pl]->field_104 - pEventTimer->uTimeElapsed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2878 if (v42 > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2879 pPlayers[pl]->field_104 = v42;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2880 else
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 pPlayers[pl]->field_104 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2883 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2884 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2885 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2886 if (pPlayers[pl]->pConditions[Condition_Sleep] | pPlayers[pl]->pConditions[Condition_Paralyzed]
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2887 | pPlayers[pl]->pConditions[Condition_Unconcious] | pPlayers[pl]->pConditions[Condition_Dead]
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2888 | pPlayers[pl]->pConditions[Condition_Pertified] | pPlayers[pl]->pConditions[Condition_Eradicated])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2889 --party_condition_flag;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2890 v43 = (signed __int64)pPlayers[pl]->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime > 0; //ñïåøêà
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2891
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2892 for (uint k = 0; k < 24; ++k)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2893 pPlayers[pl]->pPlayerBuffs[k].IsBuffExpiredToTime(pParty->uTimePlayed);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2894
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2895 if (v43 && (signed __int64)pPlayers[pl]->pPlayerBuffs[7].uExpireTime <= 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2896 pPlayers[pl]->SetCondition(Condition_Weak, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2897 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2898
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2899 v46 = (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_HASTE].uExpireTime > 0;
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 for (uint i = 0; i < 20; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2902 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2903 if (pParty->pPartyBuffs[i].IsBuffExpiredToTime(pParty->uTimePlayed) == 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2904 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2905 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2906
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2907 if (v46 && (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_HASTE].uExpireTime <= 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2908 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2909 for (uint i = 0; i < 4; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2910 pParty->pPlayers[i].SetCondition(1, 0);
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2913 for (uint i = 0; i < 2; ++i)//Ïðîâåðêà â ñîçíàíèè ëè ïåðñ ñäåëàâøèé çàêë íà ïîë¸ò è õîæäåíèå ïî âîäå
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2914 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2915 SpellBuff* pBuf = &pParty->pPartyBuffs[Party_Spec_Motion_status_ids[i]];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2916 if (pBuf->uExpireTime == 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2917 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2918
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2919 if (!(pBuf->uFlags & 1))
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 if (!pPlayers[pBuf->uCaster]->CanAct())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2922 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2923 pBuf->Reset();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2924 if (Party_Spec_Motion_status_ids[i] == PARTY_BUFF_FLY)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2925 pParty->bFlying = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2926 }
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2929
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2930 if (!party_condition_flag)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2931 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2932 if (current_screen_type != SCREEN_REST)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2933 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2934 for (uint pl = 1; pl <= 4; pl++)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2935 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2936 if (pPlayers[pl]->pConditions[Condition_Sleep])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2937 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2938 pPlayers[pl]->pConditions[Condition_Sleep] = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2939 party_condition_flag = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2940 break;
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2943 if (!party_condition_flag || _5C35C0_force_party_death)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2944 uGameState = GAME_STATE_PARTY_DIED;
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2947
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2948 if (uActiveCharacter)//âûáîð ñëåäóþùåãî ïîñëå ïðîïóñêàþùåãî õîä
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2949 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2950 if (current_screen_type != SCREEN_REST)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2951 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2952 if (pPlayers[uActiveCharacter]->pConditions[Condition_Sleep]
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2953 || pPlayers[uActiveCharacter]->pConditions[Condition_Paralyzed]
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2954 || pPlayers[uActiveCharacter]->pConditions[Condition_Unconcious]
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2955 || pPlayers[uActiveCharacter]->pConditions[Condition_Dead]
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2956 || pPlayers[uActiveCharacter]->pConditions[Condition_Pertified]
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2957 || pPlayers[uActiveCharacter]->pConditions[Condition_Eradicated])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2958 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2959 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2960 uActiveCharacter = pParty->GetNextActiveCharacter();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2961 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2962 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2963 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2964 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2965
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2966 //----- (00493938) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2967 void _493938_regenerate()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2968 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2969 int current_time; // edi@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2970 int last_reg_time; // qax@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2971 int v4; // eax@2
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2972 int v5; // edi@5
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2973 long long *v6; // ecx@5
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2974 char v7; // sf@5
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2975 int *v8; // ecx@10
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2976 int v9; // edi@15
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2977 signed int v10; // eax@15
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2978 // __int16 *v11; // edx@16
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2979 // int v12; // eax@20
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2980 int numberOfActorsAffected; // ebx@20
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2981 unsigned int v14; // esi@21
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2982 //unsigned int v15; // ecx@21
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2983 //unsigned int v16; // eax@21
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2984 // int v18; // eax@21
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2985 signed int v19; // eax@21
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2986 bool recovery_HP; // ebx@25
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2987 // ITEM_EQUIP_TYPE v22; // edi@30
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2988 signed int v25; // eax@33
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2989 // int v26; // eax@35
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2990 // int v27; // eax@36
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2991 // int v28; // eax@37
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2992 signed int v31; // ecx@53
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2993 int actorsAffectedByImmolation[100]; // [sp+4h] [bp-22Ch]@20
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2994 SpriteObject a1; // [sp+194h] [bp-9Ch]@15
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2995 Vec3_int_ a3; // [sp+204h] [bp-2Ch]@15
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2996 bool has_dragon_flag; // [sp+210h] [bp-20h]@22
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2997 bool lich_jar_flag; // [sp+214h] [bp-1Ch]@25
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2998 bool zombie_flag; // [sp+218h] [bp-18h]@25
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2999 bool decrease_HP; // [sp+21Ch] [bp-14h]@25
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3000 bool lich_flag; // [sp+220h] [bp-10h]@25
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3001 int v49; // [sp+224h] [bp-Ch]@24
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3002 bool recovery_SP; // [sp+228h] [bp-8h]@25
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3003 bool redraw_flag; // [sp+22Ch] [bp-4h]@2
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3004
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3005 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
3006 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
3007 if (current_time >= (signed int)last_reg_time + 5)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3008 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3009 redraw_flag = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3010 v4 = (current_time - last_reg_time) / 5;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3011 if (pParty->FlyActive())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3012 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3013 if (pParty->bFlying)
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 if (!(pParty->pPartyBuffs[PARTY_BUFF_FLY].uFlags & 1))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3016 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3017 v5 = v4 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uPower;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3018 //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
3019 //v7 = cursed_flag < v5;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3020 //cursed_flag -= v5;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3021
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3022 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
3023
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3024 if (*v6 < v5)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3025 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3026 v6 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3027 pParty->uFlags &= 0xFFFFFFBFu;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3028 pParty->bFlying = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3029 redraw_flag = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3030 }
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3033 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3034
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3035 if (pParty->WaterWalkActive())
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 if (pParty->uFlags & PARTY_FLAGS_1_STANDING_ON_WATER)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3038 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3039 if (!(pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uFlags & 1))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3040 { // taking on water
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3041 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
3042 v7 = *v8 < v4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3043 *v8 -= v4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3044 if (v7)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3045 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3046 *v8 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3047 pParty->uFlags &= ~PARTY_FLAGS_1_STANDING_ON_WATER;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3048 redraw_flag = true;
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3051 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3052 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3053
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3054 if (pParty->ImmolationActive())//Æåðòâà
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3055 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3056 a3.z = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3057 a3.y = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3058 a3.x = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3059 a1.stru_24.Reset();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3060 a1.spell_level = pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION].uPower;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3061 a1.spell_skill = pParty->ImmolationSkillLevel();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3062 v10 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3063 a1.uType = 1070;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3064 a1.spell_id = SPELL_FIRE_IMMOLATION;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3065 v10 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3066 for (uint i = 0; i > pObjectList->uNumObjects; i++)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3067 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3068 if (pObjectList->pObjects[i].uObjectID == stru_4E3ACC[8].uType)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3069 v10 = i;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3070 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3071 a1.uObjectDescID = v10;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3072 a1.field_60_distance_related_prolly_lod = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3073 a1.uAttributes = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3074 a1.uSectorID = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3075 a1.uSpriteFrameID = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3076 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
3077 a1.uFacing = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3078 a1.uSoundID = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3079 numberOfActorsAffected = pParty->_46A89E_immolation_effect(actorsAffectedByImmolation, 100, 307);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3080 for (v9 = 0; v9 < numberOfActorsAffected; ++v9)
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 v14 = actorsAffectedByImmolation[v9];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3083 a1.vPosition.x = pActors[v14].vPosition.x;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3084 a1.vPosition.y = pActors[v14].vPosition.y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3085 a1.vPosition.z = pActors[v14].vPosition.z;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3086 a1.spell_target_pid = PID(OBJECT_Actor, v14);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3087 v19 = a1.Create(0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3088 Actor::DamageMonsterFromParty(PID(OBJECT_Item, v19), v14, &a3);
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 }
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 has_dragon_flag = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3093 if (PartyHasDragon())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3094 has_dragon_flag = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3095
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3096 for (v49 = 0; v49 < 4; v49++)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3097 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3098 recovery_HP = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3099 recovery_SP = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3100 decrease_HP = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3101 lich_flag = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3102 lich_jar_flag = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3103 zombie_flag = false;
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 for (int v22 = 0; (signed int)v22 < 16; v22++)
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 if (pParty->pPlayers[v49].HasItemEquipped((ITEM_EQUIP_TYPE)v22))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3108 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3109 uint _idx = pParty->pPlayers[v49].pEquipment.pIndices[v22];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3110 if (pParty->pPlayers[v49].pInventoryItemList[_idx - 1].uItemID > 134)
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 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
3113 decrease_HP = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3114 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
3115 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3116 recovery_HP = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3117 recovery_SP = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3118 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3119 if (pParty->pPlayers[v49].pInventoryItemList[_idx - 1].uItemID == ITEM_ARTIFACT_MINDS_EYE)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3120 recovery_SP = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3121 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
3122 recovery_HP = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3123 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3124 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3125 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3126 v25 = pParty->pPlayers[v49].pInventoryItemList[_idx - 1].uSpecEnchantmentType;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3127 if (v25 == 37 //of Regeneration("Regenerate 1hp/x while walking, etc")
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3128 || v25 == 44 //of Life("HP (+10), Regen hpts")
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3129 || v25 == 50 //of The Phoenix("Fire Res (+30), Regen hpts") &&
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3130 || v25 == 54)// of The Troll("End (+15), Regen hpts")
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3131 recovery_HP = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3132 if (v25 == 38 //of Mana("Regenerate 1sp/x while walking, etc")
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3133 || v25 == 47 //of The Eclipse("SP (+10), Regen spts")
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3134 || v25 == 55)//of The Unicorn("Luck (+15), Regen spts")
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3135 recovery_SP = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3136 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
3137 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3138 recovery_HP = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3139 recovery_SP = true;
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3142
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3143 if (recovery_HP &&
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3144 !pParty->pPlayers[v49].pConditions[Condition_Dead] &&
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3145 !pParty->pPlayers[v49].pConditions[Condition_Eradicated])
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 if (pParty->pPlayers[v49].sHealth < pParty->pPlayers[v49].GetMaxHealth())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3148 ++pParty->pPlayers[v49].sHealth;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3149 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
3150 pParty->pPlayers[v49].pConditions[Condition_Unconcious] = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3151 redraw_flag = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3152 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3153
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3154 if (recovery_SP &&
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3155 !pParty->pPlayers[v49].pConditions[Condition_Dead] &&
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3156 !pParty->pPlayers[v49].pConditions[Condition_Eradicated])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3157 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3158 if (pParty->pPlayers[v49].sMana < pParty->pPlayers[v49].GetMaxMana())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3159 ++pParty->pPlayers[v49].sMana;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3160 redraw_flag = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3161 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3162
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3163 if (decrease_HP &&
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3164 !pParty->pPlayers[v49].pConditions[Condition_Dead] &&
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3165 !pParty->pPlayers[v49].pConditions[Condition_Eradicated])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3166 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3167 --pParty->pPlayers[v49].sHealth;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3168 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
3169 pParty->pPlayers[v49].pConditions[Condition_Unconcious] = pParty->uTimePlayed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3170 if (pParty->pPlayers[v49].sHealth < 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3171 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3172 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
3173 || (signed __int64)pParty->pPlayers[v49].pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3174 pParty->pPlayers[v49].pConditions[Condition_Unconcious] = pParty->uTimePlayed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3175 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3176 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3177 if (!pParty->pPlayers[v49].pConditions[Condition_Dead])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3178 pParty->pPlayers[v49].pConditions[Condition_Dead] = pParty->uTimePlayed;
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3181 redraw_flag = true;
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3184 }
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 //regeneration
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3187 if (pParty->pPlayers[v49].pPlayerBuffs[PLAYER_BUFF_REGENERATION].uExpireTime > 0
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3188 && !pParty->pPlayers[v49].pConditions[Condition_Dead]
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3189 && !pParty->pPlayers[v49].pConditions[Condition_Eradicated])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3190 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3191 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
3192 if (pParty->pPlayers[v49].sHealth > pParty->pPlayers[v49].GetMaxHealth())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3193 pParty->pPlayers[v49].sHealth = pParty->pPlayers[v49].GetMaxHealth();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3194 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
3195 pParty->pPlayers[v49].pConditions[Condition_Unconcious] = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3196 redraw_flag = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3197 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3198
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3199 //for warlock
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3200 if (has_dragon_flag && pParty->pPlayers[v49].classType == PLAYER_CLASS_WARLOCK)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3201 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3202 if (pParty->pPlayers[v49].sMana < pParty->pPlayers[v49].GetMaxMana())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3203 ++pParty->pPlayers[v49].sMana;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3204 redraw_flag = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3205 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3206
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3207 //for lich
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3208 if (pParty->pPlayers[v49].classType == PLAYER_CLASS_LICH)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3209 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3210 for (v31 = 0; v31 < 126; ++v31)
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 if (pParty->pPlayers[v49].pInventoryItemList[v31].uItemID == ITEM_LICH_JAR_FULL)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3213 lich_jar_flag = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3214 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3215 lich_flag = true;
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 (lich_flag && !pParty->pPlayers[v49].pConditions[Condition_Dead]
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3218 && !pParty->pPlayers[v49].pConditions[Condition_Eradicated])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3219 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3220 if (pParty->pPlayers[v49].sHealth > pParty->pPlayers[v49].GetMaxHealth() / 2)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3221 pParty->pPlayers[v49].sHealth = pParty->pPlayers[v49].sHealth - 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3222 if (pParty->pPlayers[v49].sMana > pParty->pPlayers[v49].GetMaxMana() / 2)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3223 pParty->pPlayers[v49].sMana = pParty->pPlayers[v49].sMana - 2;
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 if (lich_jar_flag)
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 if (pParty->pPlayers[v49].sMana < pParty->pPlayers[v49].GetMaxMana())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3228 ++pParty->pPlayers[v49].sMana;
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3231 //for zombie
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3232 if (pParty->pPlayers[v49].pConditions[Condition_Zombie])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3233 zombie_flag = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3234 if (zombie_flag && !pParty->pPlayers[v49].pConditions[Condition_Dead]
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3235 && !pParty->pPlayers[v49].pConditions[Condition_Eradicated])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3236 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3237 if (pParty->pPlayers[v49].sHealth > pParty->pPlayers[v49].GetMaxHealth() / 2)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3238 pParty->pPlayers[v49].sHealth = pParty->pPlayers[v49].sHealth - 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3239 if (pParty->pPlayers[v49].sMana > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3240 pParty->pPlayers[v49].sMana = pParty->pPlayers[v49].sMana - 1;
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 pParty->uLastRegenerationTime = pParty->uTimePlayed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3244 if (!viewparams->bRedrawGameUI)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3245 viewparams->bRedrawGameUI = redraw_flag;
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3248
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3249 //----- (00491E3A) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3250 void sub_491E3A()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3251 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3252 signed int v1; // esi@3
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3253 unsigned int v3; // eax@7
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3254 unsigned int v4; // edx@8
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3255 int v6; // edi@17
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3256
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3257 //__debugbreak();//Ritor1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3258 for (uint pl = 0; pl < 4; pl++)
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 if (SoundSetAction[24][0])
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 v3 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3263 for (v1 = 0; v1 < (signed int)pSoundList->sNumSounds; ++v1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3264 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3265 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
3266 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
3267 v3 = v1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3268 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3269 pSoundList->UnloadSound(v3, 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3270 for (v4 = 0; (signed int)v4 < (signed int)pSoundList->sNumSounds; ++v4)
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 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
3273 pSoundList->UnloadSound(v4, 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3274 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3275 }
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 v6 = pIcons_LOD->uNumLoadedFiles - 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3278 if (v6 >= pIcons_LOD->pFacesLock)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3279 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3280 do
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3281 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3282 pIcons_LOD->pTextures[v6].Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3283 if (pIcons_LOD->pHardwareTextures)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3284 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3285 if (pIcons_LOD->pHardwareTextures[v6])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3286 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3287 pIcons_LOD->pHardwareTextures[v6]->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3288 pIcons_LOD->pHardwareTextures[v6] = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3289 }
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 if (pIcons_LOD->pHardwareSurfaces)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3292 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3293 if (pIcons_LOD->pHardwareSurfaces[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 pIcons_LOD->pHardwareSurfaces[v6]->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3296 pIcons_LOD->pHardwareSurfaces[v6] = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3297 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3298 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3299 --v6;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3300 } while (v6 >= pIcons_LOD->pFacesLock);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3301 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3302 pIcons_LOD->uNumLoadedFiles = pIcons_LOD->pFacesLock;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3303 pIcons_LOD->pFacesLock = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3304 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3305 // 4ED498: using guessed type char byte_4ED498;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3306
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3307 //----- (00494820) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3308 unsigned int __fastcall _494820_training_time(unsigned int a1)
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 signed int v1; // eax@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3311
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3312 v1 = 5;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3313 if (a1 % 24 >= 5)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3314 v1 = 29;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3315 return v1 - a1 % 24;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3316 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3317
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3318 //----- (00494836) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3319 int stru339_spell_sound::AddPartySpellSound(int uSoundID, int a6)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3320 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3321 int v3; // esi@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3322 int result; // eax@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3323 //stru339_spell_sound *v5; // ebx@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3324 //int *v6; // edi@2
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3325 unsigned int v7; // eax@3
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3326 int v8; // [sp+Ch] [bp-8h]@3
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3327 int v9; // [sp+10h] [bp-4h]@2
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3328 int a2a; // [sp+1Ch] [bp+8h]@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3329 //return 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3330 v3 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3331 result = word_4EE088_sound_ids[uSoundID];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3332 //v5 = this;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3333 a2a = word_4EE088_sound_ids[uSoundID];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3334 if (word_4EE088_sound_ids[uSoundID])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3335 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3336 //v6 = this->pSoundsOffsets;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3337 for (v9 = 0; v9 < 2; ++v9)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3338 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3339 v7 = a2a++;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3340 result = pSoundList->LoadSound(v7, (char *)this + v3, 44744 - v3, &v8, a6);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3341 if (!result)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3342 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3343 a6 += 4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3344 result = v8 + 256;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3345 this->pSoundsOffsets[v9] = v3;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3346 v3 += result;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3347 this->pSoundsSizes[v9] = v8 + 256;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3348 //++v6;
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3351 return result;
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 // 4EE088: using guessed type __int16 word_4EE088_sound_ids[];
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 //----- (00443E31) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3356 void LoadLevel_InitializeLevelStr()
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
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3359 // char Args[100];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3360 int string_num;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3361 int max_string_length;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3362 // int current_string_length;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3363 int prev_string_offset;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3364
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3365 if (sizeof(pLevelStrOffsets) != 2000)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3366 Log::Warning(L"pLevelStrOffsets: deserialization warning");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3367 memset(pLevelStrOffsets.data(), 0, 2000);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3368
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3369 max_string_length = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3370 string_num = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3371 prev_string_offset = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3372 pLevelStrOffsets[0] = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3373 for (uint i = 0; i < uLevelStrFileSize; ++i)
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 if (!pLevelStr[i])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3376 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3377 pLevelStrOffsets[string_num] = i + 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3378 ++string_num;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3379 if (i - prev_string_offset > max_string_length)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3380 max_string_length = i - prev_string_offset;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3381 prev_string_offset = i;
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3384
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3385 uLevelStrNumStrings = string_num - 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3386 if (max_string_length > 800)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3387 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
3388
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3389 if (uLevelStrNumStrings > 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 for (uint i = 0; i <uLevelStrNumStrings; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3392 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3393 if (RemoveQuotes(&pLevelStr[pLevelStrOffsets[i]]) != &pLevelStr[pLevelStrOffsets[i]])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3394 ++pLevelStrOffsets[i];
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3397 }
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 //----- (00443F95) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3400 void OnMapLeave()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3401 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3402 _evt_raw *test_event;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3403 if (uLevelEVT_NumEvents > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3404 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3405 for (uint i = 0; i < uLevelEVT_NumEvents; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3406 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3407 test_event = (_evt_raw*)&pLevelEVT[pLevelEVT_Index[i].uEventOffsetInEVT];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3408 if (test_event->_e_type == EVENT_OnMapLeave)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3409 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3410 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
3411 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3412 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3413 }
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 //----- (00443FDC) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3417 void OnMapLoad()
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 int v6; // eax@9
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3420 unsigned __int64 v8; // qax@26
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3421 int hours; // ebx@26
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3422 unsigned __int64 v18; // [sp+Ch] [bp-44h]@12
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3423 unsigned int seconds; // [sp+14h] [bp-3Ch]@26
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3424 unsigned __int64 v20; // [sp+1Ch] [bp-34h]@7
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3425 unsigned int minutes; // [sp+2Ch] [bp-24h]@26
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3426 unsigned int years; // [sp+34h] [bp-1Ch]@26
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3427 unsigned int weeks; // [sp+38h] [bp-18h]@26
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3428 int v26; // [sp+3Ch] [bp-14h]@15
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3429 unsigned int days; // [sp+3Ch] [bp-14h]@26
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3430 unsigned int months; // [sp+40h] [bp-10h]@26
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3431
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3432 for (uint i = 0; i < uLevelEVT_NumEvents; ++i)
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 EventIndex pEvent = pLevelEVT_Index[i];
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 _evt_raw* _evt = (_evt_raw *)(&pLevelEVT[pEvent.uEventOffsetInEVT]);
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 if (_evt->_e_type == EVENT_PlaySound)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3439 pSoundList->LoadSound(EVT_DWORD(_evt->v5), 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3440 else if (_evt->_e_type == EVENT_OnMapReload)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3441 EventProcessor(pEvent.uEventID, 0, 0, pEvent.event_sequence_num);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3442 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
3443 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3444 //v3 = &MapsLongTimersList[MapsLongTimers_count];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3445 v20 = pOutdoor->loc_time.uLastVisitDay;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3446 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3447 v20 = pIndoor->stru1.uLastVisitDay;
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 MapsLongTimersList[MapsLongTimers_count].timer_evt_type = _evt->_e_type;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3450 MapsLongTimersList[MapsLongTimers_count].timer_evt_ID = pEvent.uEventID;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3451 MapsLongTimersList[MapsLongTimers_count].timer_evt_seq_num = pEvent.event_sequence_num;
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 MapsLongTimersList[MapsLongTimers_count].YearsInterval = _evt->v5;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3454 MapsLongTimersList[MapsLongTimers_count].MonthsInterval = _evt->v6;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3455 MapsLongTimersList[MapsLongTimers_count].WeeksInterval = _evt->v7;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3456 MapsLongTimersList[MapsLongTimers_count].HoursInterval = _evt->v8;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3457 MapsLongTimersList[MapsLongTimers_count].MinutesInterval = _evt->v9;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3458 MapsLongTimersList[MapsLongTimers_count].SecondsInterval = _evt->v10;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3459
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3460
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3461 v6 = ((unsigned short)_evt->v12 << 8) + _evt->v11;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3462
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3463 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
3464 MapsLongTimersList[MapsLongTimers_count].IntervalHalfMins = ((unsigned short)_evt->v12 << 8) + _evt->v11;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3465 if (MapsLongTimersList[MapsLongTimers_count].timer_evt_type == EVENT_Initialize && !(short)v6)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3466 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3467 if (v20)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3468 v18 = pParty->uTimePlayed - v20;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3469 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3470 v18 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3471 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
3472
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3473 if (v26 / 7 / 4 / 12 != 0 && MapsLongTimersList[MapsLongTimers_count].YearsInterval ||
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3474 v26 / 7 / 4 != 0 && MapsLongTimersList[MapsLongTimers_count].MonthsInterval != 0 ||
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3475 v26 / 7 != 0 && MapsLongTimersList[MapsLongTimers_count].WeeksInterval != 0 ||
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3476 v26 != 0 || !v20)
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 ++MapsLongTimers_count;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3479 MapsLongTimersList[MapsLongTimers_count].NextStartTime = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3480 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3481 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3482 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3483 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3484 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3485 v8 = (__int64)((double)pParty->uTimePlayed * 0.234375);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3486 seconds = v8 % 60;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3487 minutes = (v8 / 60) % 60;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3488 hours = ((v8 / 60) / 60) % 24;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3489 days = (((v8 / 60) / 60) / 24) % 7;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3490 weeks = ((((v8 / 60) / 60) / 24) / 7) % 4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3491 months = (((((v8 / 60) / 60) / 24) / 7) / 4) % 12;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3492 years = (((((v8 / 60) / 60) / 24) / 7) / 4) / 12;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3493
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3494 if (MapsLongTimersList[MapsLongTimers_count].YearsInterval)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3495 ++years;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3496 else if (MapsLongTimersList[MapsLongTimers_count].MonthsInterval)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3497 ++months;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3498 else if (MapsLongTimersList[MapsLongTimers_count].WeeksInterval)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3499 ++weeks;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3500 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3501 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3502 ++days;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3503 hours = MapsLongTimersList[MapsLongTimers_count].HoursInterval;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3504 minutes = MapsLongTimersList[MapsLongTimers_count].MinutesInterval;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3505 seconds = MapsLongTimersList[MapsLongTimers_count].SecondsInterval;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3506 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3507 MapsLongTimersList[MapsLongTimers_count].NextStartTime = (signed __int64)((double)((seconds
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3508 + 60 * minutes
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3509 + 3600 * hours
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3510 + 86400 * days
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3511 + 604800 * weeks
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3512 + 2419200 * months
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3513 + 29030400 * years) << 7)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3514 * 0.033333335);
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 ++MapsLongTimers_count;
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 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3519 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3520 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3521
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3522 //----- (00444360) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3523 void Level_LoadEvtAndStr(const char *pLevelName)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3524 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3525 char pContainerName[120]; // [sp+8h] [bp-98h]@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3526
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3527 sprintf(pContainerName, "%s.evt", pLevelName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3528 uLevelEVT_Size = LoadEventsToBuffer(pContainerName, pLevelEVT.data(), 9216);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3529
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3530 sprintf(pContainerName, "%s.str", pLevelName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3531 uLevelStrFileSize = LoadEventsToBuffer(pContainerName, pLevelStr.data(), 9216);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3532 if (uLevelStrFileSize)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3533 LoadLevel_InitializeLevelStr();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3534 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3535
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3536 //----- (004452BB) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3537 void sub_4452BB()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3538 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3539 pGUIWindow2->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3540 pGUIWindow2 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3541 activeLevelDecoration = _591094_decoration;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3542 EventProcessor(dword_5C3418, 0, 1, dword_5C341C);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3543 activeLevelDecoration = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3544 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3545 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3546
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3547 //----- (0044100D) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3548 bool _44100D_should_alter_right_panel()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3549 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3550 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
3551 current_screen_type == SCREEN_HOUSE || current_screen_type == SCREEN_E ||
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3552 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
3553 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3554
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3555 //----- (0044987B) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3556 void Transition_StopSound_Autosave(const char *pMapName, MapStartPoint start_point)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3557 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3558 pAudioPlayer->StopChannels(-1, -1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3559 pGameLoadingUI_ProgressBar->Initialize(GUIProgressBar::TYPE_None);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3560 if (_stricmp(pCurrentMapName, pMapName))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3561 SaveGame(1, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3562
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3563 uGameState = GAME_STATE_CHANGE_LOCATION;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3564 strcpy(pCurrentMapName, pMapName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3565 uLevel_StartingPointType = start_point;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3566 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3567 // 6BE35C: using guessed type int uLevel_StartingPointType;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3568
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3569 //----- (004451A8) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3570 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
3571 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3572 if (!pGUIWindow2)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3573 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3574 if (pParty->uFlags & 2)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3575 pEngine->Draw();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3576 pAudioPlayer->StopChannels(-1, -1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3577 pMiscTimer->Pause();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3578 pEventTimer->Pause();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3579 dword_5C3418 = a1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3580 dword_5C341C = a2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3581 _591094_decoration = activeLevelDecoration;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3582 pGUIWindow2 = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_GreetingNPC, a4, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3583 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
3584 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
3585 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
3586 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
3587 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3588 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3589
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3590
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3591
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3592
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3593 //----- (00448B67) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3594 void OnTimer(int)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3595 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3596 if (pEventTimer->bPaused)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3597 return;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3598
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3599 long long v13 = (signed __int64)(pParty->uTimePlayed - _5773B8_event_timer) / 128;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3600 if (!v13)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3601 return;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3602
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3603 //uint _v2v3 = pParty->uTimePlayed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3604 //v3 = HIDWORD(pParty->uTimePlayed);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3605 //v2 = LODWORD(pParty->uTimePlayed);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3606
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3607 _5773B8_event_timer = pParty->uTimePlayed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3608
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3609 for (uint i = 0; i < MapsLongTimers_count; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3610 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3611 //v4 = (char *)&array_5B5928_timers[0].field_C;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3612 MapsLongTimer* timer = &MapsLongTimersList[i];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3613 //while ( 1 )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3614 //{
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3615 //v5 = *(short *)v4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3616 if (timer->time_left_to_fire)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3617 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3618 if (v13 < timer->time_left_to_fire)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3619 timer->time_left_to_fire -= v13;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3620 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3621 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3622 timer->time_left_to_fire = timer->IntervalHalfMins;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3623 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
3624 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3625 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3626 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3627 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3628 if (timer->NextStartTime < pParty->uTimePlayed)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3629 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3630 uint next_trigger_time = 1 * 60 * 60 * 24; // 1 day
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3631 if (timer->YearsInterval)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3632 next_trigger_time = 336 * 60 * 60 * 24; // 1 year
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3633 else if (timer->MonthsInterval)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3634 next_trigger_time = 28 * 60 * 60 * 24; // 1 month
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3635 else if (timer->WeeksInterval)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3636 next_trigger_time = 7 * 60 * 60 * 24; // 1 week
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3637
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3638 timer->NextStartTime += (next_trigger_time * 128) / 3.0f;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3639 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
3640 timer->NextStartTime = pParty->uTimePlayed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3641
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3642 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
3643 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3644 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3645 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3646 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3647
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3648
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3649
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3650
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3651
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3652
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3653
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3654 //----- (0044C28F) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3655 bool TeleportToNWCDungeon()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3656 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3657 if (!_stricmp("nwc.blv", pCurrentMapName))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3658 return false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3659
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3660 _5B65A8_npcdata_uflags_or_other = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3661 _5B65AC_npcdata_fame_or_other = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3662 _5B65B0_npcdata_rep_or_other = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3663 _5B65B4_npcdata_loword_house_or_other = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3664 _5B65B8_npcdata_hiword_house_or_other = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3665 dword_5B65BC = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3666 dword_5B65C0 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3667
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3668 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3669 Transition_StopSound_Autosave("nwc.blv", MapStartPoint_Party);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3670 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3671 return true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3672 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3673
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3674 //----- (00401000) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3675 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
3676 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3677 void *v4; // esi@2
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3678
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3679 if (numObjs > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3680 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3681 v4 = a1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3682 for (int i = numObjs; i; --i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3683 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3684 constructor((int)v4);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3685 v4 = (char *)v4 + objSize;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3686 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3687 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3688 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3689
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3690
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3691