diff options
author | Johannes Schickel | 2008-08-10 01:28:00 +0000 |
---|---|---|
committer | Johannes Schickel | 2008-08-10 01:28:00 +0000 |
commit | f8355abdee1a85dd3cf387a7fcc74b18b43d2597 (patch) | |
tree | 7bbe5efe29db8c711f032628d099ee0882c86f8e | |
parent | 980b3f8af1318d5b42eb4e5f3c1d0748f46c1a0d (diff) | |
download | scummvm-rg350-f8355abdee1a85dd3cf387a7fcc74b18b43d2597.tar.gz scummvm-rg350-f8355abdee1a85dd3cf387a7fcc74b18b43d2597.tar.bz2 scummvm-rg350-f8355abdee1a85dd3cf387a7fcc74b18b43d2597.zip |
Added fallback to text only mode when voice files are not found.
svn-id: r33742
-rw-r--r-- | engines/kyra/kyra_hof.cpp | 17 | ||||
-rw-r--r-- | engines/kyra/kyra_mr.cpp | 10 |
2 files changed, 19 insertions, 8 deletions
diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp index b642248665..33a8af91f1 100644 --- a/engines/kyra/kyra_hof.cpp +++ b/engines/kyra/kyra_hof.cpp @@ -1510,15 +1510,19 @@ void KyraEngine_HoF::openTalkFile(int newFile) { _oldTalkFile = -1; } - if (newFile == 0) { + if (newFile == 0) strcpy(talkFilename, "ANYTALK.TLK"); - _res->loadPakFile(talkFilename); - } else { + else sprintf(talkFilename, "CH%dVOC.TLK", newFile); - _res->loadPakFile(talkFilename); - } _oldTalkFile = newFile; + + if (!_res->loadPakFile(talkFilename)) { + if (speechEnabled()) { + warning("Couldn't load file '%s' falling back to text only mode", talkFilename); + _configVoice = 0; + } + } } void KyraEngine_HoF::snd_playVoiceFile(int id) { @@ -1554,7 +1558,8 @@ void KyraEngine_HoF::playVoice(int high, int low) { if (!_flags.isTalkie) return; int vocFile = high * 10000 + low * 10; - snd_playVoiceFile(vocFile); + if (speechEnabled()) + snd_playVoiceFile(vocFile); } void KyraEngine_HoF::snd_playSoundEffect(int track, int volume) { diff --git a/engines/kyra/kyra_mr.cpp b/engines/kyra/kyra_mr.cpp index a4e5b58364..a61253199b 100644 --- a/engines/kyra/kyra_mr.cpp +++ b/engines/kyra/kyra_mr.cpp @@ -508,7 +508,8 @@ void KyraEngine_MR::snd_playVoiceFile(int file) { char filename[16]; snprintf(filename, 16, "%.08u", (uint)file); - _voiceSoundChannel = _soundDigital->playSound(filename, 0xFE, Audio::Mixer::kSpeechSoundType, 255); + if (speechEnabled()) + _voiceSoundChannel = _soundDigital->playSound(filename, 0xFE, Audio::Mixer::kSpeechSoundType, 255); } bool KyraEngine_MR::snd_voiceIsPlaying() { @@ -802,7 +803,12 @@ void KyraEngine_MR::openTalkFile(int file) { } _currentTalkFile = file; - _res->loadPakFile(talkFilename); + if (!_res->loadPakFile(talkFilename)) { + if (speechEnabled()) { + warning("Couldn't load file '%s' falling back to text only mode", talkFilename); + _configVoice = 0; + } + } } #pragma mark - |