aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2014-01-11 17:04:12 +0200
committerEugene Sandulenko2014-01-12 00:48:10 +0200
commit91baf35726d297b6ebf1e7917aba043125589601 (patch)
tree5a4b93a069223cf44250f425dcb704548968493f
parenta29160939a845225286c65d8c2946815a99bccae (diff)
downloadscummvm-rg350-91baf35726d297b6ebf1e7917aba043125589601.tar.gz
scummvm-rg350-91baf35726d297b6ebf1e7917aba043125589601.tar.bz2
scummvm-rg350-91baf35726d297b6ebf1e7917aba043125589601.zip
FULLPIPE: Implement StaticANIObject::calcNextStep()
-rw-r--r--engines/fullpipe/statics.cpp38
-rw-r--r--engines/fullpipe/statics.h1
2 files changed, 39 insertions, 0 deletions
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index 87b308007b..e0e6e4eb0b 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -838,6 +838,44 @@ void StaticANIObject::updateStepPos() {
setOXY(ox + x, oy + y);
}
+Common::Point *StaticANIObject::calcNextStep(Common::Point *pRes) {
+ if (!_movement) {
+ pRes->x = 0;
+ pRes->y = 0;
+
+ return pRes;
+ }
+
+ Common::Point point;
+
+ _movement->calcSomeXY(point, 1);
+
+ int resX = point.x;
+ int resY = point.y;
+
+ int pointN, offset;
+
+ if (_someDynamicPhaseIndex <= 0) {
+ pointN = _stepArray.getCurrPointIndex();
+ offset = _stepArray.getPointsCount() - _stepArray.getCurrPointIndex();
+ } else {
+ pointN = _stepArray.getCurrPointIndex();
+ offset = 1 - _movement->_currDynamicPhaseIndex + _someDynamicPhaseIndex;
+ }
+
+ if (pointN >= 0) {
+ _stepArray.getPoint(&point, pointN, offset);
+
+ resX += point.x;
+ resY += point.y;
+ }
+
+ pRes->x = resX;
+ pRes->y = resY;
+
+ return pRes;
+}
+
void StaticANIObject::stopAnim_maybe() {
debug(6, "StaticANIObject::stopAnim_maybe()");
diff --git a/engines/fullpipe/statics.h b/engines/fullpipe/statics.h
index 3f1f14c7bf..d38737fd54 100644
--- a/engines/fullpipe/statics.h
+++ b/engines/fullpipe/statics.h
@@ -247,6 +247,7 @@ public:
void updateStepPos();
void stopAnim_maybe();
+ Common::Point *calcNextStep(Common::Point *point);
MessageQueue *changeStatics1(int msgNum);
void changeStatics2(int objId);