Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/graphics/MapReader.cpp
Show First 20 Lines • Show All 203 Lines • ▼ Show 20 Lines | void CMapReader::LoadRandomMap(const CStrW& scriptFile, JSRuntime* rt, JS::HandleValue settings, CTerrain *pTerrain_, | ||||
RegMemFun(this, &CMapReader::LoadMapSettings, L"CMapReader::LoadMapSettings", 5); | RegMemFun(this, &CMapReader::LoadMapSettings, L"CMapReader::LoadMapSettings", 5); | ||||
RegMemFun(this, &CMapReader::DelayLoadFinished, L"CMapReader::DelayLoadFinished", 5); | RegMemFun(this, &CMapReader::DelayLoadFinished, L"CMapReader::DelayLoadFinished", 5); | ||||
} | } | ||||
// UnpackMap: unpack the given data from the raw data stream into local variables | // UnpackMap: unpack the given data from the raw data stream into local variables | ||||
int CMapReader::UnpackMap() | int CMapReader::UnpackMap() | ||||
{ | { | ||||
// now unpack everything into local data | return UnpackTerrain(); | ||||
int ret = UnpackTerrain(); | |||||
if (ret != 0) // failed or timed out | |||||
{ | |||||
return ret; | |||||
} | |||||
return 0; | |||||
} | } | ||||
// UnpackTerrain: unpack the terrain from the end of the input data stream | // UnpackTerrain: unpack the terrain from the end of the input data stream | ||||
// - data: map size, heightmap, list of textures used by map, texture tile assignments | // - data: map size, heightmap, list of textures used by map, texture tile assignments | ||||
int CMapReader::UnpackTerrain() | int CMapReader::UnpackTerrain() | ||||
{ | { | ||||
// yield after this time is reached. balances increased progress bar | // yield after this time is reached. balances increased progress bar | ||||
// smoothness vs. slowing down loading. | // smoothness vs. slowing down loading. | ||||
▲ Show 20 Lines • Show All 1,353 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator