diff options
author | Torbjörn Andersson | 2015-02-08 15:47:20 +0100 |
---|---|---|
committer | Torbjörn Andersson | 2015-02-08 15:47:20 +0100 |
commit | cbbd1a92192ad118897f645f1aa6e968bff01466 (patch) | |
tree | c52a3d44754de1989c38f1f478a644dc9d10d02b /engines/zvision | |
parent | 8725f2cff2357049a3759f24e3fa530c25644e25 (diff) | |
download | scummvm-rg350-cbbd1a92192ad118897f645f1aa6e968bff01466.tar.gz scummvm-rg350-cbbd1a92192ad118897f645f1aa6e968bff01466.tar.bz2 scummvm-rg350-cbbd1a92192ad118897f645f1aa6e968bff01466.zip |
ZVISION: Set safe control state value after animation finishes
If we set it before the animation starts, the final turn of the
wheel won't be animated, because the puzzle will already be solved.
Diffstat (limited to 'engines/zvision')
-rw-r--r-- | engines/zvision/scripting/controls/safe_control.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/zvision/scripting/controls/safe_control.cpp b/engines/zvision/scripting/controls/safe_control.cpp index 6ba34106d0..4d2a91a1ad 100644 --- a/engines/zvision/scripting/controls/safe_control.cpp +++ b/engines/zvision/scripting/controls/safe_control.cpp @@ -123,6 +123,8 @@ bool SafeControl::process(uint32 deltaTimeInMillis) { _animation->seekToFrame(_animation->getCurFrame() - 1); const Graphics::Surface *frameData = _animation->decodeNextFrame(); + if (_animation->getCurFrame() == _targetFrame) + _engine->getScriptManager()->setStateValue(_key, _curState); if (frameData) _engine->getRenderManager()->blitSurfaceToBkg(*frameData, _rectangle.left, _rectangle.top); } @@ -169,8 +171,6 @@ bool SafeControl::onMouseUp(const Common::Point &screenSpacePos, const Common::P _curState = (_statesCount * 2 + tmp2) % _statesCount; _targetFrame = (_curState + _statesCount - _startPointer) % _statesCount; - - _engine->getScriptManager()->setStateValue(_key, _curState); return true; } } |