aboutsummaryrefslogtreecommitdiff
path: root/engines/toon/audio.cpp
diff options
context:
space:
mode:
authorSylvain Dupont2010-10-29 22:00:31 +0000
committerSylvain Dupont2010-10-29 22:00:31 +0000
commitecd3e29fe0854c632e5a7688b171e24561c70fc2 (patch)
tree6599b8cf395eae74566213c90e658f7f989ed802 /engines/toon/audio.cpp
parentc9442e26ad70fa18dbcee3814ca586e2bc45bdf8 (diff)
downloadscummvm-rg350-ecd3e29fe0854c632e5a7688b171e24561c70fc2.tar.gz
scummvm-rg350-ecd3e29fe0854c632e5a7688b171e24561c70fc2.tar.bz2
scummvm-rg350-ecd3e29fe0854c632e5a7688b171e24561c70fc2.zip
TOON: Stops all Sfx/voice when exiting a room
Caused crashs when exiting when a sfx or voice was still playing Bug found by Thomas svn-id: r53928
Diffstat (limited to 'engines/toon/audio.cpp')
-rw-r--r--engines/toon/audio.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/engines/toon/audio.cpp b/engines/toon/audio.cpp
index c3ab2b2fd6..4381dad6f7 100644
--- a/engines/toon/audio.cpp
+++ b/engines/toon/audio.cpp
@@ -191,6 +191,14 @@ int32 AudioManager::playSFX(int32 id, int volume , bool genericSFX) {
return -1;
}
+void AudioManager::stopAllSfxs() {
+ for (int32 i = 3; i < 16; i++) {
+ if (_channels[i] && _channels[i]->isPlaying()) {
+ _channels[i]->stop(false);
+ }
+ }
+}
+
void AudioManager::stopCurrentVoice() {
debugC(1, kDebugAudio, "stopCurrentVoice()");