[Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.415,2.416 object.cpp,1.217,1.218 resource.cpp,1.298,1.299 resource_v3.cpp,1.31,1.32 scumm.cpp,1.398,1.399 scumm.h,1.558,1.559

Max Horn fingolfin at users.sourceforge.net
Sun Apr 3 15:11:01 CEST 2005


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

Modified Files:
	intern.h object.cpp resource.cpp resource_v3.cpp scumm.cpp 
	scumm.h 
Log Message:
Split readResTypeList into a normal and a GF_OLD_BUNDLE version; added comments to many of the GF_ feature flags; removed GF_DRAWOBJ_OTHER_ORDER (it was only use by Sam&Max, I switched that to a direct check for Sam&Max)

Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.415
retrieving revision 2.416
diff -u -d -r2.415 -r2.416
--- intern.h	3 Apr 2005 15:06:07 -0000	2.415
+++ intern.h	3 Apr 2005 22:09:51 -0000	2.416
@@ -215,6 +215,7 @@
 	ScummEngine_v3old(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]);
 
 protected:
+	void readResTypeList(int id, uint32 tag, const char *name);
 	void readIndexFile();
 	void initRoomSubBlocks();
 	void loadRoomObjects();

Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/object.cpp,v
retrieving revision 1.217
retrieving revision 1.218
diff -u -d -r1.217 -r1.218
--- object.cpp	3 Apr 2005 15:06:07 -0000	1.217
+++ object.cpp	3 Apr 2005 22:09:51 -0000	1.218
@@ -400,7 +400,8 @@
 	int i;
 	const int mask = (_version <= 2) ? 0x8 : 0xF;
 
