diff options
author | Eugene Sandulenko | 2015-12-28 19:09:16 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2015-12-28 19:13:13 +0100 |
commit | 438eb457047f0dee7a4555de91b1ea46c34082e7 (patch) | |
tree | d047a2169d96749c5935ed02055416d3660d0fba /engines/wage/world.cpp | |
parent | 3fe3ad7ee35c8bdb4aef298e2cfa52b43b94d88e (diff) | |
download | scummvm-rg350-438eb457047f0dee7a4555de91b1ea46c34082e7.tar.gz scummvm-rg350-438eb457047f0dee7a4555de91b1ea46c34082e7.tar.bz2 scummvm-rg350-438eb457047f0dee7a4555de91b1ea46c34082e7.zip |
WAGE: Increased startup speed
Diffstat (limited to 'engines/wage/world.cpp')
-rw-r--r-- | engines/wage/world.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/engines/wage/world.cpp b/engines/wage/world.cpp index 65c562de40..e4ce93625d 100644 --- a/engines/wage/world.cpp +++ b/engines/wage/world.cpp @@ -387,7 +387,7 @@ bool ObjComparator(Obj *o1, Obj *o2) { return o1Immobile; } -void World::move(Obj *obj, Scene *scene) { +void World::move(Obj *obj, Scene *scene, bool skipSort) { if (obj == NULL) return; @@ -395,7 +395,8 @@ void World::move(Obj *obj, Scene *scene) { obj->_currentScene = scene; scene->_objs.push_back(obj); - Common::sort(scene->_objs.begin(), scene->_objs.end(), ObjComparator); + if (!skipSort) + Common::sort(scene->_objs.begin(), scene->_objs.end(), ObjComparator); _engine->onMove(obj, from, scene); } @@ -404,7 +405,7 @@ bool ChrComparator(Chr *l, Chr *r) { return l->_index < r->_index; } -void World::move(Chr *chr, Scene *scene) { +void World::move(Chr *chr, Scene *scene, bool skipSort) { if (chr == NULL) return; Scene *from = chr->_currentScene; @@ -414,7 +415,8 @@ void World::move(Chr *chr, Scene *scene) { from->_chrs.remove(chr); scene->_chrs.push_back(chr); - Common::sort(scene->_chrs.begin(), scene->_chrs.end(), ChrComparator); + if (!skipSort) + Common::sort(scene->_chrs.begin(), scene->_chrs.end(), ChrComparator); if (scene == _storageScene) { warning("STUB: World::move (chrState)"); |