-
Notifications
You must be signed in to change notification settings - Fork 105
/
Init.h
204 lines (168 loc) · 5.02 KB
/
Init.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
/*
* Copyright (C) 2006-2010 - Frictional Games
*
* This file is part of Penumbra Overture.
*
* Penumbra Overture is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Penumbra Overture is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Penumbra Overture. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GAME_INIT_H
#define GAME_INIT_H
#include "StdAfx.h"
using namespace hpl;
class cMapHandler;
class cButtonHandler;
class cPlayer;
class cGameScripts;
class cGameMessageHandler;
class cInventory;
class cFadeHandler;
class cSaveHandler;
class cTriggerHandler;
class cAttackHandler;
class cNotebook;
class cNumericalPanel;
class cDeathMenu;
class cGraphicsHelper;
class cEffectHandler;
class cPlayerHands;
class cGameMusicHandler;
class cRadioHandler;
class cMapLoadText;
class cPreMenu;
class cCredits;
class cDemoEndText;
class cIntroStory;
class cMainMenu;
#include "GameTypes.h"
#if defined(WIN32)
#define PERSONAL_RELATIVEROOT
#define PERSONAL_RELATIVEPIECES
#define PERSONAL_RELATIVEPIECES_COUNT 0
#define PERSONAL_RELATIVEGAME_PARENT _W("Penumbra Overture/")
#define PERSONAL_RELATIVEGAME _W("Penumbra Overture/Episode1/")
#elif defined(__linux__)
#define PERSONAL_RELATIVEROOT _W(".frictionalgames/")
#define PERSONAL_RELATIVEPIECES _W(".frictionalgames"),
#define PERSONAL_RELATIVEPIECES_COUNT 1
#define PERSONAL_RELATIVEGAME_PARENT _W("Penumbra/")
#define PERSONAL_RELATIVEGAME _W("Penumbra/Overture/")
#else
#define PERSONAL_RELATIVEROOT _W("Library/Preferences/Frictional Games/")
#define PERSONAL_RELATIVEPIECES _W("Library"), _W("Library/Preferences"), _W("Library/Preferences/Frictional Games"),
#define PERSONAL_RELATIVEPIECES_COUNT 3
#define PERSONAL_RELATIVEGAME_PARENT _W("Penumbra/")
#define PERSONAL_RELATIVEGAME _W("Penumbra/Overture/")
#endif
//--------------------------------------------------------
//#define DEMO_VERSION
//--------------------------------------------------------
class cInit : public iUpdateable
{
public:
cInit();
~cInit();
bool Init(tString asCommandLine);
void Run();
void Exit();
void OnStart();
void Update(float afTimeStep);
void Reset();
void ResetGame(bool abRunInitScript);
void RunScriptCommand(const tString& asCommand);
void CreateHardCodedPS(iParticleEmitterData *apPE);
void PreloadSoundEntityData(const tString &asFile);
void PreloadParticleSystem(const tString &asFile);
//Main objects
cConfigFile* mpConfig;
cConfigFile* mpGameConfig;
cGame *mpGame;
iScript *mpGlobalScript;
iFontData *mpDefaultFont;
//Main properties
cVector2l mvScreenSize;
bool mbFullScreen;
bool mbVsync;
tString msGlobalScriptFile;
tString msLanguageFile;
bool mbLogResources;
bool mbShowPreMenu;
bool mbShowMenu;
bool mbShowIntro;
int mlFSAA;
eGameDifficulty mDifficulty;
bool mbHasHaptics;
bool mbHasHapticsOnRestart;
bool mbHapticsAvailable;
float mfHapticForceMul;
float mfHapticMoveScreenSpeedMul;
float mfHapticScale;
float mfHapticProxyRadius;
float mfHapticOffsetZ;
float mfHapticMaxInteractDist;
int mlMaxSoundChannels;
int mlStreamUpdateFreq;
bool mbUseSoundHardware;
bool mbUseSoundThreading;
int mlMaxMonoChannelsHint;
int mlMaxStereoChannelsHint;
tString msDeviceName;
ePhysicsAccuracy mPhysicsAccuracy;
float mfPhysicsUpdatesPerSec;
tString msStartMap;
tString msStartLink;
bool mbSubtitles;
bool mbSimpleWeaponSwing;
bool mbDisablePersonalNotes;
bool mbAllowQuickSave;
bool mbFlashItems;
bool mbSimpleSwingInOptions;
bool mbShowCrossHair;
tWString msErrorMessage;
tString msWebPageOnExit;
bool mbDebugInteraction;
float mfMaxPhysicsTimeStep;
bool mbDestroyGraphics; //If graphics should be destroyed by the entities. Set to false at map change.
bool mbResetCache;
bool mbPostEffects;
int mlMaxSoundDataNum;
int mlMaxPSDataNum;
bool mbWeaponAttacking; //To see if it is a weapon that is dealing the damage.
tString msCurrentUser;
//Game objects
cMapHandler *mpMapHandler;
cButtonHandler *mpButtonHandler;
cPlayer *mpPlayer;
//cGameScripts *mpGameScripts;
cGameMessageHandler *mpGameMessageHandler;
cInventory* mpInventory;
cFadeHandler* mpFadeHandler;
cSaveHandler* mpSaveHandler;
cTriggerHandler* mpTriggerHandler;
cAttackHandler* mpAttackHandler;
cNotebook* mpNotebook;
cNumericalPanel* mpNumericalPanel;
cDeathMenu* mpDeathMenu;
cGraphicsHelper *mpGraphicsHelper;
cEffectHandler *mpEffectHandler;
cPlayerHands *mpPlayerHands;
cGameMusicHandler *mpMusicHandler;
cRadioHandler *mpRadioHandler;
cMapLoadText *mpMapLoadText;
cPreMenu *mpPreMenu;
cCredits *mpCredits;
cDemoEndText *mpDemoEndText;
cMainMenu *mpMainMenu;
cIntroStory* mpIntroStory;
};
#endif // GAME_INIT_H