[Scummvm-cvs-logs] CVS: scummvm/scumm script_v6.cpp,1.365,1.366

Max Horn fingolfin at users.sourceforge.net
Sat Jul 31 19:04:03 CEST 2004


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv534

Modified Files:
	script_v6.cpp 
Log Message:
More array code cleanup

Index: script_v6.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6.cpp,v
retrieving revision 1.365
retrieving revision 1.366
diff -u -d -r1.365 -r1.366
--- script_v6.cpp	1 Aug 2004 01:54:36 -0000	1.365
+++ script_v6.cpp	1 Aug 2004 02:03:07 -0000	1.366
@@ -407,18 +407,17 @@
 
 	
 	if (_heversion >= 60) {
-		// FIXME: Fingolfin asks: What is this change good for? It doesn't hurt,
-		// but it also has no effect whatsoever...
-		if (type == 1 || type == 2)
-			type = 3;
+		if (type == kBitArray || type == kNibbleArray)
+			type = kByteArray;
 	} else {
-		// The following code basically turn all arrays except string arrays 
-		// into integer arrays. There seems to be no purpose in this, and it
-		// wastes space. However, we can't just change this either, as that
-		// would break savegame compatibility. So do not touch this unless you
-		// are adding code which updated old savegames, too.
-		if (type != 4)
-			type = 5;
+		// NOTE: The following code turns all arrays except string arrays into
+		// integer arrays. There seems to be no reason for this, and it wastes
+		// space. However, we can't just remove this either, as that would
+		// break savegame compatibility. So do not touch this unless you are
+		// also adding code which updated old savegames, too. And of course
+		// readArray() and writeArray() would have to be updated, too...
+		if (type != kStringArray)
+			type = kIntArray;
 	}
 
 	nukeArray(array);
@@ -514,7 +513,7 @@
 			array, base, idx, FROM_LE_16(ah->dim1), FROM_LE_16(ah->dim2));
 	}
 
-	if (FROM_LE_16(ah->type) == 4 || (_heversion >= 60 && FROM_LE_16(ah->type) == rtCostume)) {
+	if (FROM_LE_16(ah->type) != kIntArray) {
 		return ah->data[offset];
 	} else if (_version == 8) {
 		return (int32)READ_LE_UINT32(ah->data + offset * 4);
@@ -535,7 +534,7 @@
 			array, base, idx, FROM_LE_16(ah->dim1), FROM_LE_16(ah->dim2));
 	}
 
-	if (FROM_LE_16(ah->type) == rtSound || (_heversion >= 60 && FROM_LE_16(ah->type) == rtCostume)) {
+	if (FROM_LE_16(ah->type) != kIntArray) {
 		ah->data[offset] = value;
 	} else if (_version == 8) {
 		WRITE_LE_UINT32(ah->data + offset * 4, value);





More information about the Scummvm-git-logs mailing list