From 117dee5e4a024d41edf1e21b74c0017f78341424 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Sun, 3 Aug 2008 10:16:17 +0000 Subject: Fixed bug #1995033 ("BASS: BG Sound stopped on opening item list"). Apparently the sound is supposed to be paused and then unpaused, but the pause function is called many more times than the unpause function. In the original, this presumably didn't matter. In ScummVM's mixer, it does. svn-id: r33570 --- engines/sky/sound.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'engines/sky/sound.cpp') diff --git a/engines/sky/sound.cpp b/engines/sky/sound.cpp index 928221a9a5..f15038c0b6 100644 --- a/engines/sky/sound.cpp +++ b/engines/sky/sound.cpp @@ -1025,6 +1025,7 @@ Sound::Sound(Audio::Mixer *mixer, Disk *pDisk, uint8 pVolume) { _mixer = mixer; _saveSounds[0] = _saveSounds[1] = 0xFFFF; _mainSfxVolume = pVolume; + _isPaused = false; } Sound::~Sound(void) { @@ -1254,14 +1255,20 @@ bool Sound::startSpeech(uint16 textNum) { void Sound::fnPauseFx(void) { - _mixer->pauseID(SOUND_CH0, true); - _mixer->pauseID(SOUND_CH1, true); + if (!_isPaused) { + _isPaused = true; + _mixer->pauseID(SOUND_CH0, true); + _mixer->pauseID(SOUND_CH1, true); + } } void Sound::fnUnPauseFx(void) { - _mixer->pauseID(SOUND_CH0, false); - _mixer->pauseID(SOUND_CH1, false); + if (_isPaused) { + _isPaused = false; + _mixer->pauseID(SOUND_CH0, false); + _mixer->pauseID(SOUND_CH1, false); + } } } // End of namespace Sky -- cgit v1.2.3