diff options
author | Travis Howell | 2004-07-24 13:36:26 +0000 |
---|---|---|
committer | Travis Howell | 2004-07-24 13:36:26 +0000 |
commit | 370cf65966a0a14e12dbc8db68b2f0b3f6f1c546 (patch) | |
tree | 32ef1d476086719f16c4894ca7e613bc2f93992e | |
parent | 7550ebed81d784ef26a673ee05498682bdf50c1f (diff) | |
download | scummvm-rg350-370cf65966a0a14e12dbc8db68b2f0b3f6f1c546.tar.gz scummvm-rg350-370cf65966a0a14e12dbc8db68b2f0b3f6f1c546.tar.bz2 scummvm-rg350-370cf65966a0a14e12dbc8db68b2f0b3f6f1c546.zip |
Corrtection from disasm., mouth sync uses speech timing.
Fix bug #
svn-id: r14319
-rw-r--r-- | scumm/sound.cpp | 24 | ||||
-rw-r--r-- | scumm/sound.h | 1 | ||||
-rw-r--r-- | scumm/string.cpp | 4 |
3 files changed, 14 insertions, 15 deletions
diff --git a/scumm/sound.cpp b/scumm/sound.cpp index ad790fef57..bbc9bb08ac 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -64,7 +64,6 @@ Sound::Sound(ScummEngine *parent) _talk_sound_b1(0), _talk_sound_b2(0), _talk_sound_mode(0), - _talk_sound_frame(0), _mouthSyncMode(false), _endOfMouthSync(false), _curSoundPos(0), @@ -507,7 +506,7 @@ void Sound::processSfxQueues() { const int act = _vm->getTalkingActor(); if ((_sfxMode & 2) && act != 0) { Actor *a; - bool b, finished; + bool finished; if (_vm->_imuseDigital) { finished = !isSoundRunning(kTalkSoundID); @@ -515,18 +514,20 @@ void Sound::processSfxQueues() { finished = !_talkChannelHandle.isActive(); } - if ((uint) act < 0x80 && ((_vm->_version == 8) || (_vm->_version <= 7 && !_vm->_string[0].no_talk_anim)) && (finished || !_endOfMouthSync)) { + if ((uint) act < 0x80 && ((_vm->_version == 8) || (_vm->_version <= 7 && !_vm->_string[0].no_talk_anim))) { a = _vm->derefActor(act, "processSfxQueues"); if (a->isInCurrentRoom()) { - b = finished || isMouthSyncOff(_curSoundPos); - if (_mouthSyncMode != b) { - _mouthSyncMode = b; - if (_talk_sound_frame != -1) { - a->runActorTalkScript(_talk_sound_frame); - _talk_sound_frame = -1; - } else - a->runActorTalkScript(b ? a->talkStopFrame : a->talkStartFrame); + if (isMouthSyncOff(_curSoundPos) && !_mouthSyncMode) { + if (!_endOfMouthSync) + a->runActorTalkScript(a->talkStopFrame); + _mouthSyncMode = 0; + } else if (isMouthSyncOff(_curSoundPos) == 0 && !_mouthSyncMode) { + a->runActorTalkScript(a->talkStartFrame); + _mouthSyncMode = 1; } + + if (_vm->_version <= 6 && finished) + a->runActorTalkScript(a->talkStopFrame); } } @@ -883,7 +884,6 @@ void Sound::talkSound(uint32 a, uint32 b, int mode, int frame) { _talk_sound_b2 = b; } - _talk_sound_frame = frame; _talk_sound_mode |= mode; } diff --git a/scumm/sound.h b/scumm/sound.h index 71bd62c4a2..aab2f377d6 100644 --- a/scumm/sound.h +++ b/scumm/sound.h @@ -64,7 +64,6 @@ protected: uint32 _talk_sound_a1, _talk_sound_a2, _talk_sound_b1, _talk_sound_b2; byte _talk_sound_mode; - int _talk_sound_frame; bool _mouthSyncMode; bool _endOfMouthSync; uint16 _mouthSyncTimes[64]; diff --git a/scumm/string.cpp b/scumm/string.cpp index d6836576c6..be925f89f8 100644 --- a/scumm/string.cpp +++ b/scumm/string.cpp @@ -77,7 +77,7 @@ void ScummEngine::CHARSET_1() { uint32 talk_sound_a = 0; uint32 talk_sound_b = 0; int s, i, t, c; - int frme = -1; + int frme; Actor *a; byte *buffer; @@ -231,7 +231,7 @@ void ScummEngine::CHARSET_1() { case 9: frme = *buffer++; frme |= *buffer++ << 8; - a->startAnimActor(frme != -1 ? frme : a->talkStartFrame); + a->startAnimActor(frme); break; case 10: talk_sound_a = buffer[0] | (buffer[1] << 8) | (buffer[4] << 16) | (buffer[5] << 24); |