[Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.416,2.417 resource.cpp,1.299,1.300 resource_v3.cpp,1.32,1.33 resource_v7he.cpp,1.21,1.22 scumm.h,1.559,1.560

Max Horn fingolfin at users.sourceforge.net
Sun Apr 3 15:56:44 CEST 2005


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

Modified Files:
	intern.h resource.cpp resource_v3.cpp resource_v7he.cpp 
	scumm.h 
Log Message:
Turned readRoomsOffsets into a virtual method

Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.416
retrieving revision 2.417
diff -u -d -r2.416 -r2.417
--- intern.h	3 Apr 2005 22:09:51 -0000	2.416
+++ intern.h	3 Apr 2005 22:55:48 -0000	2.417
@@ -187,6 +187,9 @@
 	void o5_walkActorToObject();
 };
 
+/**
+ * Engine for version 4 SCUMM games; GF_SMALL_HEADER is always set for these.
+ */
 class ScummEngine_v4 : public ScummEngine_v5 {
 public:
 	ScummEngine_v4(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]);
@@ -202,14 +205,21 @@
 	void setupRoomObject(ObjectData *od, const byte *room, const byte *searchptr = NULL);
 };
 
+/**
+ * Engine for version 3 SCUMM games; GF_SMALL_NAMES is always set for these.
+ */
 class ScummEngine_v3 : public ScummEngine_v4 {
 public:
 	ScummEngine_v3(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]);
 
 protected:
+	void readRoomsOffsets();
 	void loadCharset(int no);
 };
 
+/**
+ * Engine for old format version 3 SCUMM games; GF_OLD_BUNDLE is always set for these.
+ */
 class ScummEngine_v3old : public ScummEngine_v3 {
 public:
 	ScummEngine_v3old(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]);
@@ -221,6 +231,9 @@
 	void loadRoomObjects();
 };
 
+/**
+ * Engine for version 2 SCUMM games.
+ */
 class ScummEngine_v2 : public ScummEngine_v3old {
 protected:
 	void readIndexFile();
@@ -674,6 +687,8 @@
 	virtual void executeOpcode(byte i);
 	virtual const char *getOpcodeDesc(byte i);
 	
+	void readRoomsOffsets();
+
 	virtual void redrawBGAreas();
 
 	int getStringCharWidth(byte chr);

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.299
retrieving revision 1.300
diff -u -d -r1.299 -r1.300
--- resource.cpp	3 Apr 2005 22:09:52 -0000	1.299
+++ resource.cpp	3 Apr 2005 22:55:50 -0000	1.300
@@ -160,6 +160,7 @@
 				return;
 			if (_features & GF_EXTERNAL_CHARSET && room >= roomlimit)
 				return;
+			deleteRoomOffsets();
 			readRoomsOffsets();
 			_fileOffset = res.roomoffs[rtRoom][room];
 
@@ -205,25 +206,10 @@
 
 /** Read room offsets */
 void ScummEngine::readRoomsOffsets() {
-	int num, room, i;
-	byte *ptr;
+	int num, room;
 
 	debug(9, "readRoomOffsets()");
 
-	deleteRoomOffsets();
-	if (_features & GF_SMALL_NAMES)
-		return;
-
-	if (_heversion >= 70) { // Windows titles
-		num = READ_LE_UINT16(_heV7RoomOffsets);
-		ptr = _heV7RoomOffsets + 2;
-		for (i = 0; i < num; i++) {
-			res.roomoffs[rtRoom][i] = READ_LE_UINT32(ptr);	
-			ptr += 4;
-		}
-		return;
-	}
-	
 	if (!(_features & GF_SMALL_HEADER)) {
 		if (!_dynamicRoomOffsets)
 			return;

Index: resource_v3.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource_v3.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- resource_v3.cpp	3 Apr 2005 22:10:08 -0000	1.32
+++ resource_v3.cpp	3 Apr 2005 22:55:53 -0000	1.33
@@ -97,6 +97,9 @@
 	closeRoom();
 }
 
+void ScummEngine_v3::readRoomsOffsets() {
+}
+
 void ScummEngine_v3::loadCharset(int no) {
 	uint32 size;
 	memset(_charsetData, 0, sizeof(_charsetData));

Index: resource_v7he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource_v7he.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- resource_v7he.cpp	12 Mar 2005 18:02:19 -0000	1.21
+++ resource_v7he.cpp	3 Apr 2005 22:55:53 -0000	1.22
@@ -1624,4 +1624,20 @@
 	assert(datasize - dis.pos() == 0);
 }
 
+
+
+void ScummEngine_v70he::readRoomsOffsets() {
+	int num, i;
+	byte *ptr;
+
+	debug(9, "readRoomOffsets()");
+
+	num = READ_LE_UINT16(_heV7RoomOffsets);
+	ptr = _heV7RoomOffsets + 2;
+	for (i = 0; i < num; i++) {
+		res.roomoffs[rtRoom][i] = READ_LE_UINT32(ptr);	
+		ptr += 4;
+	}
+}
+
 } // End of namespace Scumm

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.559
retrieving revision 1.560
diff -u -d -r1.559 -r1.560
--- scumm.h	3 Apr 2005 22:10:10 -0000	1.559
+++ scumm.h	3 Apr 2005 22:56:02 -0000	1.560
@@ -696,7 +696,7 @@
 	void openRoom(int room);
 	void closeRoom();
 	void deleteRoomOffsets();
-	void readRoomsOffsets();
+	virtual void readRoomsOffsets();
 	void askForDisk(const char *filename, int disknum);
 	bool openResourceFile(const char *filename, byte encByte);
 





More information about the Scummvm-git-logs mailing list