aboutsummaryrefslogtreecommitdiff
path: root/scumm/saveload.cpp
diff options
context:
space:
mode:
authorMax Horn2004-01-11 19:58:29 +0000
committerMax Horn2004-01-11 19:58:29 +0000
commit6574feefb1714f72809754e055d36b7b98e3f369 (patch)
tree61d7b0e45622f3700328bdf6257bf5f5d4ec1636 /scumm/saveload.cpp
parentdf985747e125739f180d857ddfd1ab0ec301dfe6 (diff)
downloadscummvm-rg350-6574feefb1714f72809754e055d36b7b98e3f369.tar.gz
scummvm-rg350-6574feefb1714f72809754e055d36b7b98e3f369.tar.bz2
scummvm-rg350-6574feefb1714f72809754e055d36b7b98e3f369.zip
fix loading of old COMI savegames (which are based on the bad old camera var locations; note that COMI savegames made between this change and my previous change to vars.cpp may be 'lost' due to this, however that should be minor compared to loosing all previous COMI savegames ;-)
svn-id: r12324
Diffstat (limited to 'scumm/saveload.cpp')
-rw-r--r--scumm/saveload.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp
index 2972644c97..d90d34341a 100644
--- a/scumm/saveload.cpp
+++ b/scumm/saveload.cpp
@@ -164,6 +164,23 @@ bool ScummEngine::loadState(int slot, bool compat, SaveFileManager *mgr) {
// it is not, hence we check & correct it here.
if (_screenTop < 0)
_screenTop = 0;
+
+ // For a long time, we used incorrect locations for some camera related
+ // scumm vars. We now know the proper locations. To be able to properly use
+ // old save games, we update the old (bad) variables to the new (correct)
+ // ones.
+ if (hdr.ver <= 27 && _version == 8) {
+ _scummVars[VAR_CAMERA_MIN_X] = _scummVars[101];
+ _scummVars[VAR_CAMERA_MAX_X] = _scummVars[102];
+ _scummVars[VAR_CAMERA_MIN_Y] = _scummVars[103];
+ _scummVars[VAR_CAMERA_MAX_Y] = _scummVars[104];
+ _scummVars[VAR_CAMERA_THRESHOLD_X] = _scummVars[105];
+ _scummVars[VAR_CAMERA_THRESHOLD_Y] = _scummVars[106];
+ _scummVars[VAR_CAMERA_SPEED_X] = _scummVars[107];
+ _scummVars[VAR_CAMERA_SPEED_Y] = _scummVars[108];
+ _scummVars[VAR_CAMERA_ACCEL_X] = _scummVars[109];
+ _scummVars[VAR_CAMERA_ACCEL_Y] = _scummVars[110];
+ }
// We could simply dirty colours 0-15 for 16-colour games -- nowadays
// they handle their palette pretty much like the more recent games