From 841356ac80a869b199b65e169ee3aa361d657d37 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 29 Jun 2010 11:09:33 +0000 Subject: Added loading of the correct DSR file at the start of each animation scene svn-id: r50490 --- engines/m4/animation.cpp | 10 +++++++++- engines/m4/animation.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/m4/animation.cpp b/engines/m4/animation.cpp index 192c096640..28853938ae 100644 --- a/engines/m4/animation.cpp +++ b/engines/m4/animation.cpp @@ -118,7 +118,11 @@ void MadsAnimation::initialise(const Common::String &filename, uint16 flags, M4S buffer[FILENAME_SIZE] = '\0'; _soundName = Common::String(buffer); - animStream->skip(26); + animStream->skip(13); + animStream->read(buffer, FILENAME_SIZE); + buffer[FILENAME_SIZE] = '\0'; + _dsrName = Common::String(buffer); + animStream->read(buffer, FILENAME_SIZE); buffer[FILENAME_SIZE] = '\0'; Common::String fontResource(buffer); @@ -220,6 +224,10 @@ void MadsAnimation::initialise(const Common::String &filename, uint16 flags, M4S warning("Attempted to set a font with an empty name"); } + // If a speech file is specified, then load it + if (!_dsrName.empty()) + _vm->_sound->loadDSRFile(_dsrName.c_str()); + // Load all the sprite sets for the animation for (int i = 0; i < spriteListCount; ++i) { if (_field12 && (i == _spriteListIndex)) diff --git a/engines/m4/animation.h b/engines/m4/animation.h index 135618d7e2..21fa411426 100644 --- a/engines/m4/animation.h +++ b/engines/m4/animation.h @@ -90,6 +90,7 @@ private: Common::String _lbmFilename; Common::String _spritesFilename; Common::String _soundName; + Common::String _dsrName; Common::Array _spriteListIndexes; int _currentFrame, _oldFrameEntry; -- cgit v1.2.3