diff options
author | Max Horn | 2003-04-12 19:44:06 +0000 |
---|---|---|
committer | Max Horn | 2003-04-12 19:44:06 +0000 |
commit | bd2011467b83e5ca6a65f534e8db59a63cab4f38 (patch) | |
tree | 488c5528956644984761d3b0360dfbd7dd2d08a9 /scumm | |
parent | a33e4dddac3cbe340b15b1705f61343422fcd79c (diff) | |
download | scummvm-rg350-bd2011467b83e5ca6a65f534e8db59a63cab4f38.tar.gz scummvm-rg350-bd2011467b83e5ca6a65f534e8db59a63cab4f38.tar.bz2 scummvm-rg350-bd2011467b83e5ca6a65f534e8db59a63cab4f38.zip |
hacked in some verb object support for OLD_BUNDLE (drawVerbBitmap part not yet tested; but the setVerbObject is needed now already)
svn-id: r6993
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/verbs.cpp | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/scumm/verbs.cpp b/scumm/verbs.cpp index 2cf25364f5..3e3c544e97 100644 --- a/scumm/verbs.cpp +++ b/scumm/verbs.cpp @@ -202,7 +202,7 @@ void Scumm::restoreVerbBG(int verb) { void Scumm::drawVerbBitmap(int verb, int x, int y) { VirtScreen *vs; VerbSlot *vst; - byte twobufs, *imptr; + byte twobufs, *imptr = 0; int ydiff, xstrip; int imgw, imgh; int i, tmp; @@ -223,8 +223,23 @@ void Scumm::drawVerbBitmap(int verb, int x, int y) { obim = getResourceAddress(rtVerb, verb); if (_features & GF_SMALL_HEADER) { - int obj; - obj = READ_LE_UINT16(obim + 6); + 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 + 11)); + imgh = (*(roomptr + _objs[i].OBCDoffset + 17)) >> 3; + imptr = (roomptr + _objs[i].OBIMoffset + 8); + } else if (_features & GF_SMALL_HEADER) { size = READ_LE_UINT32(obim); imgw = (*(obim + size + 11)); @@ -255,6 +270,7 @@ void Scumm::drawVerbBitmap(int verb, int x, int y) { if (!imptr) error("No image for verb %d", verb); } + assert(imptr); for (i = 0; i < imgw; i++) { tmp = xstrip + i; if (tmp < gdi._numStrips) @@ -313,7 +329,11 @@ void Scumm::setVerbObject(uint room, uint object, uint verb) { if (whereIsObject(object) == WIO_FLOBJECT) error("Can't grab verb image from flobject"); - if (_features & GF_SMALL_HEADER) { + if (_features & GF_OLD_BUNDLE) { + uint32 *ptr = (uint32 *)createResource(rtVerb, verb, 8); + ptr[0] = TO_LE_32(room); + ptr[1] = TO_LE_32(object); + } else if (_features & GF_SMALL_HEADER) { for (i = (_numLocalObjects-1); i > 0; i--) { if (_objs[i].obj_nr == object) { findObjectInRoom(&foir, foImageHeader, object, room); @@ -325,6 +345,7 @@ void Scumm::setVerbObject(uint room, uint object, uint verb) { obcdptr = getResourceAddress(rtRoom, room) + getOBCDOffs(object); memcpy(getResourceAddress(rtVerb, verb), obimptr, size); memcpy(getResourceAddress(rtVerb, verb) + size, obcdptr, size2); + return; } } } else { |