From ecd3e29fe0854c632e5a7688b171e24561c70fc2 Mon Sep 17 00:00:00 2001 From: Sylvain Dupont Date: Fri, 29 Oct 2010 22:00:31 +0000 Subject: 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 --- engines/toon/audio.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'engines/toon/audio.cpp') 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()"); -- cgit v1.2.3