diff options
author | Eugene Sandulenko | 2014-01-08 10:58:26 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2014-01-08 10:58:26 +0200 |
commit | d423b5b1fef100d5bbb9087ee962c1c22109b656 (patch) | |
tree | 175da029c38987b27c025ea790d5ea2f4a12b5d5 | |
parent | 5e0236e7ad7157f67ca1eed6b4d28a959de5bc40 (diff) | |
download | scummvm-rg350-d423b5b1fef100d5bbb9087ee962c1c22109b656.tar.gz scummvm-rg350-d423b5b1fef100d5bbb9087ee962c1c22109b656.tar.bz2 scummvm-rg350-d423b5b1fef100d5bbb9087ee962c1c22109b656.zip |
FULLPIPE: Implement MGM::getStaticsIndex()
-rw-r--r-- | engines/fullpipe/motion.cpp | 15 | ||||
-rw-r--r-- | engines/fullpipe/motion.h | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index 42dd60a3aa..dc1b76ae2f 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -1882,6 +1882,9 @@ Common::Point *MGM::getPoint(Common::Point *point, int objectId, int staticsId1, } int MGM::getStaticsIndexById(int idx, int16 id) { + if (!_items[idx]->statics.size()) + return -1; + for (uint i = 0; i < _items[idx]->statics.size(); i++) { if (_items[idx]->statics[i]->_staticsId == id) return i; @@ -1890,6 +1893,18 @@ int MGM::getStaticsIndexById(int idx, int16 id) { return 0; } +int MGM::getStaticsIndex(int idx, Statics *st) { + if (!_items[idx]->statics.size()) + return -1; + + for (uint i = 0; i < _items[idx]->statics.size(); i++) { + if (_items[idx]->statics[i] == st) + return i; + } + + return 0; +} + void MGM::clearMovements2(int idx) { _items[idx]->movements2.clear(); } diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h index cecde70775..e87763f9ba 100644 --- a/engines/fullpipe/motion.h +++ b/engines/fullpipe/motion.h @@ -173,6 +173,7 @@ public: void updateAnimStatics(StaticANIObject *ani, int staticsId); Common::Point *getPoint(Common::Point *point, int aniId, int staticsId1, int staticsId2); int getStaticsIndexById(int idx, int16 id); + int getStaticsIndex(int idx, Statics *st); void clearMovements2(int idx); int recalcOffsets(int idx, int st1idx, int st2idx, bool flip, bool flop); Common::Point *calcLength(Common::Point *point, Movement *mov, int x, int y, int *x1, int *y1, int flag); |