[Scummvm-cvs-logs] scummvm master -> 514f93b57fff606be8ccb2151199a5c3703b50a6
sev-
sev at scummvm.org
Thu Oct 24 23:35:28 CEST 2013
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
514f93b57f FULLPIPE: Implement StaticANIObject::updateStepPos()
Commit: 514f93b57fff606be8ccb2151199a5c3703b50a6
https://github.com/scummvm/scummvm/commit/514f93b57fff606be8ccb2151199a5c3703b50a6
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-10-24T14:34:43-07:00
Commit Message:
FULLPIPE: Implement StaticANIObject::updateStepPos()
Changed paths:
engines/fullpipe/statics.cpp
engines/fullpipe/statics.h
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index 0e9daad..f1107e5 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -73,6 +73,27 @@ Common::Point *StepArray::getCurrPoint(Common::Point *point) {
return point;
}
+Common::Point *StepArray::getPoint(Common::Point *point, int index, int offset) {
+ if (index == -1)
+ index = _currPointIndex;
+
+ if (index + offset > _maxPointIndex - 1)
+ offset = _maxPointIndex - index;
+
+ point->x = 0;
+ point->y = 0;
+
+ while (offset >= 1) {
+ point->x += _points[index]->x;
+ point->y += _points[index]->y;
+
+ index++;
+ offset--;
+ }
+
+ return point;
+}
+
bool StepArray::gotoNextPoint() {
if (_currPointIndex < _maxPointIndex) {
_currPointIndex++;
@@ -744,6 +765,26 @@ void StaticANIObject::update(int counterdiff) {
}
}
+void StaticANIObject::updateStepPos() {
+ Common::Point point;
+
+ int ox = _movement->_ox;
+ int oy = _movement->_oy;
+
+ _movement->calcSomeXY(point, 1);
+ int x = point.x;
+ int y = point.y;
+
+ _stepArray.getPoint(&point, -1, _stepArray.getPointsCount());
+ x += point.x;
+ y += point.y;
+
+ _statics = _movement->_staticsObj2;
+ _movement = 0;
+
+ setOXY(ox + x, oy + y);
+}
+
void StaticANIObject::stopAnim_maybe() {
debug(6, "StaticANIObject::stopAnim_maybe()");
diff --git a/engines/fullpipe/statics.h b/engines/fullpipe/statics.h
index 2879edd..370f540 100644
--- a/engines/fullpipe/statics.h
+++ b/engines/fullpipe/statics.h
@@ -42,7 +42,10 @@ class StepArray : public CObject {
void clear();
int getCurrPointIndex() { return _currPointIndex; }
+ int getPointsCount() { return _maxPointIndex; }
+
Common::Point *getCurrPoint(Common::Point *point);
+ Common::Point *getPoint(Common::Point *point, int index, int offset);
bool gotoNextPoint();
};
@@ -234,6 +237,7 @@ class StaticANIObject : public GameObject {
MovTable *countMovements();
void setSpeed(int speed);
+ void updateStepPos();
void stopAnim_maybe();
MessageQueue *changeStatics1(int msgNum);
More information about the Scummvm-git-logs
mailing list