[Scummvm-cvs-logs] SF.net SVN: scummvm:[33742] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sun Aug 10 03:28:02 CEST 2008


Revision: 33742
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33742&view=rev
Author:   lordhoto
Date:     2008-08-10 01:28:00 +0000 (Sun, 10 Aug 2008)

Log Message:
-----------
Added fallback to text only mode when voice files are not found.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/kyra_hof.cpp
    scummvm/trunk/engines/kyra/kyra_mr.cpp

Modified: scummvm/trunk/engines/kyra/kyra_hof.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_hof.cpp	2008-08-10 01:20:23 UTC (rev 33741)
+++ scummvm/trunk/engines/kyra/kyra_hof.cpp	2008-08-10 01:28:00 UTC (rev 33742)
@@ -1510,15 +1510,19 @@
 		_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 @@
 	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) {

Modified: scummvm/trunk/engines/kyra/kyra_mr.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_mr.cpp	2008-08-10 01:20:23 UTC (rev 33741)
+++ scummvm/trunk/engines/kyra/kyra_mr.cpp	2008-08-10 01:28:00 UTC (rev 33742)
@@ -508,7 +508,8 @@
 	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 @@
 	}
 
 	_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 -


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list