From f919b26875033c41186b840b97752c72cab68f7f Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 26 Mar 2008 21:39:44 +0000 Subject: - fixed multiple voices playing at once (see bug #1926547 "HoF: Right mouse button messes up gameplay"). - fixed crash while uninitializing AdLib driver svn-id: r31252 --- engines/kyra/kyra_v2.cpp | 3 +++ engines/kyra/sound_adlib.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp index 2052c34002..42209d34c3 100644 --- a/engines/kyra/kyra_v2.cpp +++ b/engines/kyra/kyra_v2.cpp @@ -1734,10 +1734,13 @@ void KyraEngine_v2::snd_playVoiceFile(int id) { assert(id >= 0 && id <= 9999999); sprintf(vocFile, "%07d", id); if (_sound->voiceFileIsPresent(vocFile)) { + snd_stopVoice(); + while (!_sound->voicePlay(vocFile)) { updateWithText(); _system->delayMillis(10); } + _speechFile = vocFile; } } diff --git a/engines/kyra/sound_adlib.cpp b/engines/kyra/sound_adlib.cpp index 2f90017ccb..df37c75426 100644 --- a/engines/kyra/sound_adlib.cpp +++ b/engines/kyra/sound_adlib.cpp @@ -2229,8 +2229,8 @@ SoundAdlibPC::SoundAdlibPC(KyraEngine *vm, Audio::Mixer *mixer) } SoundAdlibPC::~SoundAdlibPC() { - delete [] _soundDataPtr; delete _driver; + delete [] _soundDataPtr; } bool SoundAdlibPC::init() { -- cgit v1.2.3