Pyrogenesis  trunk
GameSetup.h
Go to the documentation of this file.
1 /* Copyright (C) 2014 Wildfire Games.
2  * This file is part of 0 A.D.
3  *
4  * 0 A.D. is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * 0 A.D. is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef INCLUDED_GAMESETUP
19 #define INCLUDED_GAMESETUP
20 
21 //
22 // GUI integration
23 //
24 
25 // display progress / description in loading screen
26 extern void GUI_DisplayLoadProgress(int percent, const wchar_t* pending_task);
27 
28 extern void Render();
29 
30 /**
31  * initialize global modules that are be needed before Init.
32  * must be called from the very beginning of main.
33  **/
34 extern void EarlyInit();
35 
37 {
38  // avoid setting a video mode / initializing OpenGL; assume that has
39  // already been done and everything is ready for rendering.
40  // needed by map editor because it creates its own window.
42 
43  // skip initializing the in-game GUI.
44  // needed by map editor because it uses its own GUI.
46 
47  // avoid setting display_error app hook
48  // needed by map editor because it has its own wx error display
50 
51  // initialize the mod folders from command line parameters
52  INIT_MODS = 8,
53 
54  // mount the public mod
55  // needed by the map editor as "mod" does not provide everything it needs
57 };
58 
60 {
61  // start shutdown from config down
62  // needed for loading mods as specified in the config
63  // without having to go through a full init-shutdown cycle
65 };
66 
67 /**
68  * enable/disable rendering of the GUI (intended mainly for screenshots)
69  */
70 extern void RenderGui(bool RenderingState);
71 extern void RenderLogger(bool RenderingState);
72 
73 /**
74  * enable/disable rendering of the cursor - this does not hide cursor, but reverts to OS style
75  */
76 extern void RenderCursor(bool RenderingState);
77 
78 
79 class CmdLineArgs;
80 class Paths;
81 extern std::vector<CStr>& GetMods(const CmdLineArgs& args, int flags);
82 extern void MountMods(const Paths& paths, const std::vector<CStr>& mods);
83 /**
84  * Returns true if successful, false if mods changed and restart_engine was called.
85  * In the latter case the caller should call Shutdown() with SHUTDOWN_FROM_CONFIG.
86  */
87 extern bool Init(const CmdLineArgs& args, int flags);
88 extern void InitGraphics(const CmdLineArgs& args, int flags);
89 extern void Shutdown(int flags);
90 extern void CancelLoad(const CStrW& message);
91 
92 extern bool InDevelopmentCopy();
93 
94 #endif // INCLUDED_GAMESETUP
bool InDevelopmentCopy()
Definition: GameSetup.cpp:1573
void RenderLogger(bool RenderingState)
Definition: GameSetup.cpp:1126
void Render()
Definition: GameSetup.cpp:201
Definition: GameSetup.h:41
void RenderCursor(bool RenderingState)
enable/disable rendering of the cursor - this does not hide cursor, but reverts to OS style ...
Definition: GameSetup.cpp:1131
Definition: GameSetup.h:56
void CancelLoad(const CStrW &message)
Definition: GameSetup.cpp:1554
void EarlyInit()
initialize global modules that are be needed before Init.
Definition: GameSetup.cpp:870
void RenderGui(bool RenderingState)
enable/disable rendering of the GUI (intended mainly for screenshots)
Definition: GameSetup.cpp:1121
Definition: GameSetup.h:52
Definition: GameSetup.h:45
void Shutdown(int flags)
Definition: GameSetup.cpp:721
std::vector< CStr > & GetMods(const CmdLineArgs &args, int flags)
Definition: GameSetup.cpp:407
void InitGraphics(const CmdLineArgs &args, int flags)
Definition: GameSetup.cpp:1000
void GUI_DisplayLoadProgress(int percent, const wchar_t *pending_task)
Definition: GameSetup.cpp:192
InitFlags
Definition: GameSetup.h:36
Definition: GameSetup.h:49
Definition: CmdLineArgs.h:24
Definition: GameSetup.h:64
Wrapper class for OS paths used by the game.
Definition: Paths.h:27
bool Init(const CmdLineArgs &args, int flags)
Returns true if successful, false if mods changed and restart_engine was called.
Definition: GameSetup.cpp:911
ShutdownFlags
Definition: GameSetup.h:59
void MountMods(const Paths &paths, const std::vector< CStr > &mods)
Definition: GameSetup.cpp:437