aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorGiovanni Bajo2017-12-31 13:55:33 +0100
committerEugene Sandulenko2018-01-31 16:36:24 +0100
commit3a60637d77f620b94ae65fe137f99e6881075df2 (patch)
tree13d4fa10bd7f093d520c2bb25b91541cf5e695df /engines
parent09095d66479ecfe2d52ef6f6a1d8ed00f2eaa9dd (diff)
downloadscummvm-rg350-3a60637d77f620b94ae65fe137f99e6881075df2.tar.gz
scummvm-rg350-3a60637d77f620b94ae65fe137f99e6881075df2.tar.bz2
scummvm-rg350-3a60637d77f620b94ae65fe137f99e6881075df2.zip
SCUMM: really implement lipsync
It looks like the code was there, but it was never fully implemented because _curSoundPos was never being incremented. Experimentally, it looks like it works if it is a 60FPS counter.
Diffstat (limited to 'engines')
-rw-r--r--engines/scumm/sound.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index 98958a3050..318a0b8180 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -448,14 +448,15 @@ void Sound::processSfxQueues() {
finished = !isSoundRunning(1);
} else {
finished = !_mixer->isSoundHandleActive(*_talkChannelHandle);
+ // 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 (!_endOfMouthSync)
- a->runActorTalkScript(a->_talkStopFrame);
+ if (isMouthSyncOff(_curSoundPos) && _mouthSyncMode) {
+ a->runActorTalkScript(a->_talkStopFrame);
_mouthSyncMode = 0;
} else if (isMouthSyncOff(_curSoundPos) == 0 && !_mouthSyncMode) {
a->runActorTalkScript(a->_talkStartFrame);