aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2008-05-27 21:04:27 +0000
committerJohannes Schickel2008-05-27 21:04:27 +0000
commit691306f0b7e86e845fe3049316a657dd83a21865 (patch)
treea16ea23c3f0cdea8458eb9ef8aa6021d24d40c4e
parentc0f1b7fe66372d52da2265d001049fd966f8dac7 (diff)
downloadscummvm-rg350-691306f0b7e86e845fe3049316a657dd83a21865.tar.gz
scummvm-rg350-691306f0b7e86e845fe3049316a657dd83a21865.tar.bz2
scummvm-rg350-691306f0b7e86e845fe3049316a657dd83a21865.zip
Fixed KyraEngine_v1::snd_stopVoice and KyraEngine_v1::snd_voiceIsPlaying implementations.
svn-id: r32330
-rw-r--r--engines/kyra/script_hof.cpp2
-rw-r--r--engines/kyra/sound.cpp7
2 files changed, 6 insertions, 3 deletions
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