diff options
author | Strangerke | 2015-05-13 08:24:48 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-05-13 14:43:50 +0200 |
commit | 187b5838533b0a182b8b44c4bfd513eeaae6aaa0 (patch) | |
tree | 044c9274e6ab35e1cac1e94788a3b6e6032749cd | |
parent | c1244623e084ab230aba3ad8cefb238f98575805 (diff) | |
download | scummvm-rg350-187b5838533b0a182b8b44c4bfd513eeaae6aaa0.tar.gz scummvm-rg350-187b5838533b0a182b8b44c4bfd513eeaae6aaa0.tar.bz2 scummvm-rg350-187b5838533b0a182b8b44c4bfd513eeaae6aaa0.zip |
SHERLOCK: Handle multiple sound containers
-rw-r--r-- | engines/sherlock/sound.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/engines/sherlock/sound.cpp b/engines/sherlock/sound.cpp index 09e55ec82b..7b8d6c69c6 100644 --- a/engines/sherlock/sound.cpp +++ b/engines/sherlock/sound.cpp @@ -45,6 +45,8 @@ Sound::Sound(SherlockEngine *vm, Audio::Mixer *mixer): _vm(vm), _mixer(mixer) { _speechOn = true; _vm->_res->addToCache("MUSIC.LIB"); + _vm->_res->addToCache("TITLE.SND"); + _vm->_res->addToCache("EPILOGUE.SND"); _vm->_res->addToCache("SND.SND"); } @@ -92,7 +94,18 @@ bool Sound::playSound(const Common::String &name, WaitType waitType, int priorit Common::String filename = name; if (!filename.contains('.')) filename += ".SND"; - Common::SeekableReadStream *stream = _vm->_res->load(filename, "TITLE.SND"); + + Common::SeekableReadStream *stream = nullptr; + + if (_vm->_res->exists(filename)) + stream = _vm->_res->load(filename, "TITLE.SND"); + else if (_vm->_res->exists(filename)) + stream = _vm->_res->load(filename, "EPILOGUE.SND"); + else if (_vm->_res->exists(filename)) + stream = _vm->_res->load(filename, "SND.SND"); + + if (!stream) + error("Unable to find sound file %s", filename.c_str()); stream->skip(2); int size = stream->readUint32BE(); |