diff options
author | Filippos Karapetis | 2010-06-17 12:13:27 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-06-17 12:13:27 +0000 |
commit | cf86b447939a3baea5aa3bd53450f8f56f436740 (patch) | |
tree | e97082837eaa4e9b8dd08ff1739c076a537c31db /engines | |
parent | 423029c027c2013c4d23062b2ce81a807d6c74ec (diff) | |
download | scummvm-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')
-rw-r--r-- | engines/m4/animation.cpp | 18 | ||||
-rw-r--r-- | engines/m4/animation.h | 1 |
2 files changed, 14 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; } } diff --git a/engines/m4/animation.h b/engines/m4/animation.h index cffcf9f689..89c3cbbfaf 100644 --- a/engines/m4/animation.h +++ b/engines/m4/animation.h @@ -39,6 +39,7 @@ class SpriteSlotSubset; class AnimMessage { public: + int16 soundId; char msg[70]; Common::Point pos; RGB8 rgb1, rgb2; |