aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2013-08-31 18:34:30 +0300
committerEugene Sandulenko2013-09-06 14:51:22 +0300
commitd6309755fc8b67e2ade20008e6f9d1fc911095c9 (patch)
treef0e6e08a6c14857be4d1e475c05b3d6d4d1943b6
parent11cfbe4bc5c97ff6e8568126f22261f834a3943e (diff)
downloadscummvm-rg350-d6309755fc8b67e2ade20008e6f9d1fc911095c9.tar.gz
scummvm-rg350-d6309755fc8b67e2ade20008e6f9d1fc911095c9.tar.bz2
scummvm-rg350-d6309755fc8b67e2ade20008e6f9d1fc911095c9.zip
FULLPIPE: Bugfixes to StaticANIObject::update()
-rw-r--r--engines/fullpipe/statics.cpp71
1 files changed, 38 insertions, 33 deletions
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index bb67f9f581..0d56125a3d 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -639,7 +639,7 @@ void StaticANIObject::update(int counterdiff) {
if (dyn->_initialCountdown == dyn->_countdown) {
ex = dyn->getExCommand();
- if (ex && ex->_messageKind == 35) {
+ if (ex && ex->_messageKind != 35) {
newex = new ExCommand(ex);
newex->_excFlags |= 2;
if (newex->_messageKind == 17) {
@@ -651,42 +651,42 @@ void StaticANIObject::update(int counterdiff) {
if (!_movement)
return;
}
+ }
- if (dyn->_initialCountdown == dyn->_countdown && dyn->_field_68 == 0) {
- newex = new ExCommand(_id, 17, dyn->_field_68, 0, 0, 0, 1, 0, 0, 0);
- newex->_excFlags = 2;
- newex->_keyCode = _okeyCode;
- newex->sendMessage();
+ if (dyn->_initialCountdown != dyn->_countdown || dyn->_field_68 == 0) {
+ newex = new ExCommand(_id, 17, dyn->_field_68, 0, 0, 0, 1, 0, 0, 0);
+ newex->_excFlags = 2;
+ newex->_keyCode = _okeyCode;
+ newex->sendMessage();
- if (!_movement)
- return;
- }
+ if (!_movement)
+ return;
+ }
- if (!_movement->gotoNextFrame(_callback1, _callback2)) {
- stopAnim_maybe();
- } else {
- setOXY(_movement->_ox, _movement->_oy);
- _counter = _initialCounter;
-
- if (dyn->_initialCountdown == dyn->_countdown) {
- ex = dyn->getExCommand();
- if (ex) {
- if (ex->_messageKind == 35) {
- newex = new ExCommand(ex);
- newex->_excFlags |= 2;
- newex->sendMessage();
- }
+ if (!_movement->gotoNextFrame(_callback1, _callback2)) {
+ stopAnim_maybe();
+ } else {
+ setOXY(_movement->_ox, _movement->_oy);
+ _counter = _initialCounter;
+
+ if (dyn->_initialCountdown == dyn->_countdown) {
+ ex = dyn->getExCommand();
+ if (ex) {
+ if (ex->_messageKind == 35) {
+ newex = new ExCommand(ex);
+ newex->_excFlags |= 2;
+ newex->sendMessage();
}
}
- if (!_movement)
- return;
-
- _stepArray.getCurrPoint(&point);
- setOXY(point.x + _ox, point.y + _oy);
- _stepArray.gotoNextPoint();
- if (_someDynamicPhaseIndex == _movement->_currDynamicPhaseIndex)
- adjustSomeXY();
}
+ if (!_movement)
+ return;
+
+ _stepArray.getCurrPoint(&point);
+ setOXY(point.x + _ox, point.y + _oy);
+ _stepArray.gotoNextPoint();
+ if (_someDynamicPhaseIndex == _movement->_currDynamicPhaseIndex)
+ adjustSomeXY();
}
} else if (_flags & 0x20) {
_flags ^= 0x20;
@@ -696,8 +696,8 @@ void StaticANIObject::update(int counterdiff) {
Common::Point pointS;
_statics->getSomeXY(pointS);
- setOXY(_ox + point.x + _movement->_mx - pointS.x,
- _oy + point.y + _movement->_my - pointS.y);
+ _movement->setOXY(_ox + point.x + _movement->_mx - pointS.x,
+ _oy + point.y + _movement->_my - pointS.y);
}
} else {
if (_statics) {
@@ -1265,6 +1265,8 @@ void Movement::initStatics(StaticANIObject *ani) {
if (!_currMovement)
return;
+ debug(7, "Movement::initStatics()");
+
_staticsObj2 = ani->addReverseStatics(_currMovement->_staticsObj2);
_staticsObj1 = ani->addReverseStatics(_currMovement->_staticsObj1);
@@ -1290,6 +1292,8 @@ void Movement::initStatics(StaticANIObject *ani) {
}
void Movement::updateCurrDynamicPhase() {
+ debug(7, "Movement::updateCurrDynamicPhase()");
+
if (_currMovement) {
if (_currMovement->_dynamicPhases.size() == 0)
return;
@@ -1306,6 +1310,7 @@ void Movement::updateCurrDynamicPhase() {
}
void Movement::setDynamicPhaseIndex(int index) {
+ debug(7, "Movement::setDynamicPhaseIndex(%d)", index);
while (_currDynamicPhaseIndex < index)
gotoNextFrame(0, 0);