diff options
author | Max Horn | 2002-12-24 16:10:31 +0000 |
---|---|---|
committer | Max Horn | 2002-12-24 16:10:31 +0000 |
commit | 190685dc69dad12563ccf8ed3689ec1f34cff360 (patch) | |
tree | 540f3044d93a6049b8f3e862be44dceb59dff68b /scumm/object.cpp | |
parent | 22ab263b002c2f0946fa56c2463860f64b384278 (diff) | |
download | scummvm-rg350-190685dc69dad12563ccf8ed3689ec1f34cff360.tar.gz scummvm-rg350-190685dc69dad12563ccf8ed3689ec1f34cff360.tar.bz2 scummvm-rg350-190685dc69dad12563ccf8ed3689ec1f34cff360.zip |
added a map from object names to object ids
svn-id: r6104
Diffstat (limited to 'scumm/object.cpp')
-rw-r--r-- | scumm/object.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/scumm/object.cpp b/scumm/object.cpp index 25a526624f..a28f7fdd36 100644 --- a/scumm/object.cpp +++ b/scumm/object.cpp @@ -459,9 +459,9 @@ void Scumm::loadRoomObjects() imhd = (ImageHeader *)findResourceData(MKID('IMHD'), ptr); if (_features & GF_AFTER_V8) - // FIXME - in v8, IMHD seems to contain no obj_id, but rather a name string - // EVIL HACK to allow loading of the first COMI room - obim_id = 1373 + i; + // In V8, IMHD has no obj_id, but rather a name string. We map the name + // back to an object id using a table derived from the DOBJ resource. + obim_id = _objectIDMap[imhd->v8.name]; else if (_features & GF_AFTER_V7) obim_id = READ_LE_UINT16(&imhd->v7.obj_id); else @@ -901,11 +901,7 @@ void Scumm::findObjectInRoom(FindObjectInRoom *fo, byte findWhat, uint id, uint } } else { cdhd = (CodeHeader *)findResourceData(MKID('CDHD'), obcdptr); - if (_features & GF_AFTER_V8) - // FIXME - in v8, IMHD seems to contain no obj_id, but rather a name string - id2 = 0; -// id2 = READ_LE_UINT32(&(cdhd->v8.obj_id)); - else if (_features & GF_AFTER_V7) + if (_features & GF_AFTER_V7) id2 = READ_LE_UINT16(&(cdhd->v7.obj_id)); else if (_features & GF_AFTER_V6) id2 = READ_LE_UINT16(&(cdhd->v6.obj_id)); @@ -942,9 +938,9 @@ void Scumm::findObjectInRoom(FindObjectInRoom *fo, byte findWhat, uint id, uint } } else { if (_features & GF_AFTER_V8) - // FIXME - in v8, IMHD seems to contain no obj_id, but rather a name string - id3 = 0; -// id3 = READ_LE_UINT32(&imhd->v8.obj_id); + // In V8, IMHD has no obj_id, but rather a name string. We map the name + // back to an object id using a table derived from the DOBJ resource. + id3 = _objectIDMap[imhd->v8.name]; else if (_features & GF_AFTER_V7) id3 = READ_LE_UINT16(&imhd->v7.obj_id); else |