[Scummvm-cvs-logs] CVS: scummvm/scumm resource.cpp,1.308,1.309 resource_v4.cpp,1.20,1.21 resource_v7he.cpp,1.28,1.29 scumm.cpp,1.417,1.418 scumm.h,1.572,1.573

Max Horn fingolfin at users.sourceforge.net
Sat Apr 9 17:33:58 CEST 2005


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

Modified Files:
	resource.cpp resource_v4.cpp resource_v7he.cpp scumm.cpp 
	scumm.h 
Log Message:
Got rid of _dynamicRoomOffsets

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.308
retrieving revision 1.309
diff -u -d -r1.308 -r1.309
--- resource.cpp	9 Apr 2005 20:26:51 -0000	1.308
+++ resource.cpp	10 Apr 2005 00:33:30 -0000	1.309
@@ -187,9 +187,6 @@
 
 /** Delete the currently loaded room offsets. */
 void ScummEngine::deleteRoomOffsets() {
-	if (!(_features & GF_SMALL_HEADER) && !_dynamicRoomOffsets)
-		return;
-
 	for (int i = 0; i < _numRooms; i++) {
 		if (res.roomoffs[rtRoom][i] != 0xFFFFFFFF)
 			res.roomoffs[rtRoom][i] = 0;
@@ -202,13 +199,10 @@
 
 	debug(9, "readRoomOffsets()");
 
-	if (!(_features & GF_SMALL_HEADER)) {
-		if (!_dynamicRoomOffsets)
-			return;
-
-		_fileHandle->seek(16, SEEK_SET);
-	} else {
+	if (_features & GF_SMALL_HEADER) {
 		_fileHandle->seek(12, SEEK_SET);	// Directly searching for the room offset block would be more generic...
+	} else {
+		_fileHandle->seek(16, SEEK_SET);
 	}
 
 	num = _fileHandle->readByte();
@@ -289,7 +283,7 @@
 	openRoom(0);
 
 	if (_version <= 5) {
-		/* Figure out the sizes of various resources */
+		// Figure out the sizes of various resources
 		while (!_fileHandle->eof()) {
 			blocktype = fileReadDword();
 			itemsize = _fileHandle->readUint32BE();
@@ -347,7 +341,8 @@
 			break;
 
 		case MKID('RNAM'):
-			// Names of rooms
+			// Names of rooms. Maybe we should read them and put them
+			// into a table, for use by the debugger?
 			_fileHandle->seek(itemsize - 8, SEEK_CUR);
 			debug(9, "found RNAM block, skipping");
 			break;
@@ -991,7 +986,6 @@
 		_shadowPalette = (byte *)calloc(_shadowPaletteSize, 1);
 
 	allocateArrays();
-	_dynamicRoomOffsets = true;
 }
 
 void ScummEngine_v8::readMAXS(int blockSize) {
@@ -1023,7 +1017,6 @@
 	_shadowPalette = (byte *)calloc(_shadowPaletteSize, 1);
 
 	allocateArrays();
-	_dynamicRoomOffsets = true;
 }
 
 void ScummEngine_v7::readMAXS(int blockSize) {
@@ -1058,7 +1051,6 @@
 	_shadowPalette = (byte *)calloc(_shadowPaletteSize, 1);
 
 	allocateArrays();
-	_dynamicRoomOffsets = true;
 }
 
 void ScummEngine_v6::readMAXS(int blockSize) {
@@ -1092,7 +1084,6 @@
 	_shadowPalette = (byte *)calloc(_shadowPaletteSize, 1);
 
 	allocateArrays();
-	_dynamicRoomOffsets = true;
 }
 
 void ScummEngine::readGlobalObjects() {

Index: resource_v4.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource_v4.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- resource_v4.cpp	9 Apr 2005 20:22:30 -0000	1.20
+++ resource_v4.cpp	10 Apr 2005 00:33:30 -0000	1.21
@@ -38,6 +38,7 @@
 	openRoom(0);
 
 	while (!_fileHandle->eof()) {
+		// Figure out the sizes of various resources
 		itemsize = _fileHandle->readUint32LE();
 		blocktype = _fileHandle->readUint16LE();
 		if (_fileHandle->ioFailed())
@@ -89,6 +90,8 @@
 		switch (blocktype) {
 
 		case 0x4E52:	// 'NR'
+			// Names of rooms. Maybe we should read them and put them
+			// into a table, for use by the debugger?
 			_fileHandle->seek(itemsize - 6, SEEK_CUR);
 			break;
 

Index: resource_v7he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource_v7he.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- resource_v7he.cpp	9 Apr 2005 20:22:30 -0000	1.28
+++ resource_v7he.cpp	10 Apr 2005 00:33:30 -0000	1.29
@@ -1688,7 +1688,6 @@
 	_numGlobalScripts = 2048;
 
 	allocateArrays();
-	_dynamicRoomOffsets = true;
 }
 
 void ScummEngine_v90he::readMAXS(int blockSize) {
@@ -1722,7 +1721,6 @@
 		_numGlobalScripts = 200;
 
 	allocateArrays();
-	_dynamicRoomOffsets = true;
 }
 
 void ScummEngine_v72he::readMAXS(int blockSize) {
@@ -1750,7 +1748,6 @@
 	_numGlobalScripts = 200;
 
 	allocateArrays();
-	_dynamicRoomOffsets = true;
 }
 
 byte *ScummEngine_v72he::getStringAddress(int i) {

Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.417
retrieving revision 1.418
diff -u -d -r1.417 -r1.418
--- scumm.cpp	9 Apr 2005 20:13:29 -0000	1.417
+++ scumm.cpp	10 Apr 2005 00:33:30 -0000	1.418
@@ -774,7 +774,6 @@
 	_keyScriptKey = 0;
 	_keyScriptNo = 0;
 	_fileOffset = 0;
-	_dynamicRoomOffsets = false;
 	memset(_resourceMapper, 0, sizeof(_resourceMapper));
 	_lastLoadedRoom = 0;
 	_roomResource = 0;

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.572
retrieving revision 1.573
diff -u -d -r1.572 -r1.573
--- scumm.h	9 Apr 2005 20:26:51 -0000	1.572
+++ scumm.h	10 Apr 2005 00:33:31 -0000	1.573
@@ -683,7 +683,6 @@
 	int _resourceHeaderSize;
 	Common::String _gameName;	// This is the name we use for opening resource files
 	Common::String _targetName;	// This is the game the user calls it, so use for saving
-	bool _dynamicRoomOffsets;
 	byte _resourceMapper[128];
 	byte *_heV7DiskOffsets;
 	byte *_heV7RoomOffsets;





More information about the Scummvm-git-logs mailing list