diff options
author | James Brown | 2002-02-12 21:28:07 +0000 |
---|---|---|
committer | James Brown | 2002-02-12 21:28:07 +0000 |
commit | 7ee034af88f02b8fc721269d8359ba51fdfd8e38 (patch) | |
tree | c0952dd0fb21ed2cfae5eec0ddfd04936ecc489d /verbs.cpp | |
parent | f620d138f6081488514f888706157eaeac3e19e5 (diff) | |
download | scummvm-rg350-7ee034af88f02b8fc721269d8359ba51fdfd8e38.tar.gz scummvm-rg350-7ee034af88f02b8fc721269d8359ba51fdfd8e38.tar.bz2 scummvm-rg350-7ee034af88f02b8fc721269d8359ba51fdfd8e38.zip |
Further LFL additions. Zak256 plays bits of its intro, and LoomCD partially runs (may need
to hit escape a few times, after selecting your difficulty).
Still very incomplete and in progress.
svn-id: r3568
Diffstat (limited to 'verbs.cpp')
-rw-r--r-- | verbs.cpp | 33 |
1 files changed, 24 insertions, 9 deletions
@@ -184,15 +184,27 @@ void Scumm::drawVerbBitmap(int vrb, int x, int y) { ydiff = y - vs->topline; obim = getResourceAddress(rtVerb, vrb); - - imhd = (ImageHeader*)findResourceData(MKID('IMHD'), obim); - imgw = READ_LE_UINT16(&imhd->width) >> 3; - imgh = READ_LE_UINT16(&imhd->height) >> 3; + if (_features & GF_SMALL_HEADER) { + ObjectData *od; + int index, obj; + obj = READ_LE_UINT16(obim+6); + index = getObjectIndex(obj); + if(index==-1) + return; + od = &_objs[index]; + + imgw = od->width>>3; + imgh = od->height>>3; + imptr = obim+8; + } else { + imhd = (ImageHeader*)findResourceData(MKID('IMHD'), obim); + imgw = READ_LE_UINT16(&imhd->width) >> 3; + imgh = READ_LE_UINT16(&imhd->height) >> 3; - imptr = findResource(MKID('IM01'), obim); - if (!imptr) - error("No image for verb %d", vrb); - + imptr = findResource(MKID('IM01'), obim); + if (!imptr) + error("No image for verb %d", vrb); + } for (i=0; i<imgw; i++) { tmp = xstrip + i; if ((uint)tmp < 40) @@ -250,7 +262,10 @@ void Scumm::setVerbObject(uint room, uint object, uint verb) { error("Can't grab verb image from flobject"); findObjectInRoom(&foir, foImageHeader, object, room); - size = READ_BE_UINT32_UNALIGNED(foir.obim+4); + if(_features & GF_SMALL_HEADER) + size = READ_LE_UINT32(foir.obim); + else + size = READ_BE_UINT32_UNALIGNED(foir.obim+4); createResource(rtVerb, verb, size); obimptr = getResourceAddress(rtRoom, room) - foir.roomptr + foir.obim; memcpy(getResourceAddress(rtVerb, verb), obimptr, size); |