[Scummvm-cvs-logs] SF.net SVN: scummvm:[33752] scummvm/branches/branch-0-12-0/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sun Aug 10 12:11:49 CEST 2008


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

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

Modified Paths:
--------------
    scummvm/branches/branch-0-12-0/engines/kyra/kyra_hof.cpp
    scummvm/branches/branch-0-12-0/engines/kyra/kyra_mr.cpp

Modified: scummvm/branches/branch-0-12-0/engines/kyra/kyra_hof.cpp
===================================================================
--- scummvm/branches/branch-0-12-0/engines/kyra/kyra_hof.cpp	2008-08-10 09:53:42 UTC (rev 33751)
+++ scummvm/branches/branch-0-12-0/engines/kyra/kyra_hof.cpp	2008-08-10 10:11:47 UTC (rev 33752)
@@ -1507,15 +1507,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) {
@@ -1551,7 +1555,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/branches/branch-0-12-0/engines/kyra/kyra_mr.cpp
===================================================================
--- scummvm/branches/branch-0-12-0/engines/kyra/kyra_mr.cpp	2008-08-10 09:53:42 UTC (rev 33751)
+++ scummvm/branches/branch-0-12-0/engines/kyra/kyra_mr.cpp	2008-08-10 10:11:47 UTC (rev 33752)
@@ -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