From 691306f0b7e86e845fe3049316a657dd83a21865 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 27 May 2008 21:04:27 +0000 Subject: Fixed KyraEngine_v1::snd_stopVoice and KyraEngine_v1::snd_voiceIsPlaying implementations. svn-id: r32330 --- engines/kyra/script_hof.cpp | 2 +- engines/kyra/sound.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'engines') diff --git a/engines/kyra/script_hof.cpp b/engines/kyra/script_hof.cpp index ef50cc8dfd..91fbfb3e49 100644 --- a/engines/kyra/script_hof.cpp +++ b/engines/kyra/script_hof.cpp @@ -760,7 +760,7 @@ int KyraEngine_HoF::o2_showItemString(EMCState *script) { int KyraEngine_HoF::o2_isAnySoundPlaying(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_isAnySoundPlaying(%p) ()", (const void *)script); - return _sound->voiceIsPlaying(); + return _sound->voiceIsPlaying() ? 1 : 0; } int KyraEngine_HoF::o2_setDrawNoShapeFlag(EMCState *script) { diff --git a/engines/kyra/sound.cpp b/engines/kyra/sound.cpp index f8e2e1f1e0..8f9077705e 100644 --- a/engines/kyra/sound.cpp +++ b/engines/kyra/sound.cpp @@ -538,12 +538,15 @@ void KyraEngine_v1::snd_playWanderScoreViaMap(int command, int restart) { void KyraEngine_v1::snd_stopVoice() { debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v1::snd_stopVoice()"); - _sound->voiceStop(_speechFile.empty() ? 0 : _speechFile.c_str()); + if (!_speechFile.empty()) { + _sound->voiceStop(_speechFile.c_str()); + _speechFile.clear(); + } } bool KyraEngine_v1::snd_voiceIsPlaying() { debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v1::snd_voiceIsPlaying()"); - return _sound->voiceIsPlaying(_speechFile.empty() ? 0 : _speechFile.c_str()); + return _speechFile.empty() ? false : _sound->voiceIsPlaying(_speechFile.c_str()); } // static res -- cgit v1.2.3