aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMax Horn2004-10-08 23:06:19 +0000
committerMax Horn2004-10-08 23:06:19 +0000
commitca41dba220eceb2f2cca43126ee91ef9c86bae95 (patch)
tree94b31c35173a1af924a08797596f2a53919b3999 /scumm
parent2611630f81535f3db7911f1176f84c083e21264b (diff)
downloadscummvm-rg350-ca41dba220eceb2f2cca43126ee91ef9c86bae95.tar.gz
scummvm-rg350-ca41dba220eceb2f2cca43126ee91ef9c86bae95.tar.bz2
scummvm-rg350-ca41dba220eceb2f2cca43126ee91ef9c86bae95.zip
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
svn-id: r15479
Diffstat (limited to 'scumm')
-rw-r--r--scumm/object.cpp18
-rw-r--r--scumm/object.h6
-rw-r--r--scumm/saveload.cpp2
3 files changed, 13 insertions, 13 deletions
diff --git a/scumm/object.cpp b/scumm/object.cpp
index 6c9460ae61..bc3e1fb06c 100644
--- a/scumm/object.cpp
+++ b/scumm/object.cpp
@@ -471,13 +471,7 @@ void ScummEngine::drawObject(int obj, int arg) {
}
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 @@ void ScummEngine::setupRoomObject(ObjectData *od, const byte *room, const byte *
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 @@ void ScummEngine::setupRoomObject(ObjectData *od, const byte *room, const byte *
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 @@ void ScummEngine::setupRoomObject(ObjectData *od, const byte *room, const byte *
}
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));
diff --git a/scumm/object.h b/scumm/object.h
index cbd92cf428..627e54609d 100644
--- a/scumm/object.h
+++ b/scumm/object.h
@@ -37,7 +37,7 @@ struct ObjectData {
byte parentstate;
byte state;
byte fl_object_index;
- byte flag;
+ byte flags;
};
#if !defined(__GNUC__)
@@ -105,7 +105,7 @@ struct ImageHeader { /* file format */
uint16 obj_id;
uint16 image_count;
uint16 unk[1];
- byte flag;
+ byte flags;
byte unk1;
uint16 unk2[2];
uint16 width;
@@ -140,7 +140,7 @@ struct ImageHeader { /* file format */
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];
diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp
index 38a339da8d..a1173b66e7 100644
--- a/scumm/saveload.cpp
+++ b/scumm/saveload.cpp
@@ -400,6 +400,8 @@ void ScummEngine::saveOrLoad(Serializer *s, uint32 savegameVersion) {
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()
};