[Scummvm-cvs-logs] CVS: scummvm/scumm object.cpp,1.178,1.179 object.h,1.9,1.10

Max Horn fingolfin at users.sourceforge.net
Fri Aug 27 16:51:21 CEST 2004


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

Modified Files:
	object.cpp object.h 
Log Message:
Added support for ImageHeader version 800, used by the COMI demo (inspired by cyx' work, see RFE #690559: support comi demo)

Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/object.cpp,v
retrieving revision 1.178
retrieving revision 1.179
diff -u -d -r1.178 -r1.179
--- object.cpp	23 Aug 2004 00:17:06 -0000	1.178
+++ object.cpp	27 Aug 2004 23:50:45 -0000	1.179
@@ -261,8 +261,18 @@
 		imhd = (const ImageHeader *)findResourceData(MKID('IMHD'), ptr);
 		assert(imhd);
 		if (_version == 8) {
-			x = od.x_pos + (int32)READ_LE_UINT32(&imhd->v8.hotspot[state].x);
-			y = od.y_pos + (int32)READ_LE_UINT32(&imhd->v8.hotspot[state].y);
+			switch (FROM_LE_32(imhd->v8.version)) {
+			case 800:
+				x = od.x_pos + (int32)READ_LE_UINT32((const byte *)imhd + 8 * state + 0x44);
+				y = od.y_pos + (int32)READ_LE_UINT32((const byte *)imhd + 8 * state + 0x48); 
+				break;
+			case 801:
+				x = od.x_pos + (int32)READ_LE_UINT32(&imhd->v8.hotspot[state].x);
+				y = od.y_pos + (int32)READ_LE_UINT32(&imhd->v8.hotspot[state].y);
+				break;
+			default:
+				error("Unsupported image header version %d\n", FROM_LE_32(imhd->v8.version));
+			}
 		} else if (_version == 7) {
 			x = od.x_pos + (int16)READ_LE_UINT16(&imhd->v7.hotspot[state].x);
 			y = od.y_pos + (int16)READ_LE_UINT16(&imhd->v7.hotspot[state].y);
@@ -1473,10 +1483,11 @@
 	bdd.out = vs->getPixels(0, 0);
 	bdd.outwidth = vs->w;
 	bdd.outheight = vs->h;
+	// Skip the bomp header
 	if (_version == 8) {
-		bdd.dataptr = bomp + 8;	// Why this? See also useBompCursor
+		bdd.dataptr = bomp + 8;
 	} else {
-		bdd.dataptr = bomp + 10;	// Why this? See also useBompCursor
+		bdd.dataptr = bomp + 10;
 	}
 	bdd.x = eo->rect.left;
 	bdd.y = eo->rect.top;

Index: object.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/object.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- object.h	21 Jun 2004 02:33:23 -0000	1.9
+++ object.h	27 Aug 2004 23:50:45 -0000	1.10
@@ -41,7 +41,7 @@
 
 #if !defined(__GNUC__)
 	#pragma START_PACK_STRUCTS
-#endif	
+#endif
 
 struct RoomHeader {
 	union {
@@ -94,7 +94,7 @@
 			byte parent;
 			byte parentstate;
 		} GCC_PACK v7;
-							
+
 	} GCC_PACK;
 } GCC_PACK;
 
@@ -126,22 +126,16 @@
 		} GCC_PACK v7;
 
 		struct {
-			// Most of these seem to have length 0x58.
-			// But system-cursor-icon has length 0x60 ?!? --------+
-			char name[32];      //                                |
-			uint32 unk_1[2];	// always 0 ?                     v
-			uint32 version;		// 801; 801; 801; 801; 801; 801; 801
-			uint32 image_count;		//   0;   0;   0;   0;   0:   1;   2
-			uint32 x_pos;		//   0; 184; 264; 336; 450; 272;   0
-			uint32 y_pos;		//   0; 272; 248; 216; 168; 320;   0
-			uint32 width;		//  64; 128; 120; 128;  80;  48;  80
-			uint32 height;		// 270;  80;  80;  72;  56;  56;  56
-			uint32 actordir;	// 225;  45;  45;  45;  45;   0;   0
-			uint32 hotspot_num;	//   0;   0;   0;   0;   0;   0;   1
-								// -50; -84; -49; -19;  11; -16;  22
-								// 456; 118;  86;  76;  53: -64;  19
-								//                                22
-								//                                19
+			char name[32];
+			uint32 unk_1[2];
+			uint32 version;		// 801 in COMI, 800 in the COMI demo
+			uint32 image_count;
+			uint32 x_pos;
+			uint32 y_pos;
+			uint32 width;
+			uint32 height;
+			uint32 actordir;
+			uint32 hotspot_num;	// 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