annotate Game.h @ 2488:e8130e8c116f

Слияние
author Ritor1
date Thu, 11 Sep 2014 17:26:30 +0600
parents 104fdbea0386
children
rev   line source
0
Ritor1
parents:
diff changeset
1 #pragma once
1016
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 982
diff changeset
2 #include "VectorTypes.h"
0
Ritor1
parents:
diff changeset
3
2463
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
4 #include "OSAPI.h"
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
5
2464
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
6 #include "MapInfo.h"
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7
0
Ritor1
parents:
diff changeset
8
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2124
diff changeset
9 #define GAME_FLAGS_1_01_lightmap_related 0x01
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 638
diff changeset
10 #define GAME_FLAGS_1_DRAW_BLV_DEBUGS 0x08
592
96f48cfdd657 some flags
Nomad
parents: 573
diff changeset
11 #define GAME_FLAGS_2_SATURATE_LIGHTMAPS 0x02
96f48cfdd657 some flags
Nomad
parents: 573
diff changeset
12 #define GAME_FLAGS_2_ALTER_GRAVITY 0x08
96f48cfdd657 some flags
Nomad
parents: 573
diff changeset
13 #define GAME_FLAGS_2_TARGETING_MODE 0x10
96f48cfdd657 some flags
Nomad
parents: 573
diff changeset
14 #define GAME_FLAGS_2_DRAW_BLOODSPLATS 0x20
573
Nomad
parents: 522
diff changeset
15
0
Ritor1
parents:
diff changeset
16
Ritor1
parents:
diff changeset
17
Ritor1
parents:
diff changeset
18 /* 320 */
Ritor1
parents:
diff changeset
19 enum GAME_STATE
Ritor1
parents:
diff changeset
20 {
982
08fd1436ef35 enums & lod
Nomad
parents: 981
diff changeset
21 GAME_STATE_PLAYING = 0,
981
a6ef7125f6e4 Autonotes & GameState
Nomad
parents: 734
diff changeset
22 GAME_FINISHED = 1,
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2006
diff changeset
23 GAME_STATE_CHANGE_LOCATION = 2,
1214
0d6c7ff3cddd simplified stru193_math constructor and class definition
Grumpy7
parents: 1016
diff changeset
24 GAME_STATE_LOADING_GAME = 3,
981
a6ef7125f6e4 Autonotes & GameState
Nomad
parents: 734
diff changeset
25 GAME_STATE_NEWGAME_OUT_GAMEMENU = 4,
a6ef7125f6e4 Autonotes & GameState
Nomad
parents: 734
diff changeset
26 GAME_STATE_5 = 5,
982
08fd1436ef35 enums & lod
Nomad
parents: 981
diff changeset
27 GAME_STATE_STARTING_NEW_GAME = 6,
734
2f4e33c1ed24 stru154
Nomad
parents: 676
diff changeset
28 GAME_STATE_GAME_QUITTING_TO_MAIN_MENU = 7,
981
a6ef7125f6e4 Autonotes & GameState
Nomad
parents: 734
diff changeset
29 GAME_STATE_PARTY_DIED = 8,
a6ef7125f6e4 Autonotes & GameState
Nomad
parents: 734
diff changeset
30 GAME_STATE_FINAL_WINDOW = 9,
a6ef7125f6e4 Autonotes & GameState
Nomad
parents: 734
diff changeset
31 GAME_STATE_A = 10
0
Ritor1
parents:
diff changeset
32 };
Ritor1
parents:
diff changeset
33
Ritor1
parents:
diff changeset
34
Ritor1
parents:
diff changeset
35
Ritor1
parents:
diff changeset
36 /* 105 */
Ritor1
parents:
diff changeset
37 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
38 struct Game__StationaryLight
Ritor1
parents:
diff changeset
39 {
Ritor1
parents:
diff changeset
40 Vec3_float_ vPosition;
Ritor1
parents:
diff changeset
41 Vec3_float_ vRGBColor;
Ritor1
parents:
diff changeset
42 float flt_18;
Ritor1
parents:
diff changeset
43 };
Ritor1
parents:
diff changeset
44 #pragma pack(pop)
Ritor1
parents:
diff changeset
45
Ritor1
parents:
diff changeset
46
Ritor1
parents:
diff changeset
47 /* 108 */
Ritor1
parents:
diff changeset
48 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
49 struct Game_stru0
Ritor1
parents:
diff changeset
50 {
Ritor1
parents:
diff changeset
51 int field_0;
Ritor1
parents:
diff changeset
52 unsigned __int8 *ptr_4;
Ritor1
parents:
diff changeset
53 int field_8;
Ritor1
parents:
diff changeset
54 int field_C;
Ritor1
parents:
diff changeset
55 };
Ritor1
parents:
diff changeset
56 #pragma pack(pop)
Ritor1
parents:
diff changeset
57
Ritor1
parents:
diff changeset
58
Ritor1
parents:
diff changeset
59 /* 279 */
Ritor1
parents:
diff changeset
60 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
61 //Game_stru1
Ritor1
parents:
diff changeset
62 struct Game_Bloodsplat
Ritor1
parents:
diff changeset
63 {
Ritor1
parents:
diff changeset
64 float x;
Ritor1
parents:
diff changeset
65 float y;
Ritor1
parents:
diff changeset
66 float z;
Ritor1
parents:
diff changeset
67 float r;
Ritor1
parents:
diff changeset
68 float g;
Ritor1
parents:
diff changeset
69 float b;
Ritor1
parents:
diff changeset
70 float radius;
Ritor1
parents:
diff changeset
71 };
Ritor1
parents:
diff changeset
72 #pragma pack(pop)
Ritor1
parents:
diff changeset
73
1016
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 982
diff changeset
74
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 982
diff changeset
75 class Vis;
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 982
diff changeset
76 class LightmapBuilder;
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 982
diff changeset
77 class ParticleEngine;
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 982
diff changeset
78 class Mouse;
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 982
diff changeset
79 class Keyboard;
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 982
diff changeset
80 class ThreadWard;
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 982
diff changeset
81 class CShow;
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 982
diff changeset
82 class GammaController;
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 982
diff changeset
83 struct stru9;
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 982
diff changeset
84 struct stru10;
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 982
diff changeset
85
0
Ritor1
parents:
diff changeset
86 /* 104 */
Ritor1
parents:
diff changeset
87 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
88 struct Game
Ritor1
parents:
diff changeset
89 {
Ritor1
parents:
diff changeset
90 static Game *Create();
Ritor1
parents:
diff changeset
91 static void Destroy();
Ritor1
parents:
diff changeset
92
Ritor1
parents:
diff changeset
93 protected: Game();
522
61343380715b Origianl structures integrity test added
Nomad
parents: 194
diff changeset
94 protected: virtual ~Game();
0
Ritor1
parents:
diff changeset
95
1016
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 982
diff changeset
96
0
Ritor1
parents:
diff changeset
97 public:
Ritor1
parents:
diff changeset
98 void _44E904();
Ritor1
parents:
diff changeset
99 bool InitializeGammaController();
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 101
diff changeset
100 bool PickMouse(float fPickDepth, unsigned int uMouseX, unsigned int uMouseY, bool bOutline, struct Vis_SelectionFilter *sprite_filter, struct Vis_SelectionFilter *face_filter);
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 101
diff changeset
101 bool PickKeyboard(bool bOutline, struct Vis_SelectionFilter *sprite_filter, struct Vis_SelectionFilter *face_filter);
0
Ritor1
parents:
diff changeset
102 void OutlineSelection();
1392
Nomad
parents: 1214
diff changeset
103 signed int _44EC23(struct Polygon *a2, int *a3, signed int a4);
0
Ritor1
parents:
diff changeset
104 signed int _44ED0A(struct BLVFace *a2, int *a3, signed int a4);
2006
30c2b575d25c signed fixes
zipi
parents: 1458
diff changeset
105 bool AlterGamma_BLV(struct BLVFace *pFace, signed int *pColor);
30c2b575d25c signed fixes
zipi
parents: 1458
diff changeset
106 bool AlterGamma_ODM(struct ODMFace *pFace, signed int *pColor);
0
Ritor1
parents:
diff changeset
107 bool draw_debug_outlines();
Ritor1
parents:
diff changeset
108 bool _44EEA7();
Ritor1
parents:
diff changeset
109 bool _44F07B();
Ritor1
parents:
diff changeset
110 void ToggleFlags(unsigned int uMask);
Ritor1
parents:
diff changeset
111 void ToggleFlags2(unsigned int uFlag);
Ritor1
parents:
diff changeset
112 void _44F0FD();
Ritor1
parents:
diff changeset
113 void PushStationaryLights(int a2);
Ritor1
parents:
diff changeset
114 void PrepareBloodsplats();
Ritor1
parents:
diff changeset
115 void Deinitialize();
Ritor1
parents:
diff changeset
116 void Loop();
Ritor1
parents:
diff changeset
117 void DrawParticles();
Ritor1
parents:
diff changeset
118 void Draw();
Ritor1
parents:
diff changeset
119
Ritor1
parents:
diff changeset
120 //----- (0042EB6A) --------------------------------------------------------
Ritor1
parents:
diff changeset
121 struct stru6 *GetStru6() {return this->pStru6Instance;}
Ritor1
parents:
diff changeset
122 //----- (0042EB71) --------------------------------------------------------
Ritor1
parents:
diff changeset
123 struct IndoorCameraD3D *GetIndoorCamera() {return this->pIndoorCameraD3D;}
Ritor1
parents:
diff changeset
124
Ritor1
parents:
diff changeset
125
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1397
diff changeset
126 //void ( ***vdestructor_ptr)(Game *, bool);
0
Ritor1
parents:
diff changeset
127 Game__StationaryLight pStationaryLights[25];
Ritor1
parents:
diff changeset
128 char field_2C0[1092];
Ritor1
parents:
diff changeset
129 unsigned int uNumStationaryLights;
Ritor1
parents:
diff changeset
130 Game_Bloodsplat pBloodsplats[20];
Ritor1
parents:
diff changeset
131 int field_938;
Ritor1
parents:
diff changeset
132 int field_93C;
Ritor1
parents:
diff changeset
133 int field_940;
Ritor1
parents:
diff changeset
134 int field_944;
Ritor1
parents:
diff changeset
135 int field_948;
Ritor1
parents:
diff changeset
136 int field_94C;
Ritor1
parents:
diff changeset
137 int field_950;
Ritor1
parents:
diff changeset
138 int field_954;
Ritor1
parents:
diff changeset
139 int field_958;
Ritor1
parents:
diff changeset
140 int field_95C;
Ritor1
parents:
diff changeset
141 int field_960;
Ritor1
parents:
diff changeset
142 int field_964;
Ritor1
parents:
diff changeset
143 int field_968;
Ritor1
parents:
diff changeset
144 int field_96C;
Ritor1
parents:
diff changeset
145 int field_970;
Ritor1
parents:
diff changeset
146 Mouse *pMouse;
Ritor1
parents:
diff changeset
147 int field_978;
Ritor1
parents:
diff changeset
148 Game_stru0 stru_97C;
Ritor1
parents:
diff changeset
149 char field_98C[1148];
Ritor1
parents:
diff changeset
150 int uNumBloodsplats;
Ritor1
parents:
diff changeset
151 int field_E0C;
Ritor1
parents:
diff changeset
152 __int64 field_E10;
Ritor1
parents:
diff changeset
153 int uNumStationaryLights_in_pStationaryLightsStack;
Ritor1
parents:
diff changeset
154 unsigned int bGammaControlInitialized;
Ritor1
parents:
diff changeset
155 unsigned int uFlags;
Ritor1
parents:
diff changeset
156 unsigned int uFlags2;
Ritor1
parents:
diff changeset
157 float fSaturation;
Ritor1
parents:
diff changeset
158 unsigned __int64 uSomeGammaStartTime;
Ritor1
parents:
diff changeset
159 __int64 uSomeGammaDeltaTime;
1397
eb02a65e5c82 Quick Spell fixed.
Nomad
parents: 1394
diff changeset
160 void/*ThreadWard*/ *pThreadWardInstance;
0
Ritor1
parents:
diff changeset
161 ParticleEngine *pParticleEngine;
Ritor1
parents:
diff changeset
162 Mouse *pMouseInstance;
Ritor1
parents:
diff changeset
163 LightmapBuilder *pLightmapBuilder;
Ritor1
parents:
diff changeset
164 Vis *pVisInstance;
Ritor1
parents:
diff changeset
165 stru6 *pStru6Instance;
Ritor1
parents:
diff changeset
166 IndoorCameraD3D *pIndoorCameraD3D;
Ritor1
parents:
diff changeset
167 stru9 *pStru9Instance;
Ritor1
parents:
diff changeset
168 stru10 *pStru10Instance;
1392
Nomad
parents: 1214
diff changeset
169 void/*stru11*/ *pStru11Instance;
Nomad
parents: 1214
diff changeset
170 void/*stru12*/ *pStru12Instance;
1397
eb02a65e5c82 Quick Spell fixed.
Nomad
parents: 1394
diff changeset
171 void/*CShow*/ *pCShow;
0
Ritor1
parents:
diff changeset
172 Keyboard *pKeyboardInstance;
Ritor1
parents:
diff changeset
173 GammaController *pGammaController;
Ritor1
parents:
diff changeset
174 int field_E74;
Ritor1
parents:
diff changeset
175 };
Ritor1
parents:
diff changeset
176 #pragma pack(pop)
Ritor1
parents:
diff changeset
177
Ritor1
parents:
diff changeset
178
Ritor1
parents:
diff changeset
179
Ritor1
parents:
diff changeset
180
Ritor1
parents:
diff changeset
181
Ritor1
parents:
diff changeset
182
2343
5d263539bbec Moving functions from unsorted_subs.h pt5
Grumpy7
parents: 2155
diff changeset
183 extern Game *pGame;
5d263539bbec Moving functions from unsorted_subs.h pt5
Grumpy7
parents: 2155
diff changeset
184
5d263539bbec Moving functions from unsorted_subs.h pt5
Grumpy7
parents: 2155
diff changeset
185 void sub_42FBDD();
5d263539bbec Moving functions from unsorted_subs.h pt5
Grumpy7
parents: 2155
diff changeset
186 void CloseWindowBackground();
5d263539bbec Moving functions from unsorted_subs.h pt5
Grumpy7
parents: 2155
diff changeset
187 void GameUI_MsgProc();
5d263539bbec Moving functions from unsorted_subs.h pt5
Grumpy7
parents: 2155
diff changeset
188 void back_to_game();
2463
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
189 void GUI_MainMenuMessageProc();
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
190
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
191 void UpdateUserInput_and_MapSpecificStuff();
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
192 void PrepareWorld(unsigned int _0_box_loading_1_fullscreen);
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
193 void DoPrepareWorld(unsigned int bLoading, int _1_fullscreen_loading_2_box);
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
194
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
195 //int __stdcall aWinProc(HWND hWnd, UINT Msg, WPARAM wParam, unsigned int lParam);
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
196 int __stdcall InsertMM7CDDialogFunc(HWND hDlg, int a2, __int16 a3, int a4);
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
197 bool __fastcall FindMM7CD(HWND hWnd, char *pCDDrive);
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
198 //bool __fastcall Initialize(HINSTANCE hInst, char *pCmdLine);
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
199
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
200 void Game_DeinitializeAndTerminate(int exitCode); // idb
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
201 void FinalInitialization();
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
202 bool __fastcall CheckMM7CD(char c);
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
203 void SecondaryInitialization();
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
204
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
205
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
206 void MM6_Initialize(const wchar_t *pIniFilename);
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
207 void MM7Initialization();
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
208
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
209 void __fastcall PrepareToLoadODM(unsigned int bLoading, struct ODMRenderParams *a2);
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
210 void MainMenu_Loop();
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
211 unsigned int GameOverMenu(void *ecx0);
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
212 void ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
213 void _461103_load_level_sub();
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
214 void InitializeTurnBasedAnimations(void *);
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
215 void SetCurrentMenuID(enum MENU_STATE); // idb
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
216 enum MENU_STATE GetCurrentMenuID();
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
217 unsigned int GetGravityStrength();
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
218 void GameUI_StatusBar_UpdateTimedString(unsigned int bForceHide); // idb
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
219
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
220 void __fastcall sub_44861E_set_texture(unsigned int uFaceCog, const char *pFilename);
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
221 void __fastcall sub_44892E_set_faces_bit(int sCogNumber, int bit, int on);
0f17a30149ec cleaning project part 1
zipi
parents: 2343
diff changeset
222 void __fastcall SetDecorationSprite(uint16_t uCog, bool bHide, const char *pFileName); // idb
2464
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
223 void _494035_timed_effects__water_walking_damage__etc();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
224 void _493938_regenerate();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
225 void sub_491E3A();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
226 const char *GetReputationString(signed int a1);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
227 unsigned int __fastcall _494820_training_time(unsigned int a1);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
228 void LoadLevel_InitializeLevelStr();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
229 void OnMapLeave();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
230 void OnMapLoad();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
231 void Level_LoadEvtAndStr(const char *pLevelName);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
232 void sub_4452BB();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
233 bool _44100D_should_alter_right_panel();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
234 void Transition_StopSound_Autosave(const char *pMapName, MapStartPoint point); // sub_44987B idb
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
235
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
236 void __fastcall sub_4451A8_press_any_key(int a1, int a2, int a4);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
237
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
238 void OnTimer(int);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
239 bool TeleportToNWCDungeon();