diff options
author | Sylvain Dupont | 2010-10-22 20:53:25 +0000 |
---|---|---|
committer | Sylvain Dupont | 2010-10-22 20:53:25 +0000 |
commit | 66e3815963564b1070bad56e25e2f9fb5e2a039e (patch) | |
tree | 647713f73375d3252706be28b3dbb055684cfc04 /engines/toon/toon.cpp | |
parent | 4a0ba817e58c5a1c7d17af5a79f91570dd98ca16 (diff) | |
download | scummvm-rg350-66e3815963564b1070bad56e25e2f9fb5e2a039e.tar.gz scummvm-rg350-66e3815963564b1070bad56e25e2f9fb5e2a039e.tar.bz2 scummvm-rg350-66e3815963564b1070bad56e25e2f9fb5e2a039e.zip |
TOON: Fixed Bug #3089974 and #3086015
Bug #3089974: "TOON: Two Drews when exiting King's bedroom"
Bug #3086015: "TOON: Woof doesn't idle correctly"
Most talking animation bugs are fixed with this.
The mouse is now hidden when entering a room.
svn-id: r53706
Diffstat (limited to 'engines/toon/toon.cpp')
-rw-r--r-- | engines/toon/toon.cpp | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp index fdb69c4cf3..3a823071e0 100644 --- a/engines/toon/toon.cpp +++ b/engines/toon/toon.cpp @@ -801,21 +801,23 @@ void ToonEngine::setPaletteEntries(uint8 *palette, int32 offset, int32 num) { _system->setPalette(vmpalette, offset, num); } -void ToonEngine::simpleUpdate() { +void ToonEngine::simpleUpdate(bool waitCharacterToTalk) { int32 elapsedTime = _system->getMillis() - _oldTimer2; _oldTimer2 = _system->getMillis(); _oldTimer = _oldTimer2; + if (!_audioManager->voiceStillPlaying() && !waitCharacterToTalk) { + _currentTextLine = 0; + _currentTextLineId = -1; + } + updateCharacters(elapsedTime); updateAnimationSceneScripts(elapsedTime); updateTimer(elapsedTime); _animationManager->update(elapsedTime); render(); - if (!_audioManager->voiceStillPlaying()) { - _currentTextLine = 0; - _currentTextLineId = -1; - } + } void ToonEngine::fixPaletteEntries(uint8 *palette, int num) { @@ -1067,7 +1069,7 @@ void ToonEngine::loadScene(int32 SceneId, bool forGameLoad) { setupGeneralPalette(); createShadowLUT(); - + state()->_mouseHidden = false; if (!forGameLoad) { @@ -1086,7 +1088,7 @@ void ToonEngine::loadScene(int32 SceneId, bool forGameLoad) { _gameState->_nextSpecialEnterX = -1; _gameState->_nextSpecialEnterY = -1; } - + _script->start(&_scriptState[0], 3); while (_script->run(&_scriptState[0])) @@ -1098,8 +1100,6 @@ void ToonEngine::loadScene(int32 SceneId, bool forGameLoad) { waitForScriptStep(); } - - state()->_mouseHidden = false; } void ToonEngine::setupGeneralPalette() { @@ -1911,7 +1911,19 @@ int32 ToonEngine::characterTalk(int32 dialogid, bool blocking) { _currentTextLineId = dialogid; if (blocking) { + Character *character = getCharacterById(talkerId); + if (character) + character->setTalking(true); + playTalkAnimOnCharacter(talkerAnimId, talkerId, true); + + // set once more the values, they may have been overwritten when the engine + // waits for the character to be ready. + _currentTextLine = myLine; + _currentTextLineCharacterId = talkerId; + _currentTextLineId = dialogid; + + } else { Character *character = getCharacterById(talkerId); if (character) @@ -1935,6 +1947,10 @@ int32 ToonEngine::characterTalk(int32 dialogid, bool blocking) { while (_audioManager->voiceStillPlaying() && !_shouldQuit) doFrame(); _gameState->_mouseHidden = oldMouseHidden && _gameState->_mouseHidden; + + Character *character = getCharacterById(talkerId); + if (character) + character->setTalking(false); } |