aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/fullpipe/statics.cpp25
-rw-r--r--engines/fullpipe/statics.h1
2 files changed, 26 insertions, 0 deletions
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index 4d813d3b0b..f1abac5778 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -1369,6 +1369,31 @@ bool StaticANIObject::startAnim(int movementId, int messageQueueId, int dynPhase
return true;
}
+Common::Point *StaticANIObject::calcStepLen(Common::Point *p) {
+ if (_movement) {
+ Common::Point point;
+
+ _movement->calcSomeXY(point, 0);
+
+ p->x = point.x;
+ p->y = point.y;
+
+ int idx = _stepArray.getCurrPointIndex() - _movement->_currDynamicPhaseIndex - 1;
+
+ if (idx >= 0) {
+ _stepArray.getPoint(&point, idx, _movement->_currDynamicPhaseIndex + 2);
+
+ p->x += point.x;
+ p->y += point.y;
+ }
+ } else {
+ p->x = 0;
+ p->y = 0;
+ }
+
+ return p;
+}
+
Statics::Statics() {
_staticsId = 0;
_picture = 0;
diff --git a/engines/fullpipe/statics.h b/engines/fullpipe/statics.h
index d5e7d533a7..d678957163 100644
--- a/engines/fullpipe/statics.h
+++ b/engines/fullpipe/statics.h
@@ -246,6 +246,7 @@ public:
void draw2();
MovTable *countMovements();
+ Common::Point *calcStepLen(Common::Point *p);
void setSpeed(int speed);
void updateStepPos();