OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4Game.h
Go to the documentation of this file.
1 /*
2  * OpenClonk, http://www.openclonk.org
3  *
4  * Copyright (c) 1998-2000, Matthes Bender
5  * Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de/
6  * Copyright (c) 2009-2016, The OpenClonk Team and contributors
7  *
8  * Distributed under the terms of the ISC license; see accompanying file
9  * "COPYING" for details.
10  *
11  * "Clonk" is a registered trademark of Matthes Bender, used with permission.
12  * See accompanying file "TRADEMARK" for details.
13  *
14  * To redistribute this file separately, substitute the full license texts
15  * for the above references.
16  */
17 
18 /* Main class to run the game */
19 
20 #ifndef INC_C4Game
21 #define INC_C4Game
22 
23 #include "landscape/C4Scenario.h"
24 #include "landscape/C4PathFinder.h"
25 #include "c4group/C4Extra.h"
26 #include "gui/C4Scoreboard.h"
29 
30 #include <memory>
31 
32 class C4ScriptGuiWindow;
33 
34 class C4Game
35 {
36 public:
37  // Initialization mode: Regular game start, section load or editor reload
38  enum InitMode
39  {
40  IM_Normal = 0,
43  };
44 private:
45  // used as StdCompiler-parameter
46  struct CompileSettings
47  {
48  InitMode init_mode;
49  bool fPlayers;
50  bool fExact;
51  bool fSync;
52 
53  CompileSettings(InitMode init_mode, bool fPlayers, bool fExact, bool fSync)
54  : init_mode(init_mode), fPlayers(fPlayers), fExact(fExact), fSync(fSync) { }
55  };
56 
57  // struct of keyboard set and indexed control key
58  struct C4KeySetCtrl
59  {
60  int32_t iKeySet, iCtrl;
61 
62  C4KeySetCtrl(int32_t iKeySet, int32_t iCtrl) : iKeySet(iKeySet), iCtrl(iCtrl) {}
63  };
64 
65 public:
66  C4Game();
67  ~C4Game();
68 
70  class C4ScenarioParameters &StartupScenarioParameters; // parameters given on command line or during startup UI
71  C4ClientList &Clients; // Shortcut
72  C4TeamList &Teams; // Shortcut
84  C4Control &Input; // shortcut
85 
97  std::unique_ptr<C4Network2Stats> pNetworkStatistics; // may be nullptr if no statistics are recorded
99  std::unique_ptr<C4FileMonitor> pFileMonitor;
100  std::unique_ptr<C4GameSec1Timer> pSec1Timer;
101  C4Value &GlobalSoundModifier; // contains proplist for sound modifier to be applied to all new sounds played
102 
110  std::unique_ptr<C4Network2Reference> pJoinReference;
113  int32_t FPS,cFPS;
114  int32_t HaltCount;
115  bool InitialPlayersJoined; // true after the InitializeFinal callback has been made
116  bool GameOver;
117  bool Evaluated;
120  bool fLobby;
121  int32_t iLobbyTimeout;
122  bool fObserve;
125  bool Record;
129  bool fPreinited; // set after PreInit has been called; unset by Clear and Default
130  int32_t FrameCounter;
132  bool TimeGo;
133  int32_t Time;
134  int32_t StartTime;
136  int32_t RandomSeed;
137  bool GameGo;
138  bool FullSpeed;
139  int32_t FrameSkip; bool DoSkipFrame;
140  bool fResortAnyObject; // if set, object list will be checked for unsorted objects next frame
141  bool IsRunning; // (NoSave) if set, the game is running; if not, just the startup message board is painted
142  bool PointersDenumerated; // (NoSave) set after object pointers have been denumerated
143  size_t StartupLogPos, QuitLogPos; // current log positions when game was last started and cleared
144  bool fQuitWithError; // if set, game shut down irregularly
145  // Show errors and allow debug commands?
146  bool DebugMode;
147  // next mission to be played after this one
149  // debug settings
151 
152  // Init and execution
153  void Clear();
154  void Abort(bool fApproved = false); // hard-quit on Esc+Y (/J/O)
155  void Evaluate();
156  void ShowGameOverDlg();
157  bool DoKeyboardInput(C4KeyCode vk_code, C4KeyEventType eEventType, bool fAlt, bool fCtrl, bool fShift, bool fRepeated, class C4GUI::Dialog *pForDialog=nullptr, bool fPlrCtrlOnly=false, int32_t iStrength=-1);
158  bool DoKeyboardInput(C4KeyCodeEx Key, C4KeyEventType eEventType, class C4GUI::Dialog *pForDialog=nullptr, bool fPlrCtrlOnly=false, int32_t iStrength=-1);
159  void DrawCrewOverheadText(C4TargetFacet &cgo, int32_t iPlayer);
160  void FixRandom(uint64_t iSeed);
161  bool Init();
162  bool PreInit();
163  void SetScenarioFilename(const char*);
164  bool HasScenario() { return *DirectJoinAddress || *ScenarioFilename || RecordStream.getSize(); }
165  bool Execute();
166  C4Player *JoinPlayer(const char *szFilename, int32_t iAtClient, const char *szAtClientName, C4PlayerInfo *pInfo);
167  void OnPlayerJoinFinished();
168  bool DoGameOver();
169  bool CanQuickSave();
170  bool QuickSave(const char *strFilename, const char *strTitle, bool fForceSave=false);
171  void SetInitProgress(float fToProgress);
172  void OnResolutionChanged(unsigned int iXRes, unsigned int iYRes); // update anything that's dependant on screen resolution
174  void InitFullscreenComponents(bool fRunning);
175  bool ToggleChat();
176  // Pause
177  bool TogglePause();
178  bool Pause();
179  bool Unpause();
180  bool IsPaused();
181  // Network
182  void Synchronize(bool fSavePlayerFiles);
183  void SyncClearance();
184  // Editing
185  bool DropFile(const char *szFilename, float iX, float iY);
186  bool DropDef(C4ID id, float iX, float iY);
187  bool ReloadFile(const char *szPath);
188  bool ReloadDef(C4ID id);
189  bool ReloadParticle(const char *szName);
190  // Object functions
191  void ClearPointers(C4Object *cobj);
192  C4Object *CreateObject(C4PropList * type, C4Object *pCreator, int32_t owner=NO_OWNER,
193  int32_t x=50, int32_t y=50, int32_t r=0, bool grow_from_center=false,
194  C4Real xdir=Fix0, C4Real ydir=Fix0, C4Real rdir=Fix0, int32_t iController=NO_OWNER);
195  C4Object *CreateObject(C4ID type, C4Object *pCreator, int32_t owner=NO_OWNER,
196  int32_t x=50, int32_t y=50, int32_t r=0, bool grow_from_center=false,
197  C4Real xdir=Fix0, C4Real ydir=Fix0, C4Real rdir=Fix0, int32_t iController=NO_OWNER);
199  C4Object *pCreator,
200  int32_t owner,
201  int32_t ctx=0, int32_t bty=0,
202  int32_t con=1, bool terrain=false);
203  C4Object *CreateInfoObject(C4ObjectInfo *cinf, int32_t owner,
204  int32_t tx=50, int32_t ty=50);
205  C4Object *FindConstuctionSiteBlock(int32_t tx, int32_t ty, int32_t wdt, int32_t hgt);
206  C4Object *FindObject(C4Def * pDef,
207  int32_t iX=0, int32_t iY=0, int32_t iWdt=0, int32_t iHgt=0,
208  DWORD ocf=OCF_All,
209  C4Object *pFindNext=nullptr);
210  C4Object *FindVisObject( // find object in view at pos, regarding parallaxity and visibility (but not distance)
211  float tx, float ty, int32_t iPlr, const C4Facet &fctViewportGame, const C4Facet &fctViewportGUI,
212  float iX, float iY,
213  DWORD category,
214  float gui_x, float gui_y);
215  int32_t ObjectCount(C4ID id);
216  void CastObjects(C4ID id, C4Object *pCreator, int32_t num, int32_t level, int32_t tx, int32_t ty, int32_t iOwner=NO_OWNER, int32_t iController=NO_OWNER, C4ValueArray *out_objects=nullptr);
217  C4Object *PlaceVegetation(C4PropList *def, int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt, int32_t iGrowth, C4PropList *shape_proplist, C4PropList * out_pos_proplist);
219  C4Value GRBroadcast(const char *szFunction, C4AulParSet *pPars = 0, bool fPassError=false, bool fRejectTest=false); // call function in scenario script and all goals/rules/environment objects
220 
221  bool LoadScenarioSection(const char *szSection, DWORD dwFlags);
222  bool CreateSectionFromTempFile(const char *section_name, const char *temp_filename);
223 
224  bool DrawTextSpecImage(C4Facet& fctTarget, const char *szSpec, class C4DrawTransform* pTransform, uint32_t dwClr=0xff);
225  float GetTextSpecImageAspect(const char* szSpec);
226  bool DrawPropListSpecImage(C4Facet& fctTarget, C4PropList *pSpec);
227  bool SpeedUp();
228  bool SlowDown();
229  bool InitKeyboard(); // register main keyboard input functions
230  void UpdateLanguage();
232  bool InitPlayerControlUserSettings(); // merge player control default settings and config overloads into user setting
233  void SetDefaultGamma();
234 
235  std::unique_ptr<C4ScriptGuiWindow> ScriptGuiRoot;
236 protected:
237  void Default();
238  void InitInEarth();
239  void InitVegetation();
240  void InitAnimals();
241  void InitGoals();
242  void InitRules();
243  void InitValueOverloads();
244  void InitEnvironment();
245  void CloseScenario();
246  void DeleteObjects(bool fDeleteInactive);
247  void ExecObjects();
248  void Ticks();
249  bool CheckObjectEnumeration();
250  bool LoadScenarioComponents();
251 public:
252  bool LoadAdditionalSystemGroup(class C4Group &parent_group);
253  bool SaveGameTitle(C4Group &hGroup);
254 protected:
255  bool InitGame(C4Group &hGroup, InitMode init_mode, bool fLoadSky, C4ValueNumbers *);
256  bool InitGameFinal(InitMode init_mode);
257  bool InitNetworkFromAddress(const char *szAddress);
258  bool InitNetworkFromReferenceFile(const char *temp_filename);
259  bool InitNetworkFromReference(const C4Network2Reference &Reference);
260  bool InitNetworkHost();
261  bool InitControl();
262  bool InitScriptEngine();
263  bool LinkScriptEngine();
264  bool ReLinkScriptEngine();
265  bool InitPlayers(C4ValueNumbers *);
266  bool OpenScenario();
267  bool InitDefs();
268  bool InitMaterialTexture();
269  bool GameOverCheck();
270  bool PlaceInEarth(C4ID id);
271 public:
272  void CompileFunc(StdCompiler *pComp, CompileSettings comp, C4ValueNumbers *);
273  bool SaveData(C4Group &hGroup, bool fSaveSection, bool fSaveExact, bool fSaveSync, C4ValueNumbers *);
274 protected:
275  bool CompileRuntimeData(C4Group &hGroup, InitMode init_mode, bool exact, bool sync, C4ValueNumbers *);
276 
277  // Object function internals
278  C4Object *NewObject( C4PropList *ndef, C4Object *pCreator,
279  int32_t owner, C4ObjectInfo *info,
280  int32_t tx, int32_t ty, int32_t tr,
281  C4Real xdir, C4Real ydir, C4Real rdir,
282  int32_t con, int32_t iController, bool grow_from_center);
283  void ClearObjectPtrs(C4Object *tptr);
284  void ObjectRemovalCheck();
285 
286  bool ToggleDebugMode(); // dbg modeon/off if allowed
287  bool ActivateMenu(const char *szCommand); // exec given menu command for first local player
288 
289 public:
290  bool ToggleChart(); // chart dlg on/off
291  void SetGlobalSoundModifier(C4PropList *modifier_props);
292 
293  static constexpr const char * DirectJoinFilePrefix = "file:";
294 };
295 
296 extern C4Game Game;
297 
298 // a global wrapper
299 inline StdStrBuf GetKeyboardInputName(const char *szKeyName, bool fShort = false, int32_t iIndex = 0)
300 {
301  return Game.KeyboardInput.GetKeyCodeNameByKeyName(szKeyName, fShort, iIndex);
302 }
303 
304 
305 #endif
bool DoGameOver()
Definition: C4Game.cpp:3099
void SetInitProgress(float fToProgress)
Definition: C4Game.cpp:3389
void InitValueOverloads()
Definition: C4Game.cpp:3350
C4Group * pParentGroup
Definition: C4Game.h:90
bool IsRunning
Definition: C4Game.h:141
bool InitMaterialTexture()
Definition: C4Game.cpp:811
bool InitGame(C4Group &hGroup, InitMode init_mode, bool fLoadSky, C4ValueNumbers *)
Definition: C4Game.cpp:2104
bool CreateSectionFromTempFile(const char *section_name, const char *temp_filename)
Definition: C4Game.cpp:3429
C4PlayerInfoList & RestorePlayerInfos
Definition: C4Game.h:74
int32_t iLobbyTimeout
Definition: C4Game.h:121
C4Game Game
Definition: C4Globals.cpp:52
char ScenarioFilename[_MAX_PATH+1]
Definition: C4Game.h:104
C4Object * CreateObjectConstruction(C4PropList *type, C4Object *pCreator, int32_t owner, int32_t ctx=0, int32_t bty=0, int32_t con=1, bool terrain=false)
Definition: C4Game.cpp:1106
StdStrBuf TempScenarioFile
Definition: C4Game.h:128
int32_t RandomSeed
Definition: C4Game.h:136
int32_t iTick255
Definition: C4Game.h:131
bool ToggleChat()
Definition: C4Game.cpp:3845
C4Object * NewObject(C4PropList *ndef, C4Object *pCreator, int32_t owner, C4ObjectInfo *info, int32_t tx, int32_t ty, int32_t tr, C4Real xdir, C4Real ydir, C4Real rdir, int32_t con, int32_t iController, bool grow_from_center)
Definition: C4Game.cpp:1015
InitMode
Definition: C4Game.h:38
std::unique_ptr< C4Network2Reference > pJoinReference
Definition: C4Game.h:110
StdStrBuf RecordDumpFile
Definition: C4Game.h:126
void InitEnvironment()
Definition: C4Game.cpp:3359
C4Value & GlobalSoundModifier
Definition: C4Game.h:101
StdCopyStrBuf NextMission
Definition: C4Game.h:148
float GetTextSpecImageAspect(const char *szSpec)
Definition: C4Game.cpp:3763
int32_t iTick5
Definition: C4Game.h:131
void SyncClearance()
Definition: C4Game.cpp:3133
~C4Game()
Definition: C4Game.cpp:118
int32_t iTick35
Definition: C4Game.h:131
C4LangStringTable MainSysLangStringTable
Definition: C4Game.h:82
C4Scenario C4S
Definition: C4Game.h:76
C4GroupSet GroupSet
Definition: C4Game.h:89
StdCopyStrBuf ScenarioTitle
Definition: C4Game.h:105
static constexpr const char * DirectJoinFilePrefix
Definition: C4Game.h:293
void InitGoals()
Definition: C4Game.cpp:3379
C4ComponentHost GameText
Definition: C4Game.h:81
void OnPlayerJoinFinished()
Definition: C4Game.cpp:3084
bool GameOverDlgShown
Definition: C4Game.h:118
char DirectJoinTempFilename[_MAX_PATH+1]
Definition: C4Game.h:109
int32_t ObjectCount(C4ID id)
Definition: C4Game.cpp:1293
StdStrBuf DebugHost
Definition: C4Game.h:150
bool Execute()
Definition: C4Game.cpp:713
int32_t LastInitProgress
Definition: C4Game.h:135
class C4ScenarioObjectsScriptHost * pScenarioObjectsScript
Definition: C4Game.h:92
C4Scoreboard Scoreboard
Definition: C4Game.h:96
bool LoadScenarioSection(const char *szSection, DWORD dwFlags)
Definition: C4Game.cpp:3471
#define _MAX_PATH
bool DoSkipFrame
Definition: C4Game.h:139
class C4ScenarioParameterDefs & ScenarioParameterDefs
Definition: C4Game.h:77
StdStrBuf PlayerNames
Definition: C4Game.h:83
bool SaveData(C4Group &hGroup, bool fSaveSection, bool fSaveExact, bool fSaveSync, C4ValueNumbers *)
Definition: C4Game.cpp:1779
C4ComponentHost Names
Definition: C4Game.h:80
bool InitPlayers(C4ValueNumbers *)
Definition: C4Game.cpp:2452
void CastObjects(C4ID id, C4Object *pCreator, int32_t num, int32_t level, int32_t tx, int32_t ty, int32_t iOwner=NO_OWNER, int32_t iController=NO_OWNER, C4ValueArray *out_objects=nullptr)
Definition: C4Game.cpp:1415
StdStrBuf DebugPassword
Definition: C4Game.h:150
C4GameParameters & Parameters
Definition: C4Game.h:69
C4Player * JoinPlayer(const char *szFilename, int32_t iAtClient, const char *szAtClientName, C4PlayerInfo *pInfo)
Definition: C4Game.cpp:3060
bool InitNetworkFromReferenceFile(const char *temp_filename)
Definition: C4Game.cpp:3217
bool OpenScenario()
Definition: C4Game.cpp:169
C4TeamList & Teams
Definition: C4Game.h:72
bool InitNetworkHost()
Definition: C4Game.cpp:3260
bool DoKeyboardInput(C4KeyCode vk_code, C4KeyEventType eEventType, bool fAlt, bool fCtrl, bool fShift, bool fRepeated, class C4GUI::Dialog *pForDialog=nullptr, bool fPlrCtrlOnly=false, int32_t iStrength=-1)
Definition: C4Game.cpp:1869
bool SlowDown()
Definition: C4Game.cpp:3836
bool ReLinkScriptEngine()
Definition: C4Game.cpp:2439
bool PlaceInEarth(C4ID id)
Definition: C4Game.cpp:2606
Definition: C4Real.h:58
bool Pause()
Definition: C4Game.cpp:954
size_t StartupLogPos
Definition: C4Game.h:143
StdCopyStrBuf NextMissionDesc
Definition: C4Game.h:148
C4LangStringTable ScenarioLangStringTable
Definition: C4Game.h:82
bool InitControl()
Definition: C4Game.cpp:2537
int32_t InitProgress
Definition: C4Game.h:135
void FixRandom(uint64_t iSeed)
Definition: C4Game.cpp:3094
void ShowGameOverDlg()
Definition: C4Game.cpp:3117
StdStrBuf GetKeyCodeNameByKeyName(const char *szKeyName, bool fShort=false, int32_t iIndex=0)
bool Init()
Definition: C4Game.cpp:332
uint16_t DebugPort
Definition: C4Game.h:150
int32_t FrameCounter
Definition: C4Game.h:130
bool LoadScenarioComponents()
Definition: C4Game.cpp:2857
void ObjectRemovalCheck()
Definition: C4Game.cpp:1313
std::unique_ptr< C4FileMonitor > pFileMonitor
Definition: C4Game.h:99
void Ticks()
Definition: C4Game.cpp:1640
C4Object * FindObject(C4Def *pDef, int32_t iX=0, int32_t iY=0, int32_t iWdt=0, int32_t iHgt=0, DWORD ocf=OCF_All, C4Object *pFindNext=nullptr)
Definition: C4Game.cpp:1162
int32_t StartTime
Definition: C4Game.h:134
bool CheckObjectEnumeration()
Definition: C4Game.cpp:3301
int32_t FrameSkip
Definition: C4Game.h:139
int32_t iTick1000
Definition: C4Game.h:131
bool GameOverCheck()
Definition: C4Game.cpp:674
bool fPreinited
Definition: C4Game.h:129
bool GameOver
Definition: C4Game.h:116
bool CompileRuntimeData(C4Group &hGroup, InitMode init_mode, bool exact, bool sync, C4ValueNumbers *)
Definition: C4Game.cpp:1757
int32_t FPS
Definition: C4Game.h:113
C4KeyboardInput & KeyboardInput
Definition: C4Game.h:98
bool SaveGameTitle(C4Group &hGroup)
Definition: C4Game.cpp:1833
bool ReloadParticle(const char *szName)
Definition: C4Game.cpp:2077
void CompileFunc(StdCompiler *pComp, CompileSettings comp, C4ValueNumbers *)
Definition: C4Game.cpp:1664
void UpdateLanguage()
Definition: C4Game.cpp:3028
bool QuickSave(const char *strFilename, const char *strTitle, bool fForceSave=false)
Definition: C4Game.cpp:1943
C4Group ScenarioFile
Definition: C4Game.h:88
void Abort(bool fApproved=false)
Definition: C4Game.cpp:3670
bool Unpause()
Definition: C4Game.cpp:980
bool InitialPlayersJoined
Definition: C4Game.h:115
int32_t Time
Definition: C4Game.h:133
C4Object * PlaceAnimal(C4PropList *def)
Definition: C4Game.cpp:2776
void Default()
Definition: C4Game.cpp:1448
C4Game()
Definition: C4Game.cpp:99
C4ScenarioSection * pScenarioSections
Definition: C4Game.h:93
bool fQuitWithError
Definition: C4Game.h:144
C4Value GRBroadcast(const char *szFunction, C4AulParSet *pPars=0, bool fPassError=false, bool fRejectTest=false)
Definition: C4Game.cpp:3850
Definition: C4Def.h:100
C4TransferZones TransferZones
Definition: C4Game.h:87
const unsigned int C4MaxName
const int NO_OWNER
Definition: C4Constants.h:138
bool InitDefs()
Definition: C4Game.cpp:124
StdCopyStrBuf NextMissionText
Definition: C4Game.h:148
C4Object * FindConstuctionSiteBlock(int32_t tx, int32_t ty, int32_t wdt, int32_t hgt)
Definition: C4Game.cpp:1146
bool ReloadDef(C4ID id)
Definition: C4Game.cpp:2019
void SetGlobalSoundModifier(C4PropList *modifier_props)
Definition: C4Game.cpp:3877
int32_t LastInitProgressShowTime
Definition: C4Game.h:135
int32_t iTick3
Definition: C4Game.h:131
bool InitNetworkFromReference(const C4Network2Reference &Reference)
Definition: C4Game.cpp:3235
void InitInEarth()
Definition: C4Game.cpp:2811
bool CanQuickSave()
Definition: C4Game.cpp:1934
bool ReloadFile(const char *szPath)
Definition: C4Game.cpp:2002
bool DropDef(C4ID id, float iX, float iY)
Definition: C4Game.cpp:1398
bool NetworkActive
Definition: C4Game.h:124
C4PlayerControlDefs PlayerControlDefs
Definition: C4Game.h:94
Definition: C4Id.h:28
C4RoundResults & RoundResults
Definition: C4Game.h:75
void SetScenarioFilename(const char *)
Definition: C4Game.cpp:532
int32_t iTick10
Definition: C4Game.h:131
bool ToggleDebugMode()
Definition: C4Game.cpp:3643
bool PreInit()
Definition: C4Game.cpp:286
void SetDefaultGamma()
Definition: C4Game.cpp:3864
bool fObserve
Definition: C4Game.h:122
C4Control & Input
Definition: C4Game.h:84
Definition: C4Game.h:34
bool fResortAnyObject
Definition: C4Game.h:140
bool IsPaused()
Definition: C4Game.cpp:1006
bool InitNetworkFromAddress(const char *szAddress)
Definition: C4Game.cpp:3164
void ClearPointers(C4Object *cobj)
Definition: C4Game.cpp:925
int32_t StartupPlayerCount
Definition: C4Game.h:111
C4PlayerInfoList & PlayerInfos
Definition: C4Game.h:73
void InitFullscreenComponents(bool fRunning)
Definition: C4Game.cpp:789
size_t QuitLogPos
Definition: C4Game.h:143
bool FullSpeed
Definition: C4Game.h:138
C4KeyEventType
bool PointersDenumerated
Definition: C4Game.h:142
void OnResolutionChanged(unsigned int iXRes, unsigned int iYRes)
Definition: C4Game.cpp:3410
char PlayerFilenames[20 *_MAX_PATH+1]
Definition: C4Game.h:106
bool Evaluated
Definition: C4Game.h:117
bool LinkScriptEngine()
Definition: C4Game.cpp:2418
void InitRules()
Definition: C4Game.cpp:3369
bool HasScenario()
Definition: C4Game.h:164
class C4ScenarioParameters & StartupScenarioParameters
Definition: C4Game.h:70
size_t getSize() const
Definition: StdBuf.h:452
bool InitKeyboard()
Definition: C4Game.cpp:2934
C4PathFinder PathFinder
Definition: C4Game.h:86
void ExecObjects()
Definition: C4Game.cpp:1325
const uint32_t OCF_All
Definition: C4Constants.h:78
bool InitPlayerControlUserSettings()
Definition: C4Game.cpp:3050
void DeleteObjects(bool fDeleteInactive)
Definition: C4Game.cpp:1053
void Synchronize(bool fSavePlayerFiles)
Definition: C4Game.cpp:3139
bool SpeedUp()
Definition: C4Game.cpp:3826
bool GameGo
Definition: C4Game.h:137
C4ClientList & Clients
Definition: C4Game.h:71
bool Record
Definition: C4Game.h:125
StdStrBuf RecordStream
Definition: C4Game.h:127
bool ToggleChart()
Definition: C4Game.cpp:3664
char DefinitionFilenames[20 *_MAX_PATH+1]
Definition: C4Game.h:107
std::unique_ptr< C4GameSec1Timer > pSec1Timer
Definition: C4Game.h:100
void InitAnimals()
Definition: C4Game.cpp:2842
void InitVegetation()
Definition: C4Game.cpp:2827
int32_t StartupTeamCount
Definition: C4Game.h:112
C4ComponentHost Info
Definition: C4Game.h:78
bool TogglePause()
Definition: C4Game.cpp:946
bool fReferenceDefinitionOverride
Definition: C4Game.h:123
int32_t HaltCount
Definition: C4Game.h:114
bool LoadAdditionalSystemGroup(class C4Group &parent_group)
Definition: C4Game.cpp:2888
void Clear()
Definition: C4Game.cpp:541
bool DropFile(const char *szFilename, float iX, float iY)
Definition: C4Game.cpp:1377
bool InitScriptEngine()
Definition: C4Game.cpp:2377
bool InitGameFinal(InitMode init_mode)
Definition: C4Game.cpp:2331
std::unique_ptr< C4ScriptGuiWindow > ScriptGuiRoot
Definition: C4Game.h:235
char DirectJoinAddress[_MAX_PATH+1]
Definition: C4Game.h:108
bool InitPlayerControlSettings()
Definition: C4Game.cpp:3034
int32_t cFPS
Definition: C4Game.h:113
C4Object * FindVisObject(float tx, float ty, int32_t iPlr, const C4Facet &fctViewportGame, const C4Facet &fctViewportGUI, float iX, float iY, DWORD category, float gui_x, float gui_y)
Definition: C4Game.cpp:1229
C4Extra Extra
Definition: C4Game.h:91
std::unique_ptr< C4Network2Stats > pNetworkStatistics
Definition: C4Game.h:97
uint32_t DWORD
void ClearObjectPtrs(C4Object *tptr)
Definition: C4Game.cpp:909
bool DrawPropListSpecImage(C4Facet &fctTarget, C4PropList *pSpec)
Definition: C4Game.cpp:3795
bool fScriptCreatedObjects
Definition: C4Game.h:119
bool fLobby
Definition: C4Game.h:120
C4PlayerControlAssignmentSets PlayerControlDefaultAssignmentSets
Definition: C4Game.h:95
void CloseScenario()
Definition: C4Game.cpp:267
char CurrentScenarioSection[C4MaxName+1]
Definition: C4Game.h:103
C4PlayerControlAssignmentSets PlayerControlUserAssignmentSets
Definition: C4Game.h:95
unsigned long C4KeyCode
C4Object * PlaceVegetation(C4PropList *def, int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt, int32_t iGrowth, C4PropList *shape_proplist, C4PropList *out_pos_proplist)
Definition: C4Game.cpp:2653
StdStrBuf GetKeyboardInputName(const char *szKeyName, bool fShort=false, int32_t iIndex=0)
Definition: C4Game.h:299
void Evaluate()
Definition: C4Game.cpp:1507
C4Object * CreateInfoObject(C4ObjectInfo *cinf, int32_t owner, int32_t tx=50, int32_t ty=50)
Definition: C4Game.cpp:1090
C4ComponentHost Title
Definition: C4Game.h:79
C4ScenarioSection * pCurrentScenarioSection
Definition: C4Game.h:93
bool TimeGo
Definition: C4Game.h:132
bool DebugMode
Definition: C4Game.h:146
C4Object * CreateObject(C4PropList *type, C4Object *pCreator, int32_t owner=NO_OWNER, int32_t x=50, int32_t y=50, int32_t r=0, bool grow_from_center=false, C4Real xdir=Fix0, C4Real ydir=Fix0, C4Real rdir=Fix0, int32_t iController=NO_OWNER)
Definition: C4Game.cpp:1076
bool ActivateMenu(const char *szCommand)
Definition: C4Game.cpp:3653
void OnKeyboardLayoutChanged()
Definition: C4Game.cpp:3422
void DrawCrewOverheadText(C4TargetFacet &cgo, int32_t iPlayer)
Definition: C4Game.cpp:1536
bool DrawTextSpecImage(C4Facet &fctTarget, const char *szSpec, class C4DrawTransform *pTransform, uint32_t dwClr=0xff)
Definition: C4Game.cpp:3741
const C4Real Fix0
Definition: C4Real.h:312
int DebugWait
Definition: C4Game.h:150
int32_t iTick2
Definition: C4Game.h:131