aboutsummaryrefslogtreecommitdiff
path: root/engines/sky
diff options
context:
space:
mode:
authorTorbjörn Andersson2008-08-03 10:16:17 +0000
committerTorbjörn Andersson2008-08-03 10:16:17 +0000
commit117dee5e4a024d41edf1e21b74c0017f78341424 (patch)
tree387137c6a8d922dead5e6e97847a5d85ef62de01 /engines/sky
parente8cee7823d5c2087c4a6bfde04c350d16c56774d (diff)
downloadscummvm-rg350-117dee5e4a024d41edf1e21b74c0017f78341424.tar.gz
scummvm-rg350-117dee5e4a024d41edf1e21b74c0017f78341424.tar.bz2
scummvm-rg350-117dee5e4a024d41edf1e21b74c0017f78341424.zip
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
Diffstat (limited to 'engines/sky')
-rw-r--r--engines/sky/sound.cpp15
-rw-r--r--engines/sky/sound.h2
2 files changed, 13 insertions, 4 deletions
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
diff --git a/engines/sky/sound.h b/engines/sky/sound.h
index 28e2e8c88a..0ad509700e 100644
--- a/engines/sky/sound.h
+++ b/engines/sky/sound.h
@@ -89,6 +89,8 @@ private:
uint8 *_sampleRates, *_sfxInfo;
uint8 _mainSfxVolume;
+ bool _isPaused;
+
static uint16 _speechConvertTable[8];
static SfxQueue _sfxQueue[MAX_QUEUED_FX];
};