mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 05:38:56 +00:00
TSAGE: Proper bugfix for problem saving/restoring game in Scene #5000 and others
This commit is contained in:
parent
9f74a6eda2
commit
1651ac8ca2
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user