diff options
author | Max Horn | 2002-12-31 03:26:02 +0000 |
---|---|---|
committer | Max Horn | 2002-12-31 03:26:02 +0000 |
commit | 5d4f06cf1f5b75b0ee719b41cf69443f2fd1b9a8 (patch) | |
tree | bd5f794d8bb0102b6a015afa40c876bb2435b25e /scumm/object.cpp | |
parent | 166ea5bcee36aaab30ea6b7764bdc9872fc2dcf2 (diff) | |
download | scummvm-rg350-5d4f06cf1f5b75b0ee719b41cf69443f2fd1b9a8.tar.gz scummvm-rg350-5d4f06cf1f5b75b0ee719b41cf69443f2fd1b9a8.tar.bz2 scummvm-rg350-5d4f06cf1f5b75b0ee719b41cf69443f2fd1b9a8.zip |
implemented object drawing (still somewhat broken, we get a 'green screen' effetc :-). Oh yes, this probably breaks save game compatibility for COMI. Oh yeah. As if I would care <g>
svn-id: r6285
Diffstat (limited to 'scumm/object.cpp')
-rw-r--r-- | scumm/object.cpp | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/scumm/object.cpp b/scumm/object.cpp index 43c28b0576..394a66b678 100644 --- a/scumm/object.cpp +++ b/scumm/object.cpp @@ -359,7 +359,18 @@ void Scumm::drawObject(int obj, int arg) if (_features & GF_SMALL_HEADER) ptr += 8; - else + else if (_features & GF_AFTER_V8) { + ptr = findResource(MKID('IMAG'), ptr); + if (!ptr) + return; + + ptr = findResource(MKID('WRAP'), ptr); + assert(ptr); + ptr = findResource(MKID('OFFS'), ptr); + assert(ptr); + // Get the address of the specified SMAP (corresponding to IMxx) + ptr += READ_LE_UINT32(ptr + 4 + 4*getState(od->obj_nr)); + } else ptr = findResource(IMxx_tags[getState(od->obj_nr)], ptr); if (!ptr) return; @@ -1273,7 +1284,7 @@ void Scumm::drawBlastObjects() void Scumm::drawBlastObject(BlastObject *eo) { VirtScreen *vs; - byte *bomp, *ptr, *img; + byte *bomp, *ptr; int idx; BompDrawData bdd; @@ -1299,18 +1310,16 @@ void Scumm::drawBlastObject(BlastObject *eo) // an OFFS chunk and multiple BOMP chunks. To find the right BOMP, we can // either use the offsets in the OFFS chunk, or iterate over all BOMPs we find. // Here we use the first method. - img = findResource(MKID('IMAG'), ptr); - assert(img); - - img = findResource(MKID('WRAP'), img); - assert(img); - - img = findResource(MKID('OFFS'), img); - assert(img); - - bomp = img + READ_LE_UINT32(img + 4 + 4*eo->image) + 8; + ptr = findResource(MKID('IMAG'), ptr); + assert(ptr); + ptr = findResource(MKID('WRAP'), ptr); + assert(ptr); + ptr = findResource(MKID('OFFS'), ptr); + assert(ptr); + // Get the address of the specified BOMP (we really should verify it's a BOMP and not a SMAP + bomp = ptr + READ_LE_UINT32(ptr + 4 + 4*eo->image) + 8; } else { - img = findResource(IMxx_tags[eo->image], ptr); + byte *img = findResource(IMxx_tags[eo->image], ptr); if (!img) img = findResource(IMxx_tags[1], ptr); // Backward compatibility with samnmax blast objects |