-	if (_features & GF_DRAWOBJ_OTHER_ORDER) {
+	if (_gameId == GID_SAMNMAX) {
+		// In Sam & Max, objects are drawn in reverse order.
 		for (i = 1; i < _numLocalObjects; i++)
 			if (_objs[i].obj_nr > 0)
 				drawRoomObject(i, arg);

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.298
retrieving revision 1.299
diff -u -d -r1.298 -r1.299
--- resource.cpp	31 Mar 2005 23:11:38 -0000	1.298
+++ resource.cpp	3 Apr 2005 22:09:52 -0000	1.299
@@ -34,8 +34,9 @@
 
 namespace Scumm {
 
+extern const char *resTypeFromId(int id);
+
 static uint16 newTag2Old(uint32 newTag);
-static const char *resTypeFromId(int id);
 static const byte *findResourceSmall(uint32 tag, const byte *searchin);
 
 
@@ -520,37 +521,14 @@
 
 	if (_version == 8)
 		num = _fileHandle->readUint32LE();
-	else if (!(_features & GF_OLD_BUNDLE))
-		num = _fileHandle->readUint16LE();
 	else
-		num = _fileHandle->readByte();
+		num = _fileHandle->readUint16LE();
 
-	if (_features & GF_OLD_BUNDLE) {
-		if (num >= 0xFF) {
-			error("Too many %ss (%d) in directory", name, num);
-		}
-	} else {
-		if (num != res.num[id]) {
-			error("Invalid number of %ss (%d) in directory", name, num);
-		}
+	if (num != res.num[id]) {
+		error("Invalid number of %ss (%d) in directory", name, num);
 	}
 
-	if (_features & GF_OLD_BUNDLE) {
-		if (id == rtRoom) {
-			for (i = 0; i < num; i++)
-				res.roomno[id][i] = i;
-			_fileHandle->seek(num, SEEK_CUR);
-		} else {
-			for (i = 0; i < num; i++)
-				res.roomno[id][i] = _fileHandle->readByte();
-		}
-		for (i = 0; i < num; i++) {
-			res.roomoffs[id][i] = _fileHandle->readUint16LE();
-			if (res.roomoffs[id][i] == 0xFFFF)
-				res.roomoffs[id][i] = 0xFFFFFFFF;
-		}
-
-	} else if (_features & GF_SMALL_HEADER) {
+	if (_features & GF_SMALL_HEADER) {
 		for (i = 0; i < num; i++) {
 			res.roomno[id][i] = _fileHandle->readByte();
 			res.roomoffs[id][i] = _fileHandle->readUint32LE();

Index: resource_v3.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource_v3.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- resource_v3.cpp	3 Apr 2005 15:06:08 -0000	1.31
+++ resource_v3.cpp	3 Apr 2005 22:10:08 -0000	1.32
@@ -26,6 +26,36 @@
 
 namespace Scumm {
 
+extern const char *resTypeFromId(int id);
+
+
+void ScummEngine_v3old::readResTypeList(int id, uint32 tag, const char *name) {
+	int num;
+	int i;
+
+	debug(9, "readResTypeList(%s,%s,%s)", resTypeFromId(id), tag2str(TO_BE_32(tag)), name);
+
+	num = _fileHandle->readByte();
+
+	if (num >= 0xFF) {
+		error("Too many %ss (%d) in directory", name, num);
+	}
+
+	if (id == rtRoom) {
+		for (i = 0; i < num; i++)
+			res.roomno[id][i] = i;
+		_fileHandle->seek(num, SEEK_CUR);
+	} else {
+		for (i = 0; i < num; i++)
+			res.roomno[id][i] = _fileHandle->readByte();
+	}
+	for (i = 0; i < num; i++) {
+		res.roomoffs[id][i] = _fileHandle->readUint16LE();
+		if (res.roomoffs[id][i] == 0xFFFF)
+			res.roomoffs[id][i] = 0xFFFFFFFF;
+	}
+}
+
 void ScummEngine_v3old::readIndexFile() {
 	int magic = 0;
 	debug(9, "readIndexFile()");

Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.398
retrieving revision 1.399
diff -u -d -r1.398 -r1.399
--- scumm.cpp	3 Apr 2005 15:06:08 -0000	1.398
+++ scumm.cpp	3 Apr 2005 22:10:08 -0000	1.399
@@ -168,19 +168,19 @@
 	 GF_NEW_OPCODES | GF_USE_KEY, 0, 0},
 
 	{"samnmax", "Sam & Max", GID_SAMNMAX, 6, 0, 30, /*MDT_PCSPK |*/ MDT_ADLIB | MDT_NATIVE,
-	 GF_NEW_OPCODES | GF_USE_KEY | GF_DRAWOBJ_OTHER_ORDER, 0, 0},
+	 GF_NEW_OPCODES | GF_USE_KEY, 0, 0},
 	{"samnmax-alt", "Sam & Max (alt)", GID_SAMNMAX, 6, 0, 30, /*MDT_PCSPK |*/ MDT_ADLIB | MDT_NATIVE,
-	 GF_NEW_OPCODES | GF_USE_KEY | GF_DRAWOBJ_OTHER_ORDER, "samnmax", "samnmax.sm0"},
+	 GF_NEW_OPCODES | GF_USE_KEY, "samnmax", "samnmax.sm0"},
 	{"samnmaxMac", "Sam & Max (Mac)", GID_SAMNMAX, 6, 0, 30, /*MDT_PCSPK |*/ MDT_ADLIB | MDT_NATIVE,
-	 GF_NEW_OPCODES | GF_USE_KEY | GF_DRAWOBJ_OTHER_ORDER, "samnmax", "Sam & Max Data"},
+	 GF_NEW_OPCODES | GF_USE_KEY, "samnmax", "Sam & Max Data"},
 	{"samdemo", "Sam & Max (Demo)", GID_SAMNMAX, 6, 0, 30, /*MDT_PCSPK |*/ MDT_ADLIB | MDT_NATIVE,
-	 GF_NEW_OPCODES | GF_USE_KEY | GF_DRAWOBJ_OTHER_ORDER, 0, 0},
+	 GF_NEW_OPCODES | GF_USE_KEY, 0, 0},
 	{"samdemoMac", "Sam & Max (Mac Demo)", GID_SAMNMAX, 6, 0, 30, /*MDT_PCSPK |*/ MDT_ADLIB | MDT_NATIVE,
-	 GF_NEW_OPCODES | GF_USE_KEY | GF_DRAWOBJ_OTHER_ORDER, "samdemo", "Sam & Max Demo Data"},
+	 GF_NEW_OPCODES | GF_USE_KEY, "samdemo", "Sam & Max Demo Data"},
 	{"snmdemo", "Sam & Max (Demo)", GID_SAMNMAX, 6, 0, 30, /*MDT_PCSPK |*/ MDT_ADLIB | MDT_NATIVE,
-	 GF_NEW_OPCODES | GF_USE_KEY | GF_DRAWOBJ_OTHER_ORDER, 0, "snmdemo.sm0"},
+	 GF_NEW_OPCODES | GF_USE_KEY, 0, "snmdemo.sm0"},
 	{"snmidemo", "Sam & Max (Interactive WIP Demo)", GID_SAMNMAX, 6, 0, 30, /*MDT_PCSPK |*/ MDT_ADLIB | MDT_NATIVE,
-	 GF_NEW_OPCODES | GF_USE_KEY | GF_DRAWOBJ_OTHER_ORDER, 0, 0},
+	 GF_NEW_OPCODES | GF_USE_KEY, 0, 0},
 
 //	{"test", "Test demo game", GID_SAMNMAX, 6, 0, /*MDT_PCSPK |*/ MDT_ADLIB | MDT_NATIVE, GF_NEW_OPCODES, 0, 0},
 

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.558
retrieving revision 1.559
diff -u -d -r1.558 -r1.559
--- scumm.h	3 Apr 2005 15:06:08 -0000	1.558
+++ scumm.h	3 Apr 2005 22:10:10 -0000	1.559
@@ -72,22 +72,55 @@
 	KEY_ALL_SKIP = 3457   // WinCE
 };
 
