diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/lure/hotspots.cpp | 10 | ||||
-rw-r--r-- | engines/lure/luredefs.h | 3 |
2 files changed, 12 insertions, 1 deletions
diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp index 0721df22b7..01da3ab674 100644 --- a/engines/lure/hotspots.cpp +++ b/engines/lure/hotspots.cpp @@ -171,7 +171,15 @@ void Hotspot::setAnimation(HotspotAnimData *newRecord) { MemoryBlock &mDest = _frames->data(); for (uint16 frameCtr = 0; frameCtr < _numFrames; ++frameCtr, ++headerEntry) { - + + if ((newRecord->flags & PIXELFLAG_HAS_TABLE) != 0) { + // For animations with an offset table, set the source point for each frame + uint16 frameOffset = *((uint16 *) (src->data() + ((frameCtr + 1) * sizeof(uint16)))) + 0x40; + if (frameOffset + _height * (_width / 2) > dest->size()) + error("Invalid frame offset in animation %x", newRecord->animRecordId); + pSrc = dest->data() + frameOffset; + } + // Copy over the frame, applying the colour offset to each nibble for (uint16 yPos = 0; yPos < _height; ++yPos) { pDest = mDest.data() + (yPos * _numFrames + frameCtr) * _width; diff --git a/engines/lure/luredefs.h b/engines/lure/luredefs.h index d259502811..242299bea9 100644 --- a/engines/lure/luredefs.h +++ b/engines/lure/luredefs.h @@ -202,6 +202,9 @@ enum Action { // Misc constants #define VOICE_ANIM_ID 0x5810 +// Pixel record flags +#define PIXELFLAG_HAS_TABLE 4 + } // End of namespace Lure #endif |