aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/sound.cpp
diff options
context:
space:
mode:
authorAdrian Frühwirth2018-01-19 20:47:48 +0100
committerEugene Sandulenko2018-01-31 16:38:07 +0100
commit16eac57834b06d15c182ece6eaf15abd103606eb (patch)
tree55364a795b20e7a8399c85d39dee75839ac5d4a8 /engines/scumm/sound.cpp
parent3a60637d77f620b94ae65fe137f99e6881075df2 (diff)
downloadscummvm-rg350-16eac57834b06d15c182ece6eaf15abd103606eb.tar.gz
scummvm-rg350-16eac57834b06d15c182ece6eaf15abd103606eb.tar.bz2
scummvm-rg350-16eac57834b06d15c182ece6eaf15abd103606eb.zip
SCUMM: implement lipsync for v7 games
Diffstat (limited to 'engines/scumm/sound.cpp')
-rw-r--r--engines/scumm/sound.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index 318a0b8180..599871b0e7 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -444,6 +444,9 @@ void Sound::processSfxQueues() {
if (_vm->_imuseDigital) {
finished = !isSoundRunning(kTalkSoundID);
+#if defined(ENABLE_SCUMM_7_8)
+ _curSoundPos = _vm->_imuseDigital->getSoundElapsedTimeInMs(kTalkSoundID) * 60 / 1000;
+#endif
} else if (_vm->_game.heversion >= 60) {
finished = !isSoundRunning(1);
} else {
@@ -451,20 +454,16 @@ void Sound::processSfxQueues() {
// calculate speech sound position simulating increment at 60FPS
_curSoundPos = (_mixer->getSoundElapsedTime(*_talkChannelHandle) * 60) / 1000;
}
-
if ((uint) act < 0x80 && ((_vm->_game.version == 8) || (_vm->_game.version <= 7 && !_vm->_string[0].no_talk_anim))) {
a = _vm->derefActor(act, "processSfxQueues");
if (a->isInCurrentRoom()) {
- if (isMouthSyncOff(_curSoundPos) && _mouthSyncMode) {
+ if (finished || (isMouthSyncOff(_curSoundPos) && _mouthSyncMode)) {
a->runActorTalkScript(a->_talkStopFrame);
_mouthSyncMode = 0;
- } else if (isMouthSyncOff(_curSoundPos) == 0 && !_mouthSyncMode) {
+ } else if (isMouthSyncOff(_curSoundPos) == 0 && !_mouthSyncMode) {
a->runActorTalkScript(a->_talkStartFrame);
_mouthSyncMode = 1;
}
-
- if (_vm->_game.version <= 6 && finished)
- a->runActorTalkScript(a->_talkStopFrame);
}
}