diff options
author | Robert Špalek | 2009-11-28 00:07:22 +0000 |
---|---|---|
committer | Robert Špalek | 2009-11-28 00:07:22 +0000 |
commit | 87c26fe54b5f17e610a95c8fec9f10e0f1bef316 (patch) | |
tree | 6b61b6858890e7120c2a319ee092ee0bcb0b337d /engines/draci/sound.cpp | |
parent | 447711b597f2fc410b0efdbb9d09a4713930dcdc (diff) | |
download | scummvm-rg350-87c26fe54b5f17e610a95c8fec9f10e0f1bef316.tar.gz scummvm-rg350-87c26fe54b5f17e610a95c8fec9f10e0f1bef316.tar.bz2 scummvm-rg350-87c26fe54b5f17e610a95c8fec9f10e0f1bef316.zip |
Fixed bug with exhausting sound handles
It was caused by forever re-starting the same sample when the animation was
stopped and the same frame got displayed over and over, each time triggering
playing the same sample.
svn-id: r46168
Diffstat (limited to 'engines/draci/sound.cpp')
-rw-r--r-- | engines/draci/sound.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/engines/draci/sound.cpp b/engines/draci/sound.cpp index a8b9246b09..d12fccd27e 100644 --- a/engines/draci/sound.cpp +++ b/engines/draci/sound.cpp @@ -180,8 +180,10 @@ SndHandle *Sound::getHandle() { } for (int i = 0; i < SOUND_HANDLES; i++) { - if (_handles[i].type == kFreeHandle) + if (_handles[i].type == kFreeHandle) { + debugC(5, kDraciSoundDebugLevel, "Allocated handle %d", i); return &_handles[i]; + } } error("Sound::getHandle(): Too many sound handles"); @@ -230,6 +232,7 @@ void Sound::stopSound() { for (int i = 0; i < SOUND_HANDLES; i++) if (_handles[i].type == kEffectHandle) { _mixer->stopHandle(_handles[i].handle); + debugC(5, kDraciSoundDebugLevel, "Stopping effect handle %d", i); _handles[i].type = kFreeHandle; } } @@ -259,6 +262,7 @@ void Sound::stopVoice() { for (int i = 0; i < SOUND_HANDLES; i++) if (_handles[i].type == kVoiceHandle) { _mixer->stopHandle(_handles[i].handle); + debugC(5, kDraciSoundDebugLevel, "Stopping voice handle %d", i); _handles[i].type = kFreeHandle; } } |