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 "c4group/C4Extra.h"
25 #include "gui/C4Scoreboard.h"
26 #include "landscape/C4PathFinder.h"
27 #include "landscape/C4Scenario.h"
29 
30 class C4ScriptGuiWindow;
31 
32 class C4Game
33 {
34 public:
35  // Initialization mode: Regular game start, section load or editor reload
36  enum InitMode
37  {
38  IM_Normal = 0,
41  };
42 private:
43  // used as StdCompiler-parameter
44  struct CompileSettings
45  {
46  InitMode init_mode;
47  bool fPlayers;
48  bool fExact;
49  bool fSync;
50 
51  CompileSettings(InitMode init_mode, bool fPlayers, bool fExact, bool fSync)
52  : init_mode(init_mode), fPlayers(fPlayers), fExact(fExact), fSync(fSync) { }
53  };
54 
55  // struct of keyboard set and indexed control key
56  struct C4KeySetCtrl
57  {
58  int32_t iKeySet, iCtrl;
59 
60  C4KeySetCtrl(int32_t iKeySet, int32_t iCtrl) : iKeySet(iKeySet), iCtrl(iCtrl) {}
61  };
62 
63 public:
64  C4Game();
65  ~C4Game();
66 
68  class C4ScenarioParameters &StartupScenarioParameters; // parameters given on command line or during startup UI
69  C4ClientList &Clients; // Shortcut
70  C4TeamList &Teams; // Shortcut
82  C4Control &Input; // shortcut
83 
95  std::unique_ptr<C4Network2Stats> pNetworkStatistics; // may be nullptr if no statistics are recorded
97  std::unique_ptr<C4FileMonitor> pFileMonitor;
98  std::unique_ptr<C4GameSec1Timer> pSec1Timer;
99  C4Value &GlobalSoundModifier; // contains proplist for sound modifier to be applied to all new sounds played
100 
108  std::unique_ptr<C4Network2Reference> pJoinReference;
111  int32_t FPS,cFPS;
112  int32_t HaltCount;
113  bool InitialPlayersJoined; // true after the InitializeFinal callback has been made
114  bool GameOver;
115  bool Evaluated;
118  bool fLobby;
119  int32_t iLobbyTimeout;
120  bool fObserve;
123  bool Record;
127  bool fPreinited{false}; // set after PreInit has been called; unset by Clear and Default
128  int32_t FrameCounter;
130  bool TimeGo;
131  int32_t Time;
132  int32_t StartTime;
134  int32_t RandomSeed;
135  bool GameGo;
136  bool FullSpeed;
137  int32_t FrameSkip; bool DoSkipFrame;
138  bool fResortAnyObject; // if set, object list will be checked for unsorted objects next frame
139  bool IsRunning; // (NoSave) if set, the game is running; if not, just the startup message board is painted
140  bool PointersDenumerated; // (NoSave) set after object pointers have been denumerated
141  size_t StartupLogPos{0}, QuitLogPos{0}; // current log positions when game was last started and cleared
142  bool fQuitWithError{false}; // if set, game shut down irregularly
143  // Show errors and allow debug commands?
144  bool DebugMode;
145  // next mission to be played after this one
147  // debug settings
149 
150  // Init and execution
151  void Clear();
152  void Abort(bool fApproved = false); // hard-quit on Esc+Y (/J/O)
153  void Evaluate();
154  void ShowGameOverDlg();
155  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);
156  bool DoKeyboardInput(C4KeyCodeEx Key, C4KeyEventType eEventType, class C4GUI::Dialog *pForDialog=nullptr, bool fPlrCtrlOnly=false, int32_t iStrength=-1);
157  void DrawCrewOverheadText(C4TargetFacet &cgo, int32_t iPlayer);
158  void FixRandom(uint64_t iSeed);
159  bool Init();
160  bool PreInit();
161  void SetScenarioFilename(const char*);
162  bool HasScenario() { return *DirectJoinAddress || *ScenarioFilename || RecordStream.getSize(); }
163  bool Execute();
164  C4Player *JoinPlayer(const char *szFilename, int32_t iAtClient, const char *szAtClientName, C4PlayerInfo *pInfo);
165  void OnPlayerJoinFinished();
166  bool DoGameOver();
167  bool CanQuickSave();
168  bool QuickSave(const char *strFilename, const char *strTitle, bool fForceSave=false);
169  void SetInitProgress(float fToProgress);
170  void OnResolutionChanged(unsigned int iXRes, unsigned int iYRes); // update anything that's dependant on screen resolution
172  void InitFullscreenComponents(bool fRunning);
173  bool ToggleChat();
174  // Pause
175  bool TogglePause();
176  bool Pause();
177  bool Unpause();
178  bool IsPaused();
179  // Network
180  void Synchronize(bool fSavePlayerFiles);
181  void SyncClearance();
182  // Editing
183  bool DropFile(const char *szFilename, float iX, float iY);
184  bool DropDef(C4ID id, float iX, float iY);
185  bool ReloadFile(const char *szPath);
186  bool ReloadDef(C4ID id);
187  bool ReloadParticle(const char *szName);
188  // Object functions
189  void ClearPointers(C4Object *cobj);
190  C4Object *CreateObject(C4PropList * type, C4Object *pCreator, int32_t owner=NO_OWNER,
191  int32_t x=50, int32_t y=50, int32_t r=0, bool grow_from_center=false,
192  C4Real xdir=Fix0, C4Real ydir=Fix0, C4Real rdir=Fix0, int32_t iController=NO_OWNER);
193  C4Object *CreateObject(C4ID type, C4Object *pCreator, int32_t owner=NO_OWNER,
194  int32_t x=50, int32_t y=50, int32_t r=0, bool grow_from_center=false,
195  C4Real xdir=Fix0, C4Real ydir=Fix0, C4Real rdir=Fix0, int32_t iController=NO_OWNER);
197  C4Object *pCreator,
198  int32_t owner,
199  int32_t ctx=0, int32_t bty=0,
200  int32_t con=1, bool terrain=false);
201  C4Object *CreateInfoObject(C4ObjectInfo *cinf, int32_t owner,
202  int32_t tx=50, int32_t ty=50);
203  C4Object *FindConstuctionSiteBlock(int32_t tx, int32_t ty, int32_t wdt, int32_t hgt);
204  C4Object *FindObject(C4Def * pDef,
205  int32_t iX=0, int32_t iY=0, int32_t iWdt=0, int32_t iHgt=0,
206  DWORD ocf=OCF_All,
207  C4Object *pFindNext=nullptr);
208  C4Object *FindVisObject( // find object in view at pos, regarding parallaxity and visibility (but not distance)
209  float tx, float ty, int32_t iPlr, const C4Facet &fctViewportGame, const C4Facet &fctViewportGUI,
210  float iX, float iY,
211  DWORD category,
212  float gui_x, float gui_y);
213  int32_t ObjectCount(C4ID id);
214  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);
215  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);
217  C4Value GRBroadcast(const char *szFunction, C4AulParSet *pPars = nullptr, bool fPassError=false, bool fRejectTest=false); // call function in scenario script and all goals/rules/environment objects
218 
219  bool LoadScenarioSection(const char *szSection, DWORD dwFlags);
220  bool CreateSectionFromTempFile(const char *section_name, const char *temp_filename);
221 
222  bool DrawTextSpecImage(C4Facet& fctTarget, const char *szSpec, class C4DrawTransform* pTransform, uint32_t dwClr=0xff);
223  float GetTextSpecImageAspect(const char* szSpec);
224  bool DrawPropListSpecImage(C4Facet& fctTarget, C4PropList *pSpec);
225  bool SpeedUp();
226  bool SlowDown();
227  bool InitKeyboard(); // register main keyboard input functions
228  void UpdateLanguage();
230  bool InitPlayerControlUserSettings(); // merge player control default settings and config overloads into user setting
231  void SetDefaultGamma();
232 
233  std::unique_ptr<C4ScriptGuiWindow> ScriptGuiRoot;
234 protected:
235  void Default();
236  void InitInEarth();
237  void InitVegetation();
238  void InitAnimals();
239  void InitGoals();
240  void InitRules();
241  void InitValueOverloads();
242  void InitEnvironment();
243  void CloseScenario();
244  void DeleteObjects(bool fDeleteInactive);
245  void ExecObjects();
246  void Ticks();
247  bool CheckObjectEnumeration();
248  bool LoadScenarioComponents();
249 public:
250  bool LoadAdditionalSystemGroup(class C4Group &parent_group);
251  bool SaveGameTitle(C4Group &hGroup);
252 protected:
253  bool InitGame(C4Group &hGroup, InitMode init_mode, bool fLoadSky, C4ValueNumbers *);
254  bool InitGameFinal(InitMode init_mode);
255  bool InitNetworkFromAddress(const char *szAddress);
256  bool InitNetworkFromReferenceFile(const char *temp_filename);
257  bool InitNetworkFromReference(const C4Network2Reference &Reference);
258  bool InitNetworkHost();
259  bool InitControl();
260  bool InitScriptEngine();
261  bool LinkScriptEngine();
262  bool ReLinkScriptEngine();
263  bool InitPlayers(C4ValueNumbers *);
264  bool OpenScenario();
265  bool InitDefs();
266  bool InitMaterialTexture();
267  bool GameOverCheck();
268  bool PlaceInEarth(C4ID id);
269 public:
270  void CompileFunc(StdCompiler *pComp, CompileSettings comp, C4ValueNumbers *);
271  bool SaveData(C4Group &hGroup, bool fSaveSection, bool fSaveExact, bool fSaveSync, C4ValueNumbers *);
272 protected:
273  bool CompileRuntimeData(C4Group &hGroup, InitMode init_mode, bool exact, bool sync, C4ValueNumbers *);
274 
275  // Object function internals
276  C4Object *NewObject( C4PropList *ndef, C4Object *pCreator,
277  int32_t owner, C4ObjectInfo *info,
278  int32_t tx, int32_t ty, int32_t tr,
279  C4Real xdir, C4Real ydir, C4Real rdir,
280  int32_t con, int32_t iController, bool grow_from_center);
281  void ClearObjectPtrs(C4Object *tptr);
282  void ObjectRemovalCheck();
283 
284  bool ToggleDebugMode(); // dbg modeon/off if allowed
285  bool ActivateMenu(const char *szCommand); // exec given menu command for first local player
286 
287 public:
288  bool ToggleChart(); // chart dlg on/off
289  void SetGlobalSoundModifier(C4PropList *modifier_props);
290 
291  // Localized strings in editor props
292  C4String *GetTranslatedString(const class C4Value &input_string, C4Value *selected_language, bool fail_silently) const;
294 
295  static constexpr const char * DirectJoinFilePrefix = "file:";
296 };
297 
298 extern C4Game Game;
299 
300 // a global wrapper
301 inline StdStrBuf GetKeyboardInputName(const char *szKeyName, bool fShort = false, int32_t iIndex = 0)
302 {
303  return Game.KeyboardInput.GetKeyCodeNameByKeyName(szKeyName, fShort, iIndex);
304 }
305 
306 
307 #endif
bool DoGameOver()
Definition: C4Game.cpp:3095
void SetInitProgress(float fToProgress)
Definition: C4Game.cpp:3385
void InitValueOverloads()
Definition: C4Game.cpp:3346
C4Group * pParentGroup
Definition: C4Game.h:88
bool IsRunning
Definition: C4Game.h:139
bool InitMaterialTexture()
Definition: C4Game.cpp:807
bool InitGame(C4Group &hGroup, InitMode init_mode, bool fLoadSky, C4ValueNumbers *)
Definition: C4Game.cpp:2100
bool CreateSectionFromTempFile(const char *section_name, const char *temp_filename)
Definition: C4Game.cpp:3425
C4PlayerInfoList & RestorePlayerInfos
Definition: C4Game.h:72
int32_t iLobbyTimeout
Definition: C4Game.h:119
C4Game Game
Definition: C4Globals.cpp:52
char ScenarioFilename[_MAX_PATH+1]
Definition: C4Game.h:102
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:1102
StdStrBuf TempScenarioFile
Definition: C4Game.h:126
int32_t RandomSeed
Definition: C4Game.h:134
int32_t iTick255
Definition: C4Game.h:129
bool ToggleChat()
Definition: C4Game.cpp:3841
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:1011
InitMode
Definition: C4Game.h:36
std::unique_ptr< C4Network2Reference > pJoinReference
Definition: C4Game.h:108
StdStrBuf RecordDumpFile
Definition: C4Game.h:124
void InitEnvironment()
Definition: C4Game.cpp:3355
C4Value & GlobalSoundModifier
Definition: C4Game.h:99
StdCopyStrBuf NextMission
Definition: C4Game.h:146
float GetTextSpecImageAspect(const char *szSpec)
Definition: C4Game.cpp:3759
int32_t iTick5
Definition: C4Game.h:129
void SyncClearance()
Definition: C4Game.cpp:3129
~C4Game()
Definition: C4Game.cpp:114
int32_t iTick35
Definition: C4Game.h:129
C4LangStringTable MainSysLangStringTable
Definition: C4Game.h:80
C4Scenario C4S
Definition: C4Game.h:74
C4GroupSet GroupSet
Definition: C4Game.h:87
StdCopyStrBuf ScenarioTitle
Definition: C4Game.h:103
static constexpr const char * DirectJoinFilePrefix
Definition: C4Game.h:295
void InitGoals()
Definition: C4Game.cpp:3375
C4ComponentHost GameText
Definition: C4Game.h:79
void OnPlayerJoinFinished()
Definition: C4Game.cpp:3080
bool GameOverDlgShown
Definition: C4Game.h:116
char DirectJoinTempFilename[_MAX_PATH+1]
Definition: C4Game.h:107
int32_t ObjectCount(C4ID id)
Definition: C4Game.cpp:1289
StdStrBuf DebugHost
Definition: C4Game.h:148
bool Execute()
Definition: C4Game.cpp:709
C4PropList * AllocateTranslatedString()
Definition: C4Game.cpp:3963
int32_t LastInitProgress
Definition: C4Game.h:133
class C4ScenarioObjectsScriptHost * pScenarioObjectsScript
Definition: C4Game.h:90
C4Scoreboard Scoreboard
Definition: C4Game.h:94
bool LoadScenarioSection(const char *szSection, DWORD dwFlags)
Definition: C4Game.cpp:3467
#define _MAX_PATH
bool DoSkipFrame
Definition: C4Game.h:137
class C4ScenarioParameterDefs & ScenarioParameterDefs
Definition: C4Game.h:75
StdStrBuf PlayerNames
Definition: C4Game.h:81
bool SaveData(C4Group &hGroup, bool fSaveSection, bool fSaveExact, bool fSaveSync, C4ValueNumbers *)
Definition: C4Game.cpp:1775
C4ComponentHost Names
Definition: C4Game.h:78
bool InitPlayers(C4ValueNumbers *)
Definition: C4Game.cpp:2448
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:1411
StdStrBuf DebugPassword
Definition: C4Game.h:148
C4GameParameters & Parameters
Definition: C4Game.h:67
C4Player * JoinPlayer(const char *szFilename, int32_t iAtClient, const char *szAtClientName, C4PlayerInfo *pInfo)
Definition: C4Game.cpp:3056
bool InitNetworkFromReferenceFile(const char *temp_filename)
Definition: C4Game.cpp:3213
bool OpenScenario()
Definition: C4Game.cpp:165
C4TeamList & Teams
Definition: C4Game.h:70
bool InitNetworkHost()
Definition: C4Game.cpp:3256
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:1865
bool SlowDown()
Definition: C4Game.cpp:3832
bool ReLinkScriptEngine()
Definition: C4Game.cpp:2435
bool PlaceInEarth(C4ID id)
Definition: C4Game.cpp:2602
Definition: C4Real.h:58
bool Pause()
Definition: C4Game.cpp:950
size_t StartupLogPos
Definition: C4Game.h:141
StdCopyStrBuf NextMissionDesc
Definition: C4Game.h:146
C4LangStringTable ScenarioLangStringTable
Definition: C4Game.h:80
bool InitControl()
Definition: C4Game.cpp:2533
int32_t InitProgress
Definition: C4Game.h:133
void FixRandom(uint64_t iSeed)
Definition: C4Game.cpp:3090
void ShowGameOverDlg()
Definition: C4Game.cpp:3113
StdStrBuf GetKeyCodeNameByKeyName(const char *szKeyName, bool fShort=false, int32_t iIndex=0)
bool Init()
Definition: C4Game.cpp:328
uint16_t DebugPort
Definition: C4Game.h:148
int32_t FrameCounter
Definition: C4Game.h:128
bool LoadScenarioComponents()
Definition: C4Game.cpp:2853
void ObjectRemovalCheck()
Definition: C4Game.cpp:1309
std::unique_ptr< C4FileMonitor > pFileMonitor
Definition: C4Game.h:97
void Ticks()
Definition: C4Game.cpp:1636
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:1158
int32_t StartTime
Definition: C4Game.h:132
bool CheckObjectEnumeration()
Definition: C4Game.cpp:3297
int32_t FrameSkip
Definition: C4Game.h:137
int32_t iTick1000
Definition: C4Game.h:129
bool GameOverCheck()
Definition: C4Game.cpp:670
bool fPreinited
Definition: C4Game.h:127
bool GameOver
Definition: C4Game.h:114
bool CompileRuntimeData(C4Group &hGroup, InitMode init_mode, bool exact, bool sync, C4ValueNumbers *)
Definition: C4Game.cpp:1753
int32_t FPS
Definition: C4Game.h:111
C4KeyboardInput & KeyboardInput
Definition: C4Game.h:96
bool SaveGameTitle(C4Group &hGroup)
Definition: C4Game.cpp:1829
bool ReloadParticle(const char *szName)
Definition: C4Game.cpp:2073
void CompileFunc(StdCompiler *pComp, CompileSettings comp, C4ValueNumbers *)
Definition: C4Game.cpp:1660
void UpdateLanguage()
Definition: C4Game.cpp:3024
bool QuickSave(const char *strFilename, const char *strTitle, bool fForceSave=false)
Definition: C4Game.cpp:1939
C4Group ScenarioFile
Definition: C4Game.h:86
void Abort(bool fApproved=false)
Definition: C4Game.cpp:3666
bool Unpause()
Definition: C4Game.cpp:976
bool InitialPlayersJoined
Definition: C4Game.h:113
int32_t Time
Definition: C4Game.h:131
C4Object * PlaceAnimal(C4PropList *def)
Definition: C4Game.cpp:2772
void Default()
Definition: C4Game.cpp:1444
C4Game()
Definition: C4Game.cpp:97
C4ScenarioSection * pScenarioSections
Definition: C4Game.h:91
bool fQuitWithError
Definition: C4Game.h:142
Definition: C4Def.h:98
C4TransferZones TransferZones
Definition: C4Game.h:85
const unsigned int C4MaxName
const int NO_OWNER
Definition: C4Constants.h:138
bool InitDefs()
Definition: C4Game.cpp:120
StdCopyStrBuf NextMissionText
Definition: C4Game.h:146
C4Object * FindConstuctionSiteBlock(int32_t tx, int32_t ty, int32_t wdt, int32_t hgt)
Definition: C4Game.cpp:1142
bool ReloadDef(C4ID id)
Definition: C4Game.cpp:2015
void SetGlobalSoundModifier(C4PropList *modifier_props)
Definition: C4Game.cpp:3873
int32_t LastInitProgressShowTime
Definition: C4Game.h:133
int32_t iTick3
Definition: C4Game.h:129
bool InitNetworkFromReference(const C4Network2Reference &Reference)
Definition: C4Game.cpp:3231
void InitInEarth()
Definition: C4Game.cpp:2807
bool CanQuickSave()
Definition: C4Game.cpp:1930
bool ReloadFile(const char *szPath)
Definition: C4Game.cpp:1998
bool DropDef(C4ID id, float iX, float iY)
Definition: C4Game.cpp:1394
bool NetworkActive
Definition: C4Game.h:122
C4PlayerControlDefs PlayerControlDefs
Definition: C4Game.h:92
Definition: C4Id.h:25
C4RoundResults & RoundResults
Definition: C4Game.h:73
void SetScenarioFilename(const char *)
Definition: C4Game.cpp:528
int32_t iTick10
Definition: C4Game.h:129
bool ToggleDebugMode()
Definition: C4Game.cpp:3639
bool PreInit()
Definition: C4Game.cpp:282
void SetDefaultGamma()
Definition: C4Game.cpp:3860
bool fObserve
Definition: C4Game.h:120
C4Control & Input
Definition: C4Game.h:82
Definition: C4Game.h:32
bool fResortAnyObject
Definition: C4Game.h:138
bool IsPaused()
Definition: C4Game.cpp:1002
bool InitNetworkFromAddress(const char *szAddress)
Definition: C4Game.cpp:3160
void ClearPointers(C4Object *cobj)
Definition: C4Game.cpp:921
int32_t StartupPlayerCount
Definition: C4Game.h:109
C4PlayerInfoList & PlayerInfos
Definition: C4Game.h:71
void InitFullscreenComponents(bool fRunning)
Definition: C4Game.cpp:785
size_t QuitLogPos
Definition: C4Game.h:141
bool FullSpeed
Definition: C4Game.h:136
C4KeyEventType
bool PointersDenumerated
Definition: C4Game.h:140
void OnResolutionChanged(unsigned int iXRes, unsigned int iYRes)
Definition: C4Game.cpp:3406
char PlayerFilenames[20 *_MAX_PATH+1]
Definition: C4Game.h:104
bool Evaluated
Definition: C4Game.h:115
bool LinkScriptEngine()
Definition: C4Game.cpp:2414
void InitRules()
Definition: C4Game.cpp:3365
bool HasScenario()
Definition: C4Game.h:162
class C4ScenarioParameters & StartupScenarioParameters
Definition: C4Game.h:68
size_t getSize() const
Definition: StdBuf.h:444
bool InitKeyboard()
Definition: C4Game.cpp:2930
C4PathFinder PathFinder
Definition: C4Game.h:84
void ExecObjects()
Definition: C4Game.cpp:1321
const uint32_t OCF_All
Definition: C4Constants.h:78
bool InitPlayerControlUserSettings()
Definition: C4Game.cpp:3046
void DeleteObjects(bool fDeleteInactive)
Definition: C4Game.cpp:1049
void Synchronize(bool fSavePlayerFiles)
Definition: C4Game.cpp:3135
C4Value GRBroadcast(const char *szFunction, C4AulParSet *pPars=nullptr, bool fPassError=false, bool fRejectTest=false)
Definition: C4Game.cpp:3846
bool SpeedUp()
Definition: C4Game.cpp:3822
bool GameGo
Definition: C4Game.h:135
C4ClientList & Clients
Definition: C4Game.h:69
bool Record
Definition: C4Game.h:123
StdStrBuf RecordStream
Definition: C4Game.h:125
bool ToggleChart()
Definition: C4Game.cpp:3660
char DefinitionFilenames[20 *_MAX_PATH+1]
Definition: C4Game.h:105
std::unique_ptr< C4GameSec1Timer > pSec1Timer
Definition: C4Game.h:98
void InitAnimals()
Definition: C4Game.cpp:2838
void InitVegetation()
Definition: C4Game.cpp:2823
int32_t StartupTeamCount
Definition: C4Game.h:110
C4ComponentHost Info
Definition: C4Game.h:76
bool TogglePause()
Definition: C4Game.cpp:942
bool fReferenceDefinitionOverride
Definition: C4Game.h:121
int32_t HaltCount
Definition: C4Game.h:112
bool LoadAdditionalSystemGroup(class C4Group &parent_group)
Definition: C4Game.cpp:2884
void Clear()
Definition: C4Game.cpp:537
bool DropFile(const char *szFilename, float iX, float iY)
Definition: C4Game.cpp:1373
bool InitScriptEngine()
Definition: C4Game.cpp:2373
bool InitGameFinal(InitMode init_mode)
Definition: C4Game.cpp:2327
std::unique_ptr< C4ScriptGuiWindow > ScriptGuiRoot
Definition: C4Game.h:233
char DirectJoinAddress[_MAX_PATH+1]
Definition: C4Game.h:106
bool InitPlayerControlSettings()
Definition: C4Game.cpp:3030
int32_t cFPS
Definition: C4Game.h:111
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:1225
C4Extra Extra
Definition: C4Game.h:89
std::unique_ptr< C4Network2Stats > pNetworkStatistics
Definition: C4Game.h:95
uint32_t DWORD
void ClearObjectPtrs(C4Object *tptr)
Definition: C4Game.cpp:905
bool DrawPropListSpecImage(C4Facet &fctTarget, C4PropList *pSpec)
Definition: C4Game.cpp:3791
bool fScriptCreatedObjects
Definition: C4Game.h:117
bool fLobby
Definition: C4Game.h:118
C4PlayerControlAssignmentSets PlayerControlDefaultAssignmentSets
Definition: C4Game.h:93
void CloseScenario()
Definition: C4Game.cpp:263
char CurrentScenarioSection[C4MaxName+1]
Definition: C4Game.h:101
C4PlayerControlAssignmentSets PlayerControlUserAssignmentSets
Definition: C4Game.h:93
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:2649
StdStrBuf GetKeyboardInputName(const char *szKeyName, bool fShort=false, int32_t iIndex=0)
Definition: C4Game.h:301
void Evaluate()
Definition: C4Game.cpp:1503
C4Object * CreateInfoObject(C4ObjectInfo *cinf, int32_t owner, int32_t tx=50, int32_t ty=50)
Definition: C4Game.cpp:1086
C4ComponentHost Title
Definition: C4Game.h:77
C4ScenarioSection * pCurrentScenarioSection
Definition: C4Game.h:91
bool TimeGo
Definition: C4Game.h:130
bool DebugMode
Definition: C4Game.h:144
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:1072
bool ActivateMenu(const char *szCommand)
Definition: C4Game.cpp:3649
void OnKeyboardLayoutChanged()
Definition: C4Game.cpp:3418
void DrawCrewOverheadText(C4TargetFacet &cgo, int32_t iPlayer)
Definition: C4Game.cpp:1532
bool DrawTextSpecImage(C4Facet &fctTarget, const char *szSpec, class C4DrawTransform *pTransform, uint32_t dwClr=0xff)
Definition: C4Game.cpp:3737
const C4Real Fix0
Definition: C4Real.h:312
C4String * GetTranslatedString(const class C4Value &input_string, C4Value *selected_language, bool fail_silently) const
Definition: C4Game.cpp:3890
int DebugWait
Definition: C4Game.h:148
int32_t iTick2
Definition: C4Game.h:129