Changeset View
Changeset View
Standalone View
Standalone View
source/main.cpp
Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | |||||
#include "ps/Profile.h" | #include "ps/Profile.h" | ||||
#include "ps/Profiler2.h" | #include "ps/Profiler2.h" | ||||
#include "ps/Pyrogenesis.h" | #include "ps/Pyrogenesis.h" | ||||
#include "ps/Replay.h" | #include "ps/Replay.h" | ||||
#include "ps/TouchInput.h" | #include "ps/TouchInput.h" | ||||
#include "ps/UserReport.h" | #include "ps/UserReport.h" | ||||
#include "ps/Util.h" | #include "ps/Util.h" | ||||
#include "ps/VideoMode.h" | #include "ps/VideoMode.h" | ||||
#include "ps/ThreadPool.h" | |||||
#include "ps/World.h" | #include "ps/World.h" | ||||
#include "ps/GameSetup/GameSetup.h" | #include "ps/GameSetup/GameSetup.h" | ||||
#include "ps/GameSetup/Atlas.h" | #include "ps/GameSetup/Atlas.h" | ||||
#include "ps/GameSetup/Config.h" | #include "ps/GameSetup/Config.h" | ||||
#include "ps/GameSetup/CmdLineArgs.h" | #include "ps/GameSetup/CmdLineArgs.h" | ||||
#include "ps/GameSetup/Paths.h" | #include "ps/GameSetup/Paths.h" | ||||
#include "ps/XML/Xeromyces.h" | #include "ps/XML/Xeromyces.h" | ||||
#include "network/NetClient.h" | #include "network/NetClient.h" | ||||
▲ Show 20 Lines • Show All 502 Lines • ▼ Show 20 Lines | for (const CStr& arg : args.GetArgsWithoutName()) | ||||
modsToInstall.emplace_back(std::move(modPath)); | modsToInstall.emplace_back(std::move(modPath)); | ||||
} | } | ||||
// We need to initialize SpiderMonkey and libxml2 in the main thread before | // We need to initialize SpiderMonkey and libxml2 in the main thread before | ||||
// any thread uses them. So initialize them here before we might run Atlas. | // any thread uses them. So initialize them here before we might run Atlas. | ||||
ScriptEngine scriptEngine; | ScriptEngine scriptEngine; | ||||
CXeromyces::Startup(); | CXeromyces::Startup(); | ||||
// Initialise the global thread pool at this point (JS & Profiler2 are set up). | |||||
ThreadPool::TaskManager::Initialise(); | |||||
if (ATLAS_RunIfOnCmdLine(args, false)) | if (ATLAS_RunIfOnCmdLine(args, false)) | ||||
{ | { | ||||
CXeromyces::Terminate(); | CXeromyces::Terminate(); | ||||
return; | return; | ||||
} | } | ||||
if (isNonVisualReplay) | if (isNonVisualReplay) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 119 Lines • ▼ Show 20 Lines | |||||
#if OS_MACOSX | #if OS_MACOSX | ||||
if (g_Shutdown == ShutdownType::RestartAsAtlas) | if (g_Shutdown == ShutdownType::RestartAsAtlas) | ||||
startNewAtlasProcess(); | startNewAtlasProcess(); | ||||
#else | #else | ||||
if (g_Shutdown == ShutdownType::RestartAsAtlas) | if (g_Shutdown == ShutdownType::RestartAsAtlas) | ||||
ATLAS_RunIfOnCmdLine(args, true); | ATLAS_RunIfOnCmdLine(args, true); | ||||
#endif | #endif | ||||
ThreadPool::TaskManager::Instance().ClearQueue(); | |||||
CXeromyces::Terminate(); | CXeromyces::Terminate(); | ||||
} | } | ||||
#if OS_ANDROID | #if OS_ANDROID | ||||
// In Android we compile the engine as a shared library, not an executable, | // In Android we compile the engine as a shared library, not an executable, | ||||
// so rename main() to a different symbol that the wrapper library can load | // so rename main() to a different symbol that the wrapper library can load | ||||
#undef main | #undef main | ||||
#define main pyrogenesis_main | #define main pyrogenesis_main | ||||
Show All 30 Lines |
Wildfire Games · Phabricator