aboutsummaryrefslogtreecommitdiff
path: root/engines/m4/animation.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2010-06-17 12:13:27 +0000
committerFilippos Karapetis2010-06-17 12:13:27 +0000
commitcf86b447939a3baea5aa3bd53450f8f56f436740 (patch)
treee97082837eaa4e9b8dd08ff1739c076a537c31db /engines/m4/animation.cpp
parent423029c027c2013c4d23062b2ce81a807d6c74ec (diff)
downloadscummvm-rg350-cf86b447939a3baea5aa3bd53450f8f56f436740.tar.gz
scummvm-rg350-cf86b447939a3baea5aa3bd53450f8f56f436740.tar.bz2
scummvm-rg350-cf86b447939a3baea5aa3bd53450f8f56f436740.zip
M4/MADS: Some slight tweaks to the animation message chunks
svn-id: r49927
Diffstat (limited to 'engines/m4/animation.cpp')
-rw-r--r--engines/m4/animation.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/engines/m4/animation.cpp b/engines/m4/animation.cpp
index c39a1f0cd2..6b32bdca17 100644
--- a/engines/m4/animation.cpp
+++ b/engines/m4/animation.cpp
@@ -132,9 +132,9 @@ 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);
- rec.pos.x = animStream->readUint16LE();
- rec.pos.y = animStream->readUint16LE();
+ animStream->readUint16LE();
animStream->readUint16LE();
rec.rgb1.r = animStream->readByte();
rec.rgb1.g = animStream->readByte();
@@ -142,11 +142,13 @@ void MadsAnimation::initialise(const Common::String &filename, uint16 flags, M4S
rec.rgb2.r = animStream->readByte();
rec.rgb2.g = animStream->readByte();
rec.rgb2.b = animStream->readByte();
+ animStream->readUint16LE();
+ animStream->readUint16LE();
rec.kernelMsgIndex = animStream->readUint16LE();
- animStream->skip(6);
+ rec.pos.x = animStream->readUint16LE();
+ rec.pos.y = animStream->readUint16LE();
rec.startFrame = animStream->readUint16LE();
rec.endFrame = animStream->readUint16LE();
- animStream->readUint16LE();
_messages.push_back(rec);
}
@@ -201,7 +203,10 @@ void MadsAnimation::initialise(const Common::String &filename, uint16 flags, M4S
fontName += "*";
fontName += fontResource;
- _font = _vm->_font->getFont(fontName);
+ if (fontName != "")
+ _font = _vm->_font->getFont(fontName);
+ else
+ warning("Attempted to set a font with an empty name");
}
// Load all the sprite sets for the animation
@@ -421,6 +426,9 @@ void MadsAnimation::update() {
// Add a kernel message to display the given text
me.kernelMsgIndex = _view->_kernelMessages.add(me.pos, colIndex * 101, 0, 0, INDEFINITE_TIMEOUT, me.msg);
+ // Play the associated sound, if it exists
+ if (me.soundId >= 0)
+ _vm->_sound->playDSRSound(me.soundId, 255, false);
++_messageCtr;
}
}