From 029b99691a34c59feabefca83c3e979a63ca8a7e Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 3 May 2003 11:42:25 +0000 Subject: hack that avoids buglet where music doesn't stop in MonkeyVGA/EGA svn-id: r7280 --- scumm/sound.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scumm/sound.cpp b/scumm/sound.cpp index a34b9d83b9..1f0abc11c5 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -423,6 +423,21 @@ void Sound::playSound(int soundID) { if (_scumm->_features & GF_OLD_BUNDLE) return; // FIXME + if (_scumm->_gameId == GID_MONKEY_VGA || _scumm->_gameId == GID_MONKEY_EGA) { + // FIXME: This evil hack works around the fact that in some + // places in MonkeyVGA, the music is never explicitly stopped. + // Rather it seems that starting a new music is supposed to + // automatically stop the old song. + // This hack relays on the fact that we currently don't support SFX + // in these games, only music. Once we add SFX support, we'll have to + // revise it / replace it by a proper fix. + static int lastSound = -1; + if (lastSound > 0 && ptr) { + stopSound(lastSound); + lastSound = soundID; + } + } + if (_scumm->_imuse) { _scumm->getResourceAddress(rtSound, soundID); _scumm->_imuse->startSound(soundID); -- cgit v1.2.3