Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/ps/Game.cpp
Show First 20 Lines • Show All 237 Lines • ▼ Show 20 Lines | void CGame::RegisterInit(const JS::HandleValue attribs, const std::string& savedState) | ||||
{ | { | ||||
// Load random map attributes | // Load random map attributes | ||||
std::wstring scriptFile; | std::wstring scriptFile; | ||||
JS::RootedValue settings(rq.cx); | JS::RootedValue settings(rq.cx); | ||||
scriptInterface.GetProperty(attribs, "script", scriptFile); | scriptInterface.GetProperty(attribs, "script", scriptFile); | ||||
scriptInterface.GetProperty(attribs, "settings", &settings); | scriptInterface.GetProperty(attribs, "settings", &settings); | ||||
m_World->RegisterInitRMS(scriptFile, scriptInterface.GetJSRuntime(), settings, m_PlayerID); | m_World->RegisterInitRMS(scriptFile, *scriptInterface.GetContext(), settings, m_PlayerID); | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
std::wstring mapFile; | std::wstring mapFile; | ||||
JS::RootedValue settings(rq.cx); | JS::RootedValue settings(rq.cx); | ||||
scriptInterface.GetProperty(attribs, "map", mapFile); | scriptInterface.GetProperty(attribs, "map", mapFile); | ||||
scriptInterface.GetProperty(attribs, "settings", &settings); | scriptInterface.GetProperty(attribs, "settings", &settings); | ||||
m_World->RegisterInit(mapFile, scriptInterface.GetJSRuntime(), settings, m_PlayerID); | m_World->RegisterInit(mapFile, *scriptInterface.GetContext(), settings, m_PlayerID); | ||||
} | } | ||||
if (m_GameView) | if (m_GameView) | ||||
RegMemFun(g_Renderer.GetSingletonPtr()->GetWaterManager(), &WaterManager::LoadWaterTextures, L"LoadWaterTextures", 80); | RegMemFun(g_Renderer.GetSingletonPtr()->GetWaterManager(), &WaterManager::LoadWaterTextures, L"LoadWaterTextures", 80); | ||||
if (m_IsSavedGame) | if (m_IsSavedGame) | ||||
RegMemFun(this, &CGame::LoadInitialState, L"Loading game", 1000); | RegMemFun(this, &CGame::LoadInitialState, L"Loading game", 1000); | ||||
if (m_IsVisualReplay) | if (m_IsVisualReplay) | ||||
▲ Show 20 Lines • Show All 206 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator