aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2006-01-11 04:28:31 +0000
committerTravis Howell2006-01-11 04:28:31 +0000
commit67d1cc0cf957d22cb5c6f8b2bf8de4ac02e25f67 (patch)
tree0221426b4f8f25528814dd235aa3f98ffcd6751b
parent7a7eeaa79f1cc659dcdbe8ad15c44ebe558560b1 (diff)
downloadscummvm-rg350-67d1cc0cf957d22cb5c6f8b2bf8de4ac02e25f67.tar.gz
scummvm-rg350-67d1cc0cf957d22cb5c6f8b2bf8de4ac02e25f67.tar.bz2
scummvm-rg350-67d1cc0cf957d22cb5c6f8b2bf8de4ac02e25f67.zip
Cleanup FF sound.
svn-id: r19981
-rw-r--r--simon/sound.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/simon/sound.cpp b/simon/sound.cpp
index 000b46d0e4..f7db22de4b 100644
--- a/simon/sound.cpp
+++ b/simon/sound.cpp
@@ -462,8 +462,13 @@ void Sound::playSoundData(byte *soundData, uint sound, uint pan, uint vol, bool
byte flags;
int rate;
- if (ambient) {
- if (_ambientPaused || sound == _ambientPlaying)
+ if (ambient == true) {
+ if (sound == _ambientPlaying)
+ return;
+
+ _ambientPlaying = sound;
+
+ if (_ambientPaused)
return;
} else {
if (_effectsPaused)
@@ -480,10 +485,11 @@ void Sound::playSoundData(byte *soundData, uint sound, uint pan, uint vol, bool
byte *buffer = (byte *)malloc(size);
memcpy(buffer, soundData + stream.pos(), size);
- if (ambient && sound == _ambientPlaying) {
- _mixer->playRaw(&_effectsHandle, buffer, size, rate, flags);
- } else {
+ if (ambient == true) {
+ _mixer->stopHandle(_ambientHandle);
_mixer->playRaw(&_ambientHandle, buffer, size, rate, Audio::Mixer::FLAG_LOOP|flags);
+ } else {
+ _mixer->playRaw(&_effectsHandle, buffer, size, rate, flags);
}
}