[Scummvm-cvs-logs] CVS: scummvm/scumm resource.cpp,1.254,1.255 script.cpp,1.182,1.183 scumm.cpp,1.153,1.154 scumm.h,1.455,1.456

Eugene Sandulenko sev at users.sourceforge.net
Thu Aug 26 16:32:21 CEST 2004


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

Modified Files:
	resource.cpp script.cpp scumm.cpp scumm.h 
Log Message:
Add another variable which improves readability.


Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.254
retrieving revision 1.255
diff -u -d -r1.254 -r1.255
--- resource.cpp	26 Aug 2004 23:15:38 -0000	1.254
+++ resource.cpp	26 Aug 2004 23:30:27 -0000	1.255
@@ -2335,7 +2335,7 @@
 				error("MAXS block of size %d not supported, please report", blockSize);
 		_numVariables = _fileHandle.readUint16LE();
 		_fileHandle.readUint16LE();
-		_numBitVariables = _fileHandle.readUint16LE();
+		_numBitVariables = _numRoomVariables = _fileHandle.readUint16LE();
 		_numLocalObjects = _fileHandle.readUint16LE();
 		_numArray = _fileHandle.readUint16LE();
 		_fileHandle.readUint16LE();
@@ -2429,7 +2429,7 @@
 	_inventory = (uint16 *)calloc(_numInventory, sizeof(uint16));
 	_verbs = (VerbSlot *)calloc(_numVerbs, sizeof(VerbSlot));
 	_objs = (ObjectData *)calloc(_numLocalObjects, sizeof(ObjectData));
-	_roomVars = (int32 *)calloc(_numBitVariables, sizeof(int32));
+	_roomVars = (int32 *)calloc(_numRoomVariables, sizeof(int32));
 	_scummVars = (int32 *)calloc(_numVariables, sizeof(int32));
 	_bitVars = (byte *)calloc(_numBitVariables >> 3, 1);
 	_images = (uint16 *)calloc(_numImages, sizeof(uint16));

Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script.cpp,v
retrieving revision 1.182
retrieving revision 1.183
diff -u -d -r1.182 -r1.183
--- script.cpp	26 Aug 2004 23:15:39 -0000	1.182
+++ script.cpp	26 Aug 2004 23:30:27 -0000	1.183
@@ -518,7 +518,7 @@
 	if (var & 0x8000) {
 		if (_gameId == GID_PAJAMA) {
 			var &= 0xFFF;
-			checkRange(_numBitVariables, 0, var, "Room variable %d out of range(w)");
+			checkRange(_numRoomVariables - 1, 0, var, "Room variable %d out of range(w)");
 			return _roomVars[var];
 
 		} else if ((_gameId == GID_ZAK256) || (_features & GF_OLD_BUNDLE) || 
@@ -601,7 +601,7 @@
 	if (var & 0x8000) {
 		if (_gameId == GID_PAJAMA) {
 			var &= 0xFFF;
-			checkRange(_numBitVariables, 0, var, "Room variable %d out of range(w)");
+			checkRange(_numRoomVariables - 1, 0, var, "Room variable %d out of range(w)");
 			_roomVars[var] = value;
 
 		} else if ((_gameId == GID_ZAK256) || (_features & GF_OLD_BUNDLE) ||

Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.153
retrieving revision 1.154
diff -u -d -r1.153 -r1.154
--- scumm.cpp	26 Aug 2004 23:15:37 -0000	1.153
+++ scumm.cpp	26 Aug 2004 23:30:27 -0000	1.154
@@ -496,6 +496,7 @@
 	_bitVars = NULL;
 	_numVariables = 0;
 	_numBitVariables = 0;
+	_numRoomVariables = 0;
 	_numLocalObjects = 0;
 	_numGlobalObjects = 0;
 	_numArray = 0;

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.455
retrieving revision 1.456
diff -u -d -r1.455 -r1.456
--- scumm.h	26 Aug 2004 23:15:38 -0000	1.455
+++ scumm.h	26 Aug 2004 23:30:28 -0000	1.456
@@ -481,7 +481,7 @@
 	int _numGlobalObjects, _numArray, _numVerbs, _numFlObject;
 	int _numInventory, _numRooms, _numScripts, _numSounds;
 	int _numNewNames, _numGlobalScripts;
-	int _numActors, _numImages;
+	int _numActors, _numImages, _numRoomVariables;
 public:
 	int _numCostumes;	// FIXME - should be protected, used by Actor::remapActorPalette
 	int _numCharsets;	// FIXME - should be protected, used by CharsetRenderer





More information about the Scummvm-git-logs mailing list