Changeset View
Changeset View
Standalone View
Standalone View
source/ps/GameSetup/GameSetup.cpp
Show First 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | |||||
#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 "scriptinterface/ScriptRuntime.h" | ||||
#include "simulation2/Simulation2.h" | #include "simulation2/Simulation2.h" | ||||
#include "simulation2/helpers/ArrayData.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 | ||||
#define MUST_INIT_X11 1 | #define MUST_INIT_X11 1 | ||||
▲ Show 20 Lines • Show All 1,222 Lines • ▼ Show 20 Lines | if (mapDirectory == L"random") | ||||
size_t numPlayers = 2; | size_t numPlayers = 2; | ||||
if (args.Has("autostart-players")) | if (args.Has("autostart-players")) | ||||
{ | { | ||||
CStr num = args.Get("autostart-players"); | CStr num = args.Get("autostart-players"); | ||||
numPlayers = num.ToUInt(); | numPlayers = num.ToUInt(); | ||||
} | } | ||||
// Set up player data | // Set up player data | ||||
Simulation_SetNumberOfPlayersReadOnly(false); | |||||
Simulation_SetNumberOfPlayers(numPlayers); | |||||
Simulation_SetNumberOfPlayersReadOnly(true); | |||||
for (size_t i = 0; i < numPlayers; ++i) | for (size_t i = 0; i < numPlayers; ++i) | ||||
{ | { | ||||
JS::RootedValue player(cx); | JS::RootedValue player(cx); | ||||
// We could load player_defaults.json here, but that would complicate the logic | // We could load player_defaults.json here, but that would complicate the logic | ||||
// even more and autostart is only intended for developers anyway | // even more and autostart is only intended for developers anyway | ||||
ScriptInterface::CreateObject(cx, &player, "Civ", "athen"); | ScriptInterface::CreateObject(cx, &player, "Civ", "athen"); | ||||
▲ Show 20 Lines • Show All 352 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator