From 0945b4595656c32997d32aa64ed14e0d073731dd Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 16 Aug 2013 02:21:43 +0300 Subject: FULLPIPE: Implement StaticANIObject::stopAnim_maybe() --- engines/fullpipe/statics.cpp | 65 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp index 0bb580fc53..6de3b6981a 100644 --- a/engines/fullpipe/statics.cpp +++ b/engines/fullpipe/statics.cpp @@ -638,7 +638,70 @@ void StaticANIObject::update(int counterdiff) { } void StaticANIObject::stopAnim_maybe() { - warning("STUB: StaticANIObject::stopAnim_maybe()"); + debug(0, "StaticANIObject::stopAnim_maybe()"); + + if (!(_flags & 1)) + return; + + _flags ^= 1; + + int oid = 0; + int oldmqid = _messageQueueId; + Common::Point point; + + if (_movement) { + setOXY(_movement->_ox, _movement->_oy); + + if (_flags & 0x40) { + if (!_movement->_currMovement && !_movement->_currDynamicPhaseIndex) { + _statics = _movement->_staticsObj1; + _movement->getCurrDynamicPhaseXY(point); + _ox -= point.x; + _oy -= point.y; + + _ox -= _movement->_mx; + _oy -= _movement->_my; + + if (_movement->_currMovement) { + _oy += point.y; + _ox -= point.x; + _ox += _statics->getDimensions(&point)->x; + } else { + _statics->getSomeXY(point); + _ox += point.x; + _oy += point.y; + } + } + } + + if (_movement->_currDynamicPhaseIndex || !(_flags & 0x40)) + _statics = _movement->_staticsObj2; + + _statics->getSomeXY(point); + + _statics->_x = _ox - point.x; + _statics->_y = _oy - point.y; + oid = _movement->_id; + _movement = 0; + + ExCommand *ex = new ExCommand(oid, 17, 24, 0, 0, 0, 1, 0, 0, 0); + ex->_keyCode = _okeyCode; + ex->_excFlags = 2; + ex->postMessage(); + } + + int mqid = _messageQueueId; + + if (_animExFlag) { + _messageQueueId = 0; + startAnimEx(oid, mqid, -1, -1); + } else { + if (_messageQueueId == oldmqid) { + _messageQueueId = 0; + if (_field_34 == 1) + updateGlobalMessageQueue(mqid, oldmqid); + } + } } void StaticANIObject::adjustSomeXY() { -- cgit v1.2.3