aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2014-04-27 11:59:29 +0300
committerEugene Sandulenko2014-04-27 11:59:29 +0300
commitcf97b2ec9ecac5ab0edbdd34dca051c550cada37 (patch)
tree55e98e24d9a45af8f05d218bc2ef90b23a1fe9e8 /engines
parent10d3017737080e9f769d0625a7cb5790fb465dc6 (diff)
downloadscummvm-rg350-cf97b2ec9ecac5ab0edbdd34dca051c550cada37.tar.gz
scummvm-rg350-cf97b2ec9ecac5ab0edbdd34dca051c550cada37.tar.bz2
scummvm-rg350-cf97b2ec9ecac5ab0edbdd34dca051c550cada37.zip
FULLPIPE: Implement StaticANIObject::calcStepLen()
Diffstat (limited to 'engines')
-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();