From a169619526c811f1718bbeb5ed980f68b9d2c8e7 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Fri, 21 Mar 2008 16:18:27 +0000 Subject: - Implemented opcode 97: o2_isAnySoundPlaying - reworked sound channel handling in HoF => fixed some voice related bugs svn-id: r31209 --- engines/kyra/kyra_v2.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'engines/kyra/kyra_v2.cpp') diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp index 4b242b0f32..927b7e5c3e 100644 --- a/engines/kyra/kyra_v2.cpp +++ b/engines/kyra/kyra_v2.cpp @@ -1708,6 +1708,7 @@ void KyraEngine_v2::restoreGfxRect32x32(int x, int y) { #pragma mark - void KyraEngine_v2::openTalkFile(int newFile) { + debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v2::openTalkFile(%d)", newFile); char talkFilename[16]; if (_oldTalkFile > 0) { @@ -1732,10 +1733,17 @@ void KyraEngine_v2::snd_playVoiceFile(int id) { char vocFile[9]; assert(id >= 0 && id <= 9999999); sprintf(vocFile, "%07d", id); - _sound->voicePlay(vocFile); + if (_sound->voiceFileIsPresent(vocFile)) { + while (!_sound->voicePlay(vocFile)) { + updateWithText(); + _system->delayMillis(10); + } + _speechFile = vocFile; + } } void KyraEngine_v2::snd_loadSoundFile(int id) { + debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v2::snd_loadSoundFile(%d)", id); if (id < 0 || !_trackMap) return; @@ -1746,6 +1754,7 @@ void KyraEngine_v2::snd_loadSoundFile(int id) { } void KyraEngine_v2::playVoice(int high, int low) { + debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v2::playVoice(%d, %d)", high, low); if (!_flags.isTalkie) return; int vocFile = high * 10000 + low * 10; -- cgit v1.2.3