![]() |
Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
|
#include "precompiled.h"#include "ps/GameSetup/GameSetup.h"#include "graphics/GameView.h"#include "graphics/MapReader.h"#include "graphics/TerrainTextureManager.h"#include "gui/CGUI.h"#include "gui/GUIManager.h"#include "gui/Scripting/JSInterface_GUIManager.h"#include "i18n/L10n.h"#include "lib/app_hooks.h"#include "lib/config2.h"#include "lib/external_libraries/libsdl.h"#include "lib/file/common/file_stats.h"#include "lib/input.h"#include "lib/timer.h"#include "lobby/IXmppClient.h"#include "network/NetServer.h"#include "network/NetClient.h"#include "network/NetMessage.h"#include "network/NetMessages.h"#include "network/scripting/JSInterface_Network.h"#include "ps/CConsole.h"#include "ps/CLogger.h"#include "ps/ConfigDB.h"#include "ps/Filesystem.h"#include "ps/Game.h"#include "ps/GameSetup/Atlas.h"#include "ps/GameSetup/Paths.h"#include "ps/GameSetup/Config.h"#include "ps/GameSetup/CmdLineArgs.h"#include "ps/GameSetup/HWDetect.h"#include "ps/Globals.h"#include "ps/GUID.h"#include "ps/Hotkey.h"#include "ps/Joystick.h"#include "ps/Loader.h"#include "ps/Mod.h"#include "ps/ModIo.h"#include "ps/Profile.h"#include "ps/ProfileViewer.h"#include "ps/Profiler2.h"#include "ps/Pyrogenesis.h"#include "ps/scripting/JSInterface_Console.h"#include "ps/scripting/JSInterface_Game.h"#include "ps/scripting/JSInterface_Main.h"#include "ps/scripting/JSInterface_VFS.h"#include "ps/TouchInput.h"#include "ps/UserReport.h"#include "ps/Util.h"#include "ps/VideoMode.h"#include "ps/VisualReplay.h"#include "ps/World.h"#include "renderer/Renderer.h"#include "renderer/SceneRenderer.h"#include "renderer/VertexBufferManager.h"#include "scriptinterface/FunctionWrapper.h"#include "scriptinterface/JSON.h"#include "scriptinterface/ScriptInterface.h"#include "scriptinterface/ScriptStats.h"#include "scriptinterface/ScriptContext.h"#include "scriptinterface/ScriptConversions.h"#include "simulation2/Simulation2.h"#include "simulation2/scripting/JSInterface_Simulation.h"#include "soundmanager/scripting/JSInterface_Sound.h"#include "soundmanager/ISoundManager.h"#include "tools/atlas/GameInterface/GameLoop.h"#include <X11/Xlib.h>#include <fstream>#include <iostream>#include <boost/algorithm/string/classification.hpp>#include <boost/algorithm/string/join.hpp>#include <boost/algorithm/string/split.hpp>Macros | |
| #define | MUST_INIT_X11 1 |
Functions | |
| void | RestartEngine () |
| ERROR_GROUP (System) | |
| ERROR_TYPE (System, SDLInitFailed) | |
| ERROR_TYPE (System, VmodeFailed) | |
| ERROR_TYPE (System, RequiredExtensionsMissing) | |
| ErrorReactionInternal | psDisplayError (const wchar_t *text, size_t flags) |
| void | MountMods (const Paths &paths, const std::vector< CStr > &mods) |
| Mounts all files of the given mods in the global VFS. More... | |
| void | InitVfs (const CmdLineArgs &args) |
| static void | InitPs (bool setup_gui, const CStrW &gui_page, ScriptInterface *srcScriptInterface, JS::HandleValue initData) |
| void | InitInput () |
| static void | ShutdownPs () |
| static void | InitSDL () |
| static void | ShutdownSDL () |
| void | EndGame () |
| void | ShutdownNetworkAndUI () |
Has to be called before ShutdownConfigAndSubsequent. More... | |
| void | ShutdownConfigAndSubsequent () |
| static void | FixLocales () |
| void | EarlyInit () |
| initialize global modules that are be needed before Init. More... | |
| bool | Autostart (const CmdLineArgs &args) |
| bool | AutostartVisualReplay (const std::string &replayFile) |
| Returns true if the user has intended to start a visual replay from command line. More... | |
| bool | Init (const CmdLineArgs &args, int flags) |
| Returns true if successful, false if Init is aborted early (for instance if mods changed, or if we are using -dumpSchema). More... | |
| void | InitGraphics (const CmdLineArgs &args, int flags, const std::vector< CStr > &installedMods, ScriptContext &scriptContext, ScriptInterface &scriptInterface) |
ShutdownNetworkAndUI has to be called later. More... | |
| bool | InitNonVisual (const CmdLineArgs &args) |
ShutdownNetworkAndUI has to be called later. More... | |
| CStr8 | LoadSettingsOfScenarioMap (const VfsPath &mapPath) |
| Temporarily loads a scenario map and retrieves the "ScriptSettings" JSON data from it. More... | |
| void | AutostartLoadScript (const ScriptInterface &scriptInterface, const VfsPath &path) |
| CParamNode | GetTemplate (const std::string &templateName) |
| void | CancelLoad (const CStrW &message) |
| bool | InDevelopmentCopy () |
Variables | |
| thread_local std::shared_ptr< ScriptContext > | g_ScriptContext |
| bool | g_InDevelopmentCopy |
| bool | g_CheckedIfInDevelopmentCopy = false |
| #define MUST_INIT_X11 1 |
| bool Autostart | ( | const CmdLineArgs & | args | ) |
| void AutostartLoadScript | ( | const ScriptInterface & | scriptInterface, |
| const VfsPath & | path | ||
| ) |
| bool AutostartVisualReplay | ( | const std::string & | replayFile | ) |
Returns true if the user has intended to start a visual replay from command line.
| void CancelLoad | ( | const CStrW & | message | ) |
| void EarlyInit | ( | ) |
initialize global modules that are be needed before Init.
must be called from the very beginning of main.
| void EndGame | ( | ) |
| ERROR_GROUP | ( | System | ) |
| ERROR_TYPE | ( | System | , |
| RequiredExtensionsMissing | |||
| ) |
| ERROR_TYPE | ( | System | , |
| SDLInitFailed | |||
| ) |
| ERROR_TYPE | ( | System | , |
| VmodeFailed | |||
| ) |
|
static |
| CParamNode GetTemplate | ( | const std::string & | templateName | ) |
| bool InDevelopmentCopy | ( | ) |
| bool Init | ( | const CmdLineArgs & | args, |
| int | flags | ||
| ) |
Returns true if successful, false if Init is aborted early (for instance if mods changed, or if we are using -dumpSchema).
ShutdownConfigAndSubsequent has to be called later.
| void InitGraphics | ( | const CmdLineArgs & | args, |
| int | flags, | ||
| const std::vector< CStr > & | installedMods, | ||
| ScriptContext & | scriptContext, | ||
| ScriptInterface & | scriptInterface | ||
| ) |
ShutdownNetworkAndUI has to be called later.
| void InitInput | ( | ) |
| bool InitNonVisual | ( | const CmdLineArgs & | args | ) |
ShutdownNetworkAndUI has to be called later.
|
static |
|
static |
| void InitVfs | ( | const CmdLineArgs & | args | ) |
| CStr8 LoadSettingsOfScenarioMap | ( | const VfsPath & | mapPath | ) |
Temporarily loads a scenario map and retrieves the "ScriptSettings" JSON data from it.
The scenario map format is used for scenario and skirmish map types (random games do not use a "map" (format) but a small JavaScript program which creates a map on the fly). It contains a section to initialize the game setup screen.
| mapPath | Absolute path (from VFS root) to the map file to peek in. |
| void MountMods | ( | const Paths & | paths, |
| const std::vector< CStr > & | mods | ||
| ) |
Mounts all files of the given mods in the global VFS.
Make sure to call CacheEnabledModVersions after every call to this.
| ErrorReactionInternal psDisplayError | ( | const wchar_t * | text, |
| size_t | flags | ||
| ) |
| void RestartEngine | ( | ) |
| void ShutdownConfigAndSubsequent | ( | ) |
| void ShutdownNetworkAndUI | ( | ) |
Has to be called before ShutdownConfigAndSubsequent.
|
static |
|
static |
| bool g_CheckedIfInDevelopmentCopy = false |
| bool g_InDevelopmentCopy |
| thread_local std::shared_ptr<ScriptContext> g_ScriptContext |