From cbbd1a92192ad118897f645f1aa6e968bff01466 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Sun, 8 Feb 2015 15:47:20 +0100 Subject: 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. --- engines/zvision/scripting/controls/safe_control.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/zvision') 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; } } -- cgit v1.2.3