Skip to content

Commit

Permalink
SCUMM: really implement lipsync
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rasky authored and sev- committed Jan 31, 2018
1 parent 09095d6 commit 3a60637
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions engines/scumm/sound.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit 3a60637

Please sign in to comment.