aboutsummaryrefslogtreecommitdiff
path: root/engines/m4/animation.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2010-06-27 05:18:21 +0000
committerPaul Gilbert2010-06-27 05:18:21 +0000
commit965cdb6fbf1d7db6ca839a9cb75be1821975d8b7 (patch)
tree9ead3fc15e1d37fed927db37a5693bdb4d8ca6cb /engines/m4/animation.cpp
parentc922af06c2d209de13349d9938388242238fc744 (diff)
downloadscummvm-rg350-965cdb6fbf1d7db6ca839a9cb75be1821975d8b7.tar.gz
scummvm-rg350-965cdb6fbf1d7db6ca839a9cb75be1821975d8b7.tar.bz2
scummvm-rg350-965cdb6fbf1d7db6ca839a9cb75be1821975d8b7.zip
Several bugfixes to the loading, display, and digital sound playing of messages during cutscenes
svn-id: r50366
Diffstat (limited to 'engines/m4/animation.cpp')
-rw-r--r--engines/m4/animation.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/engines/m4/animation.cpp b/engines/m4/animation.cpp
index 6b32bdca17..fae21db072 100644
--- a/engines/m4/animation.cpp
+++ b/engines/m4/animation.cpp
@@ -132,23 +132,24 @@ void MadsAnimation::initialise(const Common::String &filename, uint16 flags, M4S
for (int i = 0; i < messagesCount; ++i) {
AnimMessage rec;
- rec.soundId = animStream->readUint16LE();
- animStream->read(rec.msg, 70);
- animStream->readUint16LE();
- animStream->readUint16LE();
+ rec.soundId = animStream->readSint16LE();
+ animStream->read(rec.msg, 64);
+ animStream->skip(4);
+ rec.pos.x = animStream->readSint16LE();
+ rec.pos.y = animStream->readSint16LE();
+ rec.flags = animStream->readUint16LE();
rec.rgb1.r = animStream->readByte();
rec.rgb1.g = animStream->readByte();
rec.rgb1.b = animStream->readByte();
rec.rgb2.r = animStream->readByte();
rec.rgb2.g = animStream->readByte();
rec.rgb2.b = animStream->readByte();
- animStream->readUint16LE();
- animStream->readUint16LE();
- rec.kernelMsgIndex = animStream->readUint16LE();
- rec.pos.x = animStream->readUint16LE();
- rec.pos.y = animStream->readUint16LE();
+ animStream->skip(2); // Space for kernelMsgIndex
+ rec.kernelMsgIndex = -1;
+ animStream->skip(6);
rec.startFrame = animStream->readUint16LE();
rec.endFrame = animStream->readUint16LE();
+ animStream->skip(2);
_messages.push_back(rec);
}
@@ -166,8 +167,8 @@ void MadsAnimation::initialise(const Common::String &filename, uint16 flags, M4S
rec.seqIndex = animStream->readByte();
rec.spriteSlot.spriteListIndex = animStream->readByte();
rec.spriteSlot.frameNumber = animStream->readUint16LE();
- rec.spriteSlot.xp = animStream->readUint16LE();
- rec.spriteSlot.yp = animStream->readUint16LE();
+ rec.spriteSlot.xp = animStream->readSint16LE();
+ rec.spriteSlot.yp = animStream->readSint16LE();
rec.spriteSlot.depth = animStream->readByte();
rec.spriteSlot.scale = (int8)animStream->readByte();
@@ -425,10 +426,12 @@ void MadsAnimation::update() {
_vm->_palette->setEntry(colIndex + 1, me.rgb2.r, me.rgb2.g, me.rgb2.b);
// Add a kernel message to display the given text
- me.kernelMsgIndex = _view->_kernelMessages.add(me.pos, colIndex * 101, 0, 0, INDEFINITE_TIMEOUT, me.msg);
+ me.kernelMsgIndex = _view->_kernelMessages.add(me.pos, colIndex * 0x101, 0, 0, INDEFINITE_TIMEOUT, me.msg);
+ assert(me.kernelMsgIndex >= 0);
+
// Play the associated sound, if it exists
- if (me.soundId >= 0)
- _vm->_sound->playDSRSound(me.soundId, 255, false);
+ if (me.soundId > 0)
+ _vm->_sound->playDSRSound(me.soundId - 1, 255, false);
++_messageCtr;
}
}