[Scummvm-cvs-logs] CVS: scummvm/scumm saveload.h,1.10,1.11 saveload.cpp,1.46,1.47

Max Horn fingolfin at users.sourceforge.net
Wed Jan 15 06:15:01 CET 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv20066

Modified Files:
	saveload.h saveload.cpp 
Log Message:
increased variable size from 16 to 32 bits

Index: saveload.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/saveload.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- saveload.h	14 Jan 2003 10:05:41 -0000	1.10
+++ saveload.h	15 Jan 2003 14:14:00 -0000	1.11
@@ -33,10 +33,11 @@
 	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,

Index: saveload.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/saveload.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- saveload.cpp	15 Jan 2003 13:35:18 -0000	1.46
+++ saveload.cpp	15 Jan 2003 14:14:00 -0000	1.47
@@ -357,11 +357,11 @@
 		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 @@
 	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;





More information about the Scummvm-git-logs mailing list