forked from mirrors/0ad
SpiderMonkey 38 upgrade: 33/35
Remove a workaround. Note that this removal is incomplete. Based on patch by leper. This was SVN commit r18687.
This commit is contained in:
@@ -83,7 +83,7 @@ void CMapReader::LoadMap(const VfsPath& pathname, JSRuntime* rt, JS::HandleValu
|
||||
m_PlayerID = playerID_;
|
||||
m_SkipEntities = skipEntities;
|
||||
m_StartingCameraTarget = INVALID_ENTITY;
|
||||
m_ScriptSettings.set(rt, settings);
|
||||
m_ScriptSettings.init(rt, settings);
|
||||
|
||||
filename_xml = pathname.ChangeExtension(L".xml");
|
||||
|
||||
@@ -158,7 +158,7 @@ void CMapReader::LoadRandomMap(const CStrW& scriptFile, JSRuntime* rt, JS::Handl
|
||||
m_ScriptFile = scriptFile;
|
||||
pSimulation2 = pSimulation2_;
|
||||
pSimContext = pSimulation2 ? &pSimulation2->GetSimContext() : NULL;
|
||||
m_ScriptSettings.set(rt, settings);
|
||||
m_ScriptSettings.init(rt, settings);
|
||||
pTerrain = pTerrain_;
|
||||
pLightEnv = pLightEnv_;
|
||||
pGameView = pGameView_;
|
||||
@@ -1244,7 +1244,7 @@ int CMapReader::LoadRMSettings()
|
||||
{
|
||||
// copy random map settings over to sim
|
||||
ENSURE(pSimulation2);
|
||||
pSimulation2->SetMapSettings(m_ScriptSettings.get());
|
||||
pSimulation2->SetMapSettings(m_ScriptSettings);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1265,7 +1265,7 @@ int CMapReader::GenerateMap()
|
||||
scriptPath = L"maps/random/"+m_ScriptFile;
|
||||
|
||||
// Stringify settings to pass across threads
|
||||
std::string scriptSettings = pSimulation2->GetScriptInterface().StringifyJSON(&m_ScriptSettings.get());
|
||||
std::string scriptSettings = pSimulation2->GetScriptInterface().StringifyJSON(&m_ScriptSettings);
|
||||
|
||||
// Try to generate map
|
||||
m_MapGen->GenerateMap(scriptPath, scriptSettings);
|
||||
@@ -1294,7 +1294,7 @@ int CMapReader::GenerateMap()
|
||||
}
|
||||
else
|
||||
{
|
||||
m_MapData.set(cx, data);
|
||||
m_MapData.init(cx, data);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1325,16 +1325,16 @@ int CMapReader::ParseTerrain()
|
||||
throw PSERROR_Game_World_MapLoadFailed("Error parsing terrain data.\nCheck application log for details"); }
|
||||
|
||||
u32 size;
|
||||
GET_TERRAIN_PROPERTY(m_MapData.get(), size, size)
|
||||
GET_TERRAIN_PROPERTY(m_MapData, size, size)
|
||||
|
||||
m_PatchesPerSide = size / PATCH_SIZE;
|
||||
|
||||
// flat heightmap of u16 data
|
||||
GET_TERRAIN_PROPERTY(m_MapData.get(), height, m_Heightmap)
|
||||
GET_TERRAIN_PROPERTY(m_MapData, height, m_Heightmap)
|
||||
|
||||
// load textures
|
||||
std::vector<std::string> textureNames;
|
||||
GET_TERRAIN_PROPERTY(m_MapData.get(), textureNames, textureNames)
|
||||
GET_TERRAIN_PROPERTY(m_MapData, textureNames, textureNames)
|
||||
num_terrain_tex = textureNames.size();
|
||||
|
||||
while (cur_terrain_tex < num_terrain_tex)
|
||||
@@ -1350,7 +1350,7 @@ int CMapReader::ParseTerrain()
|
||||
m_Tiles.resize(SQR(size));
|
||||
|
||||
JS::RootedValue tileData(cx);
|
||||
GET_TERRAIN_PROPERTY(m_MapData.get(), tileData, &tileData)
|
||||
GET_TERRAIN_PROPERTY(m_MapData, tileData, &tileData)
|
||||
|
||||
// parse tile data object into flat arrays
|
||||
std::vector<u16> tileIndex;
|
||||
@@ -1396,7 +1396,7 @@ int CMapReader::ParseEntities()
|
||||
// parse entities from map data
|
||||
std::vector<Entity> entities;
|
||||
|
||||
if (!pSimulation2->GetScriptInterface().GetProperty(m_MapData.get(), "entities", entities))
|
||||
if (!pSimulation2->GetScriptInterface().GetProperty(m_MapData, "entities", entities))
|
||||
LOGWARNING("CMapReader::ParseEntities() failed to get 'entities' property");
|
||||
|
||||
CSimulation2& sim = *pSimulation2;
|
||||
@@ -1463,7 +1463,7 @@ int CMapReader::ParseEnvironment()
|
||||
LOGWARNING("CMapReader::ParseEnvironment() failed to get '%s' property", #prop);
|
||||
|
||||
JS::RootedValue envObj(cx);
|
||||
GET_ENVIRONMENT_PROPERTY(m_MapData.get(), Environment, &envObj)
|
||||
GET_ENVIRONMENT_PROPERTY(m_MapData, Environment, &envObj)
|
||||
|
||||
if (envObj.isUndefined())
|
||||
{
|
||||
@@ -1568,7 +1568,7 @@ int CMapReader::ParseCamera()
|
||||
LOGWARNING("CMapReader::ParseCamera() failed to get '%s' property", #prop);
|
||||
|
||||
JS::RootedValue cameraObj(cx);
|
||||
GET_CAMERA_PROPERTY(m_MapData.get(), Camera, &cameraObj)
|
||||
GET_CAMERA_PROPERTY(m_MapData, Camera, &cameraObj)
|
||||
|
||||
if (!cameraObj.isUndefined())
|
||||
{ // If camera property exists, read values
|
||||
|
||||
Reference in New Issue
Block a user