Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/ps/GameSetup/GameSetup.cpp
Show First 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | |||||
#include "ps/World.h" | #include "ps/World.h" | ||||
#include "renderer/Renderer.h" | #include "renderer/Renderer.h" | ||||
#include "renderer/VertexBufferManager.h" | #include "renderer/VertexBufferManager.h" | ||||
#include "renderer/ModelRenderer.h" | #include "renderer/ModelRenderer.h" | ||||
#include "scriptinterface/ScriptInterface.h" | #include "scriptinterface/ScriptInterface.h" | ||||
#include "scriptinterface/ScriptStats.h" | #include "scriptinterface/ScriptStats.h" | ||||
#include "scriptinterface/ScriptConversions.h" | #include "scriptinterface/ScriptConversions.h" | ||||
#include "scriptinterface/ScriptRuntime.h" | |||||
#include "simulation2/Simulation2.h" | #include "simulation2/Simulation2.h" | ||||
#include "lobby/IXmppClient.h" | #include "lobby/IXmppClient.h" | ||||
#include "soundmanager/scripting/JSInterface_Sound.h" | #include "soundmanager/scripting/JSInterface_Sound.h" | ||||
#include "soundmanager/ISoundManager.h" | #include "soundmanager/ISoundManager.h" | ||||
#include "tools/atlas/GameInterface/GameLoop.h" | #include "tools/atlas/GameInterface/GameLoop.h" | ||||
#include "tools/atlas/GameInterface/View.h" | #include "tools/atlas/GameInterface/View.h" | ||||
#if !(OS_WIN || OS_MACOSX || OS_ANDROID) // assume all other platforms use X11 for wxWidgets | #if !(OS_WIN || OS_MACOSX || OS_ANDROID) // assume all other platforms use X11 for wxWidgets | ||||
▲ Show 20 Lines • Show All 826 Lines • ▼ Show 20 Lines | bool Init(const CmdLineArgs& args, int flags) | ||||
CONFIG_Init(args); | CONFIG_Init(args); | ||||
// Using a global object for the runtime is a workaround until Simulation and AI use | // Using a global object for the runtime is a workaround until Simulation and AI use | ||||
// their own threads and also their own runtimes. | // their own threads and also their own runtimes. | ||||
const int runtimeSize = 384 * 1024 * 1024; | const int runtimeSize = 384 * 1024 * 1024; | ||||
const int heapGrowthBytesGCTrigger = 20 * 1024 * 1024; | const int heapGrowthBytesGCTrigger = 20 * 1024 * 1024; | ||||
g_ScriptRuntime = ScriptInterface::CreateRuntime(shared_ptr<ScriptRuntime>(), runtimeSize, heapGrowthBytesGCTrigger); | g_ScriptRuntime = ScriptInterface::CreateRuntime(shared_ptr<ScriptRuntime>(), runtimeSize, heapGrowthBytesGCTrigger); | ||||
Mod::CacheEnabledModVersions(g_ScriptRuntime); | |||||
// Special command-line mode to dump the entity schemas instead of running the game. | // Special command-line mode to dump the entity schemas instead of running the game. | ||||
// (This must be done after loading VFS etc, but should be done before wasting time | // (This must be done after loading VFS etc, but should be done before wasting time | ||||
// on anything else.) | // on anything else.) | ||||
if (args.Has("dumpSchema")) | if (args.Has("dumpSchema")) | ||||
{ | { | ||||
CSimulation2 sim(NULL, g_ScriptRuntime, NULL); | CSimulation2 sim(NULL, g_ScriptRuntime, NULL); | ||||
sim.LoadDefaultScripts(); | sim.LoadDefaultScripts(); | ||||
std::ofstream f("entity.rng", std::ios_base::out | std::ios_base::trunc); | std::ofstream f("entity.rng", std::ios_base::out | std::ios_base::trunc); | ||||
▲ Show 20 Lines • Show All 729 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator