aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMax Horn2004-08-27 23:50:45 +0000
committerMax Horn2004-08-27 23:50:45 +0000
commit13b6cf7c67dce13c1d457d58ecee20345c83e8e2 (patch)
tree2d0c826c11721e184c41f32b0f939dca6225639c /scumm
parent1d8c4794bf3ad731da0a62cffa55ab75aaa928ab (diff)
downloadscummvm-rg350-13b6cf7c67dce13c1d457d58ecee20345c83e8e2.tar.gz
scummvm-rg350-13b6cf7c67dce13c1d457d58ecee20345c83e8e2.tar.bz2
scummvm-rg350-13b6cf7c67dce13c1d457d58ecee20345c83e8e2.zip
Added support for ImageHeader version 800, used by the COMI demo (inspired by cyx' work, see RFE #690559: support comi demo)
svn-id: r14798
Diffstat (limited to 'scumm')
-rw-r--r--scumm/object.cpp19
-rw-r--r--scumm/object.h30
2 files changed, 27 insertions, 22 deletions
diff --git a/scumm/object.cpp b/scumm/object.cpp
index d6c60aac0d..a741321326 100644
--- a/scumm/object.cpp
+++ b/scumm/object.cpp
@@ -261,8 +261,18 @@ void ScummEngine::getObjectXYPos(int object, int &x, int &y, int &dir) {
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 @@ void ScummEngine::drawBlastObject(BlastObject *eo) {
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;
diff --git a/scumm/object.h b/scumm/object.h
index ac8b4ab4cd..0eddfe6aed 100644
--- a/scumm/object.h
+++ b/scumm/object.h
@@ -41,7 +41,7 @@ struct ObjectData {
#if !defined(__GNUC__)
#pragma START_PACK_STRUCTS
-#endif
+#endif
struct RoomHeader {
union {
@@ -94,7 +94,7 @@ struct CodeHeader {
byte parent;
byte parentstate;
} GCC_PACK v7;
-
+
} GCC_PACK;
} GCC_PACK;
@@ -126,22 +126,16 @@ struct ImageHeader { /* file format */
} 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];