aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe/statics.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2013-08-15 00:46:19 +0300
committerEugene Sandulenko2013-09-06 14:51:14 +0300
commit9f52e9f65068e136680e5fbd4a55eb4ff69720c2 (patch)
tree7b3415da15cfa1b468fc97de3738b4e8b9830167 /engines/fullpipe/statics.cpp
parent4db2d7e21b6729b04e1760af302a1acdd3bd4ae4 (diff)
downloadscummvm-rg350-9f52e9f65068e136680e5fbd4a55eb4ff69720c2.tar.gz
scummvm-rg350-9f52e9f65068e136680e5fbd4a55eb4ff69720c2.tar.bz2
scummvm-rg350-9f52e9f65068e136680e5fbd4a55eb4ff69720c2.zip
FULLPIPE: More work on behaviors. Animations start to (buggy) work.
Diffstat (limited to 'engines/fullpipe/statics.cpp')
-rw-r--r--engines/fullpipe/statics.cpp43
1 files changed, 42 insertions, 1 deletions
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index de5d68983f..168ec90e27 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -1225,7 +1225,48 @@ bool Movement::gotoNextFrame(int callback1, int callback2) {
}
bool Movement::gotoPrevFrame() {
- warning("STUB: Movement::gotoPrevFrame()");
+ debug(8, "Movement::gotoPrevFrame()");
+
+ if (!_currDynamicPhaseIndex) {
+ gotoLastFrame();
+ return false;
+ }
+
+ Common::Point point;
+
+ getCurrDynamicPhaseXY(point);
+
+ _ox -= point.x;
+ _oy -= point.y;
+
+ if (_currMovement) {
+ if (_currMovement->_framePosOffsets) {
+ _ox += _currMovement->getDimensionsOfPhase(&point, _currDynamicPhaseIndex)->x;
+ _ox += _currMovement->_framePosOffsets[_currDynamicPhaseIndex]->x;
+ _oy -= _currMovement->_framePosOffsets[_currDynamicPhaseIndex]->y;
+ }
+
+ _currDynamicPhaseIndex--;
+ if (_currDynamicPhaseIndex < 0)
+ _currDynamicPhaseIndex = _currMovement->_dynamicPhases.size() - 1;
+
+ _ox -= _currMovement->getDimensionsOfPhase(&point, _currDynamicPhaseIndex)->x;
+ } else {
+ if (_framePosOffsets) {
+ _ox -= _framePosOffsets[_currDynamicPhaseIndex]->x;
+ _oy -= _framePosOffsets[_currDynamicPhaseIndex]->y;
+ }
+
+ _currDynamicPhaseIndex--;
+ if (_currDynamicPhaseIndex < 0)
+ _currDynamicPhaseIndex = _currMovement->_dynamicPhases.size() - 1;
+ }
+
+ updateCurrDynamicPhase();
+ getCurrDynamicPhaseXY(point);
+
+ _ox += point.x;
+ _oy += point.y;
return true;
}