[Scummvm-cvs-logs] scummvm master -> cbbd1a92192ad118897f645f1aa6e968bff01466

eriktorbjorn eriktorbjorn at telia.com
Sun Feb 8 15:49:51 CET 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
cbbd1a9219 ZVISION: Set safe control state value after animation finishes


Commit: cbbd1a92192ad118897f645f1aa6e968bff01466
    https://github.com/scummvm/scummvm/commit/cbbd1a92192ad118897f645f1aa6e968bff01466
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2015-02-08T15:47:20+01:00

Commit Message:
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.

Changed paths:
    engines/zvision/scripting/controls/safe_control.cpp



diff --git a/engines/zvision/scripting/controls/safe_control.cpp b/engines/zvision/scripting/controls/safe_control.cpp
index 6ba3410..4d2a91a 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;
 		}
 	}






More information about the Scummvm-git-logs mailing list