diff options
| author | Eugene Sandulenko | 2014-04-26 12:03:58 +0300 | 
|---|---|---|
| committer | Eugene Sandulenko | 2014-04-26 12:03:58 +0300 | 
| commit | 20f14713dab4452420a19e63ec0648d834001dcf (patch) | |
| tree | d0b296c5a5ad6311fc25f4f999f87c076950c6e8 | |
| parent | 8d15423f42933d6cc58ea53d26a059135508cfed (diff) | |
| download | scummvm-rg350-20f14713dab4452420a19e63ec0648d834001dcf.tar.gz scummvm-rg350-20f14713dab4452420a19e63ec0648d834001dcf.tar.bz2 scummvm-rg350-20f14713dab4452420a19e63ec0648d834001dcf.zip | |
FULLPIPE: Implement MGM::refreshOffsets()
| -rw-r--r-- | engines/fullpipe/motion.cpp | 20 | ||||
| -rw-r--r-- | engines/fullpipe/motion.h | 1 | 
2 files changed, 21 insertions, 0 deletions
| diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index 397af298dd..d2eaf0674f 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -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; diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h index 6d6335b5cf..4d92fd7fed 100644 --- a/engines/fullpipe/motion.h +++ b/engines/fullpipe/motion.h @@ -180,6 +180,7 @@ public:  	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 { | 
