[Scummvm-cvs-logs] CVS: scummvm/scumm script_v72he.cpp,2.116,2.117

Travis Howell kirben at users.sourceforge.net
Tue Sep 21 04:23:12 CEST 2004


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

Modified Files:
	script_v72he.cpp 
Log Message:

Add multi-block support for HE games.


Index: script_v72he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v72he.cpp,v
retrieving revision 2.116
retrieving revision 2.117
diff -u -d -r2.116 -r2.117
--- script_v72he.cpp	21 Sep 2004 09:09:51 -0000	2.116
+++ script_v72he.cpp	21 Sep 2004 11:22:39 -0000	2.117
@@ -625,8 +625,33 @@
 }
 
 const byte *ScummEngine_v72he::findWrappedBlock(uint32 tag, const byte *ptr, int state, bool errorFlag) {
+	printf("findWrappedBlock: tag %x\n", tag);
 	if (READ_UINT32(ptr) == MKID('MULT')) {
-		error("findWrappedBlock: multi blocks aren't implemented");
+		const byte *offs, *wrap;
+		uint32 size;
+
+		wrap = findResource(MKID('WRAP'), ptr);
+		if (wrap == NULL)
+			return NULL;
+
+		offs = findResourceData(MKID('OFFS'), wrap);
+		if (offs == NULL)
+			return NULL;
+
+		size = getResourceDataSize(offs) / 4;
+		if ((uint32)state >= (uint32)size)
+			return NULL;
+
+		offs += READ_LE_UINT32(offs + state * sizeof(uint32));
+		offs = findResourceData(tag, offs - 8);
+;		if (offs)
+			return offs;
+
+		offs = findResourceData(MKID('DEFA'), ptr);
+		if (offs == NULL)
+			return NULL;
+
+		return findResourceData(tag, offs - 8);
 	} else {
 		return findResourceData(tag, ptr);
 	}





More information about the Scummvm-git-logs mailing list