aboutsummaryrefslogtreecommitdiff
path: root/engines/lure
diff options
context:
space:
mode:
authorPaul Gilbert2006-03-13 11:20:58 +0000
committerPaul Gilbert2006-03-13 11:20:58 +0000
commit3c303c0dfda28d149b8b142fd758a19dc354b226 (patch)
tree81b87390af1273312a598187f037d8beac4b099c /engines/lure
parent92eb7b7aa5bbe6f2554b1cf24c11092681f69cc0 (diff)
downloadscummvm-rg350-3c303c0dfda28d149b8b142fd758a19dc354b226.tar.gz
scummvm-rg350-3c303c0dfda28d149b8b142fd758a19dc354b226.tar.bz2
scummvm-rg350-3c303c0dfda28d149b8b142fd758a19dc354b226.zip
Add proper handling for animations with frame offset tables during decoding
svn-id: r21255
Diffstat (limited to 'engines/lure')
-rw-r--r--engines/lure/hotspots.cpp10
-rw-r--r--engines/lure/luredefs.h3
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