Skip to content

Commit

Permalink
FULLPIPE: Implement MGM::refreshOffsets()
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Apr 26, 2014
1 parent 8d15423 commit 20f1471
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions engines/fullpipe/motion.cpp
Expand Up @@ -2359,6 +2359,26 @@ int MGM::recalcOffsets(int idx, int st1idx, int st2idx, bool flip, bool flop) {
return -1;
}

int MGM::refreshOffsets(int objectId, int idx1, int idx2) {
int idx = getItemIndexById(objectId);

if (idx != -1) {
int from = getStaticsIndexById(idx, idx1);
int to = getStaticsIndexById(idx, idx2);

MGMSubItem *sub = _items[idx]->subItems[from + to * _items[idx]->statics.size()];

if (sub->movement) {
idx = sub->field_8;
} else {
clearMovements2(idx);
idx = recalcOffsets(idx, from, to, 0, 1);
}
}

return idx;
}

Common::Point *MGM::calcLength(Common::Point *pRes, Movement *mov, int x, int y, int *mult, int *len, int flag) {
Common::Point point;

Expand Down
1 change: 1 addition & 0 deletions engines/fullpipe/motion.h
Expand Up @@ -180,6 +180,7 @@ class MGM : public CObject {
ExCommand2 *buildExCommand2(Movement *mov, int objId, int x1, int y1, Common::Point *x2, Common::Point *y2, int len);
MessageQueue *genMQ(StaticANIObject *ani, int staticsIndex, int staticsId, int *resStatId, Common::Point **pointArr);
int countPhases(int idx, int subIdx, int subOffset, int flag);
int refreshOffsets(int objectId, int idx1, int idx2);
};

struct MctlLadderMovementVars {
Expand Down

0 comments on commit 20f1471

Please sign in to comment.