[Scummvm-cvs-logs] CVS: scummvm/scumm saveload.cpp,1.180,1.181 object.cpp,1.202,1.203 object.h,1.14,1.15

Max Horn fingolfin at users.sourceforge.net
Fri Oct 8 16:10:01 CEST 2004


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

Modified Files:
	saveload.cpp object.cpp object.h 
Log Message:
Use image header to detect presence of the V8 flags field; rewrote that flags field to load the ObjectData.flags field differently; added a comment in saveload.cpp since we are not yet saving ObjectData.flags

Index: saveload.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/saveload.cpp,v
retrieving revision 1.180
retrieving revision 1.181
diff -u -d -r1.180 -r1.181
--- saveload.cpp	7 Oct 2004 21:23:29 -0000	1.180
+++ saveload.cpp	8 Oct 2004 23:06:19 -0000	1.181
@@ -400,6 +400,8 @@
 		MKLINE(ObjectData, parent, sleByte, VER(8)),
 		MKLINE(ObjectData, state, sleByte, VER(8)),
 		MKLINE(ObjectData, fl_object_index, sleByte, VER(8)),
+		// TODO
+		//MKLINE(ObjectData, flag, sleByte, VER(XXX)),
 		MKEND()
 	};
 

Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/object.cpp,v
retrieving revision 1.202
retrieving revision 1.203
diff -u -d -r1.202 -r1.203
--- object.cpp	8 Oct 2004 07:34:06 -0000	1.202
+++ object.cpp	8 Oct 2004 23:06:19 -0000	1.203
@@ -471,13 +471,7 @@
 	}
 
 	if (numstrip != 0) {
-		byte flags;
-		if ((_gameId == GID_CMI) && !(_features & GF_DEMO))
-			flags = ((od.flag & 16) == 0) ? Gdi::dbAllowMaskOr : 0;
-		else if (_features & GF_HUMONGOUS)
-			flags = ((od.flag & 1) != 0) ? Gdi::dbAllowMaskOr : 0;
-		else
-			flags = Gdi::dbAllowMaskOr;
+		byte flags = od.flags;
 
 		if (_version == 1) {
 			gdi._C64ObjectMode = true;
@@ -768,6 +762,8 @@
 		error("Room %d missing CDHD blocks(s)", _roomResource);
 	imhd = (const ImageHeader *)findResourceData(MKID('IMHD'), room + od->OBIMoffset);
 
+	od->flags = Gdi::dbAllowMaskOr;
+
 	if (_version == 8) {
 		od->obj_nr = READ_LE_UINT16(&(cdhd->v7.obj_id));
 
@@ -780,8 +776,8 @@
 		od->height = (uint)READ_LE_UINT32(&imhd->v8.height);
 		// HACK: This is done sinec an angle doesn't fit into a byte (360 > 256)
 		od->actordir = toSimpleDir(1, READ_LE_UINT32(&imhd->v8.actordir));
-		if (!(_features & GF_DEMO))
-			od->flag = (byte)READ_LE_UINT32(&imhd->v8.flag);
+		if (FROM_LE_32(imhd->v8.version) == 801)
+			od->flags = ((((byte)READ_LE_UINT32(&imhd->v8.flags)) & 16) == 0) ? Gdi::dbAllowMaskOr : 0;
 
 	} else if (_version == 7) {
 		od->obj_nr = READ_LE_UINT16(&(cdhd->v7.obj_id));
@@ -809,7 +805,9 @@
 		}
 		od->parent = cdhd->v6.parent;
 		od->actordir = cdhd->v6.actordir;
-		od->flag = imhd->old.flag;
+
+		if (_features & GF_HUMONGOUS)
+			od->flags = ((imhd->old.flags & 1) != 0) ? Gdi::dbAllowMaskOr : 0;
 
 	} else {
 		od->obj_nr = READ_LE_UINT16(&(cdhd->v5.obj_id));

Index: object.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/object.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- object.h	4 Oct 2004 12:16:52 -0000	1.14
+++ object.h	8 Oct 2004 23:06:19 -0000	1.15
@@ -37,7 +37,7 @@
 	byte parentstate;
 	byte state;
 	byte fl_object_index;
-	byte flag;
+	byte flags;
 };
 
 #if !defined(__GNUC__)
@@ -105,7 +105,7 @@
 			uint16 obj_id;
 			uint16 image_count;
 			uint16 unk[1];
-			byte flag;
+			byte flags;
 			byte unk1;
 			uint16 unk2[2];
 			uint16 width;
@@ -140,7 +140,7 @@
 			uint32 width;
 			uint32 height;
 			uint32 actordir;
-			uint32 flag;	// This field is missing in the COMI demo (version == 800) !
+			uint32 flags;	// This field is missing in the COMI demo (version == 800) !
 			struct {
 				int32 x, y;
 			} GCC_PACK hotspot[15];





More information about the Scummvm-git-logs mailing list