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

athrxx at users.sourceforge.net athrxx at users.sourceforge.net
Thu Feb 14 20:59:51 CET 2008


Revision: 30865
          http://scummvm.svn.sourceforge.net/scummvm/?rev=30865&view=rev
Author:   athrxx
Date:     2008-02-14 11:59:51 -0800 (Thu, 14 Feb 2008)

Log Message:
-----------
patch [ 1891542 ] KYRA: text/speech options support for HoF sequence player

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/sequences_v2.cpp

Modified: scummvm/trunk/engines/kyra/sequences_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sequences_v2.cpp	2008-02-14 12:32:01 UTC (rev 30864)
+++ scummvm/trunk/engines/kyra/sequences_v2.cpp	2008-02-14 19:59:51 UTC (rev 30865)
@@ -1964,7 +1964,7 @@
 
 	assert(chatNum < _sequenceSoundListSize);
 
-	if (chatNum < 12 && !_flags.isDemo)
+	if (chatNum < 12 && !_flags.isDemo && textEnabled())
 		seq_setTextEntry(chatNum, 160, 168, _sequenceStringsDuration[chatNum], 160);
 
 	_sound->voicePlay(_sequenceSoundList[chatNum]);
@@ -1975,9 +1975,15 @@
 
 	uint32 longest = seq_activeTextsTimeLeft() + _system->getMillis();
 	uint32 now = _system->getMillis();
-	if (longest > now)
-		delay(longest - now);
 
+	if (textEnabled()) {
+		if (longest > now)
+			delay(longest - now);
+	} else if (speechEnabled()) {
+		while (snd_voiceIsPlaying())
+			delay(_tickLength);
+	}
+
 	seq_resetAllTextEntries();
 }
 
@@ -2300,12 +2306,12 @@
 
 void KyraEngine_v2::seq_playWsaSyncDialogue(uint16 strIndex, uint16 vocIndex, int textColor, int x, int y, int width, WSAMovieV2 *wsa, int firstframe, int lastframe, int wsaXpos, int wsaYpos) {
 	int dur = int(strlen(_sequenceStrings[strIndex])) * (_flags.isTalkie ? 7 : 15);
-	int entry = seq_setTextEntry(strIndex, x, y, dur, width);
+	int entry = textEnabled() ? seq_setTextEntry(strIndex, x, y, dur, width) : strIndex;
 	_activeText[entry].textcolor = textColor;
 	uint32 chatTimeout = _system->getMillis() + dur * _tickLength;
 	int curframe = firstframe;
 
-	if (vocIndex)
+	if (vocIndex && speechEnabled())
 		seq_playTalkText(vocIndex);
 
 	while (_system->getMillis() < chatTimeout) {
@@ -2334,6 +2340,9 @@
 		if (frameTimeout > tm && chatTimeout > tm)
 			delay(MIN(frameTimeout - tm, chatTimeout - tm));
 
+		if (speechEnabled() && !textEnabled() && !snd_voiceIsPlaying())
+			break;
+
 		_screen->copyPage(2, 0);
 		_screen->updateScreen();
 		curframe++;


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