aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2003-01-15 14:14:00 +0000
committerMax Horn2003-01-15 14:14:00 +0000
commitdefd1e708417fe4a164cd6fd394bd096f1d96283 (patch)
tree900492f31a280316edf45b8b8e38b547d53d6a76
parent15ad897ed35d61297044077dcb76e0a520cf16d8 (diff)
downloadscummvm-rg350-defd1e708417fe4a164cd6fd394bd096f1d96283.tar.gz
scummvm-rg350-defd1e708417fe4a164cd6fd394bd096f1d96283.tar.bz2
scummvm-rg350-defd1e708417fe4a164cd6fd394bd096f1d96283.zip
increased variable size from 16 to 32 bits
svn-id: r6469
-rw-r--r--scumm/saveload.cpp16
-rw-r--r--scumm/saveload.h5
2 files changed, 12 insertions, 9 deletions
diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp
index 77e4d46c9c..dd8bb49ecc 100644
--- a/scumm/saveload.cpp
+++ b/scumm/saveload.cpp
@@ -357,11 +357,11 @@ void Scumm::saveOrLoad(Serializer *s, uint32 savegameVersion)
MKLINE(Scumm, _currentScript, sleByte, VER_V8),
MKARRAY(Scumm, _localScriptList[0], sleUint32, NUM_LOCALSCRIPT, VER_V8),
- // vm.localvar grew from 25 to 40 entries
- // FIXME: ComI stores 32-bit variables.. so.. er.. shouldn't this be a sleInt32 if we
- // don't want games to hidiously behave oddly?
+ // vm.localvar grew from 25 to 40 entries and then from
+ // 16 to 32 bit variables.
MKARRAY_OLD(Scumm, vm.localvar[0][0], sleUint16, 25 * 17, VER_V8, VER_V8),
- MKARRAY(Scumm, vm.localvar[0][0], sleUint16, NUM_SCRIPT_SLOT * 17, VER_V9),
+ MKARRAY_OLD(Scumm, vm.localvar[0][0], sleUint16, NUM_SCRIPT_SLOT * 17, VER_V9, VER_V14),
+ MKARRAY(Scumm, vm.localvar[0][0], sleUint16, NUM_SCRIPT_SLOT * 17, VER_V15),
MKARRAY(Scumm, _resourceMapper[0], sleByte, 128, VER_V8),
MKARRAY(Scumm, _charsetColorMap[0], sleByte, 16, VER_V8),
@@ -625,9 +625,11 @@ void Scumm::saveOrLoad(Serializer *s, uint32 savegameVersion)
var120Backup = _vars[120];
var98Backup = _vars[98];
- // FIXME: ComI stores 32-bit variables.. so.. er.. shouldn't this be a sleInt32 if we
- // don't want games to hidiously behave oddly?
- s->saveLoadArrayOf(_vars, _numVariables, sizeof(_vars[0]), sleInt16);
+ // The variables grew from 16 to 32 bit.
+ if (savegameVersion < VER_V15)
+ s->saveLoadArrayOf(_vars, _numVariables, sizeof(_vars[0]), sleInt16);
+ else
+ s->saveLoadArrayOf(_vars, _numVariables, sizeof(_vars[0]), sleInt32);
if (_gameId == GID_TENTACLE) // Maybe misplaced, but that's the main idea
_vars[120] = var120Backup;
diff --git a/scumm/saveload.h b/scumm/saveload.h
index b511a0c6d8..93e7d62893 100644
--- a/scumm/saveload.h
+++ b/scumm/saveload.h
@@ -33,10 +33,11 @@ enum {
VER_V11,
VER_V12,
VER_V13,
- VER_V14
+ VER_V14,
+ VER_V15
};
-#define CURRENT_VER VER_V14
+#define CURRENT_VER VER_V15
// To work around a warning in GCC 3.2 (and 3.1 ?) regarding non-POD types,