aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Kagerer2008-02-14 19:59:51 +0000
committerFlorian Kagerer2008-02-14 19:59:51 +0000
commita057491db26db53d7371d94481e4dcdf1086c0a6 (patch)
treec3d4b79f38898ec39e1cdff8f517fe7aea1fa205
parent1b4e06e02c759ada4d934c95a59ed02e008d84a7 (diff)
downloadscummvm-rg350-a057491db26db53d7371d94481e4dcdf1086c0a6.tar.gz
scummvm-rg350-a057491db26db53d7371d94481e4dcdf1086c0a6.tar.bz2
scummvm-rg350-a057491db26db53d7371d94481e4dcdf1086c0a6.zip
patch [ 1891542 ] KYRA: text/speech options support for HoF sequence player
svn-id: r30865
-rw-r--r--engines/kyra/sequences_v2.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/engines/kyra/sequences_v2.cpp b/engines/kyra/sequences_v2.cpp
index e24222efb1..194b386ca8 100644
--- a/engines/kyra/sequences_v2.cpp
+++ b/engines/kyra/sequences_v2.cpp
@@ -1964,7 +1964,7 @@ void KyraEngine_v2::seq_playTalkText(uint8 chatNum) {
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,8 +1975,14 @@ void KyraEngine_v2::seq_waitForTextsTimeout() {
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_printCreditsString(uint16 strIndex, int x, int y, const
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 @@ void KyraEngine_v2::seq_playWsaSyncDialogue(uint16 strIndex, uint16 vocIndex, in
if (frameTimeout > tm && chatTimeout > tm)
delay(MIN(frameTimeout - tm, chatTimeout - tm));
+ if (speechEnabled() && !textEnabled() && !snd_voiceIsPlaying())
+ break;
+
_screen->copyPage(2, 0);
_screen->updateScreen();
curframe++;