aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/fullpipe/motion.cpp15
-rw-r--r--engines/fullpipe/motion.h1
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);