diff options
author | Paul Gilbert | 2011-04-28 20:39:09 +1000 |
---|---|---|
committer | Paul Gilbert | 2011-04-28 20:41:00 +1000 |
commit | 1651ac8ca2548a8f81af975d20894498008edf99 (patch) | |
tree | 244aa03fb5485c0b0ecb8858a5baf3987c123909 /engines | |
parent | 9f74a6eda2355bb09b9b963be41509ed67016a6c (diff) | |
download | scummvm-rg350-1651ac8ca2548a8f81af975d20894498008edf99.tar.gz scummvm-rg350-1651ac8ca2548a8f81af975d20894498008edf99.tar.bz2 scummvm-rg350-1651ac8ca2548a8f81af975d20894498008edf99.zip |
TSAGE: Proper bugfix for problem saving/restoring game in Scene #5000 and others
Diffstat (limited to 'engines')
-rw-r--r-- | engines/tsage/globals.cpp | 5 | ||||
-rw-r--r-- | engines/tsage/saveload.cpp | 10 | ||||
-rw-r--r-- | engines/tsage/scenes.cpp | 8 |
3 files changed, 6 insertions, 17 deletions
diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index 2dc41074e6..3914d77185 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -43,11 +43,6 @@ static SavedObject *classFactoryProc(const Common::String &className) { if (className == "ObjectMover2") return new ObjectMover2(); if (className == "ObjectMover3") return new ObjectMover3(); if (className == "PlayerMover") return new PlayerMover(); - // The following is needed, as saved games can contain SceneObjectWrapper - // objects (e.g. scene 4050 and 5000). - // FIXME: Since SceneObjectWrapper objects are contained within other - // objects, I'm not quite sure if this is the best solution (however, saved - // games do work with this). If this is correct, please remove this FIXME. if (className == "SceneObjectWrapper") return new SceneObjectWrapper(); return NULL; diff --git a/engines/tsage/saveload.cpp b/engines/tsage/saveload.cpp index 3c9af877ad..8b07767f22 100644 --- a/engines/tsage/saveload.cpp +++ b/engines/tsage/saveload.cpp @@ -177,16 +177,6 @@ Common::Error Saver::restore(int slot) { // Loop through each registered object to load in the data for (SynchronisedList<SavedObject *>::iterator i = _objList.begin(); i != _objList.end(); ++i) { - // Saved games can contain PlayerMover objects, but these aren't synchronized. - // Fixes loading in scene 5000. - // TODO/FIXME: Add a more proper handling for these objects - if ((*i)->getClassName() == "PlayerMover") { - warning("HACK: PlayerMover object found, removing it"); - // Remove that object from the list - i = _objList.erase(i); - assert(i == _objList.end()); - break; - } serialiser.validate((*i)->getClassName()); (*i)->synchronise(serialiser); } diff --git a/engines/tsage/scenes.cpp b/engines/tsage/scenes.cpp index e316a601fb..f5f3444595 100644 --- a/engines/tsage/scenes.cpp +++ b/engines/tsage/scenes.cpp @@ -117,7 +117,11 @@ void SceneManager::sceneChange() { // Instantiate and set the new scene _scene = getNewScene(); - _scene->postInit(); + + if (!_saver->getMacroRestoreFlag()) + _scene->postInit(); + else + _scene->loadScene(_sceneNumber); } Scene *SceneManager::getNewScene() { @@ -289,7 +293,7 @@ void Scene::loadScene(int sceneNum) { } void Scene::loadSceneData(int sceneNum) { - _globals->_sceneManager._scene->_activeScreenNumber = sceneNum; + _activeScreenNumber = sceneNum; // Get the basic scene size byte *data = _resourceManager->getResource(RES_BITMAP, sceneNum, 9999); |