-/** SCUMM feature flags. */
+/**
+ * SCUMM feature flags define for every game which specific set of engine
+ * features are used by that game.
+ * Note that some of them could be replaced by checks for the SCUMM version.
+ */
 enum GameFeatures {
+	/** Games with the new stack based opcodes (ScummEngine_v6 and subclasses). */
 	GF_NEW_OPCODES         = 1 << 0,
+	
+	/** Games with the new camera system (ScummEngine_v7 and subclasses). */
 	GF_NEW_CAMERA          = 1 << 1,
+
+	/** Games with the AKOS custome system (ScummEngine_v7 and subclasses, HE games). */
 	GF_NEW_COSTUMES        = 1 << 2,
+
+	/** Games with digital IMUSE (ScummEngine_v7 and subclasses). */
 	GF_DIGI_IMUSE          = 1 << 3,
+
+	/** Games using XOR encrypted data files. */
 	GF_USE_KEY             = 1 << 4,
-	GF_DRAWOBJ_OTHER_ORDER = 1 << 5,
+	
+	/** Small header games (ScummEngine_v4 and subclasses). */
 	GF_SMALL_HEADER        = 1 << 6,
+
+	/** Small name games (ScummEngine_v3 and subclasses). */
 	GF_SMALL_NAMES         = 1 << 7,
+
+	/** Old bundle games (ScummEngine_v3old and subclasses). */
 	GF_OLD_BUNDLE          = 1 << 8,
+
+	/** EGA games. */
 	GF_16COLOR             = 1 << 9,
+
+	/** VGA versions of V3 games. */
 	GF_OLD256              = 1 << 10,
+
+	/** Games which have Audio CD tracks. */
 	GF_AUDIOTRACKS         = 1 << 11,
+
+	/** Games without actor scaling (ScummEngine_v3 and subclasses). */
 	GF_NO_SCALING          = 1 << 12,
+
+	/**
+	 * Games using only very few local variables in scripts.
+	 * Apparently that is only the case for 256 color version of Indy3.
+	 */
 	GF_FEW_LOCALS          = 1 << 13,
+
+	/** Games made by Humongous Entertainment. */
 	GF_HUMONGOUS           = 1 << 14,
 	GF_MULTIPLE_VERSIONS   = 1 << 15,
 	
@@ -668,7 +701,7 @@
 	bool openResourceFile(const char *filename, byte encByte);
 
 	void loadPtrToResource(int type, int i, const byte *ptr);
-	void readResTypeList(int id, uint32 tag, const char *name);
+	virtual void readResTypeList(int id, uint32 tag, const char *name);
 	void allocResTypeData(int id, uint32 tag, int num, const char *name, int mode);
 	byte *createResource(int type, int index, uint32 size);
 	int loadResource(int type, int i);





More information about the Scummvm-git-logs mailing list