diff options
author | Bastien Bouclet | 2011-05-14 19:53:41 +0200 |
---|---|---|
committer | Bastien Bouclet | 2011-05-14 19:54:34 +0200 |
commit | efac5c42d7d6ec91440e7c03e8205ce474e5437d (patch) | |
tree | bd3b7d24ac44a74f97bdc5b3c722b47cce0dca1f /engines/mohawk | |
parent | c7f3a4f578b86b54572500322cc55cf0893634c9 (diff) | |
download | scummvm-rg350-efac5c42d7d6ec91440e7c03e8205ce474e5437d.tar.gz scummvm-rg350-efac5c42d7d6ec91440e7c03e8205ce474e5437d.tar.bz2 scummvm-rg350-efac5c42d7d6ec91440e7c03e8205ce474e5437d.zip |
MOHAWK: Fix background music restarting when changing cards in original Myst
Diffstat (limited to 'engines/mohawk')
-rw-r--r-- | engines/mohawk/sound.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/engines/mohawk/sound.cpp b/engines/mohawk/sound.cpp index 2428f1bdb0..6144c89e21 100644 --- a/engines/mohawk/sound.cpp +++ b/engines/mohawk/sound.cpp @@ -616,9 +616,16 @@ Audio::SoundHandle *Sound::replaceBackgroundMyst(uint16 id, uint16 volume) { Common::String name = _vm->getResourceName(ID_MSND, convertMystID(id)); + // Only the first eight characters need to be the same to have a match + Common::String prefix; + if (name.size() >= 8) + prefix = Common::String(name.c_str(), name.c_str() + 8); + else + prefix = name; + // Check if sound is already playing if (_mystBackgroundSound.type == kUsedHandle && _vm->_mixer->isSoundHandleActive(_mystBackgroundSound.handle) - && name.equals(_vm->getResourceName(ID_MSND, convertMystID(_mystBackgroundSound.id)))) + && _vm->getResourceName(ID_MSND, convertMystID(_mystBackgroundSound.id)).hasPrefix(prefix)) return &_mystBackgroundSound.handle; // Stop old background sound |