aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormd52011-04-27 23:52:20 +0300
committermd52011-04-27 23:52:20 +0300
commitc76502fe1174d5e75e4ba5b2575000c0cb6305d8 (patch)
tree314f8afcb5421c8c3fe62b8acdc393e716cc8569
parent595570a117de6024f8fd89462d3e52c8d18826ef (diff)
downloadscummvm-rg350-c76502fe1174d5e75e4ba5b2575000c0cb6305d8.tar.gz
scummvm-rg350-c76502fe1174d5e75e4ba5b2575000c0cb6305d8.tar.bz2
scummvm-rg350-c76502fe1174d5e75e4ba5b2575000c0cb6305d8.zip
TSAGE: Added temporary fix for some saved games (e.g. scenes 4050 and 5000)
-rw-r--r--engines/tsage/globals.cpp6
-rw-r--r--engines/tsage/saveload.cpp7
2 files changed, 13 insertions, 0 deletions
diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp
index 00444f3672..81a507102c 100644
--- a/engines/tsage/globals.cpp
+++ b/engines/tsage/globals.cpp
@@ -43,6 +43,12 @@ 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 8b07767f22..b1c66f944c 100644
--- a/engines/tsage/saveload.cpp
+++ b/engines/tsage/saveload.cpp
@@ -177,6 +177,13 @@ 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, skipping synchronization");
+ continue;
+ }
serialiser.validate((*i)->getClassName());
(*i)->synchronise(serialiser);
}