diff options
author | Max Horn | 2003-04-29 01:38:10 +0000 |
---|---|---|
committer | Max Horn | 2003-04-29 01:38:10 +0000 |
commit | 89c425dc609f1f1042883e2b302d5aebcd1e7374 (patch) | |
tree | 9f2d6a2e7898df6e96fd3b2d31b914092b3d5150 /scumm/verbs.cpp | |
parent | 3fe290b57bc7ce5bd6fafc1a6302d8fb3b7dd92a (diff) | |
download | scummvm-rg350-89c425dc609f1f1042883e2b302d5aebcd1e7374.tar.gz scummvm-rg350-89c425dc609f1f1042883e2b302d5aebcd1e7374.tar.bz2 scummvm-rg350-89c425dc609f1f1042883e2b302d5aebcd1e7374.zip |
fixed LoomEGA distaff (you'll need to start a new game); added FIXME comment
svn-id: r7189
Diffstat (limited to 'scumm/verbs.cpp')
-rw-r--r-- | scumm/verbs.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/scumm/verbs.cpp b/scumm/verbs.cpp index ec931f3670..24537692e7 100644 --- a/scumm/verbs.cpp +++ b/scumm/verbs.cpp @@ -221,24 +221,11 @@ void Scumm::drawVerbBitmap(int verb, int x, int y) { xstrip = x >> 3; ydiff = y - vs->topline; - obim = getResourceAddress(rtVerb, verb); + assert(obim = getResourceAddress(rtVerb, verb)); if (_features & GF_OLD_BUNDLE) { - int room = READ_LE_UINT32(obim); - int object = READ_LE_UINT32(obim + 4); - byte *roomptr = getResourceAddress(rtRoom, room); - - assert(room == _roomResource); - - for (i = (_numLocalObjects-1); i > 0; i--) { - if (_objs[i].obj_nr == object) { - break; - } - } - assert(_objs[i].obj_nr == object); - - imgw = (*(roomptr + _objs[i].OBCDoffset + 9)); - imgh = (*(roomptr + _objs[i].OBCDoffset + 15)) >> 3; - imptr = (roomptr + _objs[i].OBIMoffset); + imgw = obim[0]; + imgh = obim[1] >> 3; + imptr = obim + 2; } else if (_features & GF_SMALL_HEADER) { size = READ_LE_UINT32(obim); @@ -330,12 +317,25 @@ void Scumm::setVerbObject(uint room, uint object, uint verb) { error("Can't grab verb image from flobject"); if (_features & GF_OLD_BUNDLE) { - uint32 *ptr = (uint32 *)createResource(rtVerb, verb, 8); - ptr[0] = TO_LE_32(room); - ptr[1] = TO_LE_32(object); + for (i = (_numLocalObjects-1); i > 0; i--) { + if (_objs[i].obj_nr == object) { + findObjectInRoom(&foir, foImageHeader, object, room); + size = READ_LE_UINT16(foir.obim); + byte *ptr = createResource(rtVerb, verb, size + 2); + obcdptr = getResourceAddress(rtRoom, room) + getOBCDOffs(object); + ptr[0] = *(obcdptr + 9); // Width + ptr[1] = *(obcdptr + 15); // Height + memcpy(ptr + 2, foir.obim, size); + return; + } + } } else if (_features & GF_SMALL_HEADER) { for (i = (_numLocalObjects-1); i > 0; i--) { if (_objs[i].obj_nr == object) { + // FIXME - the only thing we need from the OBCD is the image size! + // So we could use almost the same code (save for offsets) + // as in the GF_OLD_BUNDLE code. But of course that would break save games + // unless we insert special conversion code... <sigh> findObjectInRoom(&foir, foImageHeader, object, room); size = READ_LE_UINT32(foir.obim); obcdptr = getResourceAddress(rtRoom, room) + getOBCDOffs(object); |