From 9cbb0d557948d8b4c3a8c766a1fc32bb75a2c6c3 Mon Sep 17 00:00:00 2001 From: Sylvain Dupont Date: Fri, 22 Oct 2010 21:42:48 +0000 Subject: TOON: More talk animation fixes There was a conflict between the idle animation and the talk animation in some cases (showing the chain anim & idle anim in the arcade) svn-id: r53713 --- engines/toon/anim.h | 1 + engines/toon/character.cpp | 6 +++--- engines/toon/toon.cpp | 6 ++++-- 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'engines/toon') diff --git a/engines/toon/anim.h b/engines/toon/anim.h index 7bf633220c..5d65959e07 100644 --- a/engines/toon/anim.h +++ b/engines/toon/anim.h @@ -186,6 +186,7 @@ public: EMCState _state; uint32 _lastTimer; bool _frozen; + bool _frozenForConversation; bool _active; }; diff --git a/engines/toon/character.cpp b/engines/toon/character.cpp index 860b106837..4daa3a5fa7 100644 --- a/engines/toon/character.cpp +++ b/engines/toon/character.cpp @@ -248,7 +248,7 @@ void Character::stopSpecialAnim() { delete anim #endif if (_animScriptId != -1) - _vm->getSceneAnimationScript(_animScriptId)->_frozen = false; + _vm->getSceneAnimationScript(_animScriptId)->_frozenForConversation = false; //if (_sceneAnimationId != -1) // _animationInstance->setAnimation(_vm->getSceneAnimation(_sceneAnimationId)->_animation); @@ -348,7 +348,7 @@ void Character::update(int32 timeIncrement) { #endif if (_animScriptId != -1) - _vm->getSceneAnimationScript(_animScriptId)->_frozen = true; + _vm->getSceneAnimationScript(_animScriptId)->_frozenForConversation = true; // TODO setup backup // @@ -955,7 +955,7 @@ void Character::playAnim(int32 animId, int32 unused, int32 flags) { if (_animScriptId != -1 && (flags & 8) == 0) - _vm->getSceneAnimationScript(_animScriptId)->_frozen = true; + _vm->getSceneAnimationScript(_animScriptId)->_frozenForConversation = true; stopSpecialAnim(); diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp index 3a823071e0..84a28ae990 100644 --- a/engines/toon/toon.cpp +++ b/engines/toon/toon.cpp @@ -846,7 +846,7 @@ void ToonEngine::updateAnimationSceneScripts(int32 timeElapsed) { do { if (_sceneAnimationScripts[_lastProcessedSceneScript]._lastTimer <= _system->getMillis() && - !_sceneAnimationScripts[_lastProcessedSceneScript]._frozen) { + !_sceneAnimationScripts[_lastProcessedSceneScript]._frozen && !_sceneAnimationScripts[_lastProcessedSceneScript]._frozenForConversation) { _animationSceneScriptRunFlag = true; while (_animationSceneScriptRunFlag && _sceneAnimationScripts[_lastProcessedSceneScript]._lastTimer <= _system->getMillis() && !_shouldQuit) { @@ -855,7 +855,7 @@ void ToonEngine::updateAnimationSceneScripts(int32 timeElapsed) { //waitForScriptStep(); - if (_sceneAnimationScripts[_lastProcessedSceneScript]._frozen) + if (_sceneAnimationScripts[_lastProcessedSceneScript]._frozen || _sceneAnimationScripts[_lastProcessedSceneScript]._frozenForConversation) break; } @@ -1049,6 +1049,7 @@ void ToonEngine::loadScene(int32 SceneId, bool forGameLoad) { _script->start(&_sceneAnimationScripts[i]._state, 9 + i); _sceneAnimationScripts[i]._lastTimer = getSystem()->getMillis(); _sceneAnimationScripts[i]._frozen = false; + _sceneAnimationScripts[i]._frozenForConversation = false; } } @@ -2956,6 +2957,7 @@ bool ToonEngine::loadGame(int32 slot) { for (int32 i = 0; i < state()->_locations[_gameState->_currentScene]._numSceneAnimations; i++) { _sceneAnimationScripts[i]._active = loadFile->readByte(); _sceneAnimationScripts[i]._frozen = loadFile->readByte(); + _sceneAnimationScripts[i]._frozenForConversation = false; int32 oldTimer = loadFile->readSint32BE(); _sceneAnimationScripts[i]._lastTimer = MAX(0,oldTimer + timerDiff); _script->loadState(&_sceneAnimationScripts[i]._state, loadFile); -- cgit v1.2.3