aboutsummaryrefslogtreecommitdiff
path: root/scumm
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
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')
-rw-r--r--scumm/saveload.cpp17
-rw-r--r--scumm/saveload.h2
2 files changed, 18 insertions, 1 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
diff --git a/scumm/saveload.h b/scumm/saveload.h
index 30d95a17e9..da76a4ba0f 100644
--- a/scumm/saveload.h
+++ b/scumm/saveload.h
@@ -32,7 +32,7 @@ namespace Scumm {
// Can be useful for other ports too :)
#define VER(x) x
-#define CURRENT_VER 27
+#define CURRENT_VER 28
// To work around a warning in GCC 3.2 (and 3.1 ?) regarding non-POD types,
// we use a small trick: instead of 0 we use 42. Why? Well, it seems newer GCC