aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2014-06-07 10:13:13 +0300
committerEugene Sandulenko2014-06-07 10:13:13 +0300
commit7c017cfdb924ade0faa8b01faf9580a7c444d4df (patch)
treeda47c8f07e746fca89912407312a16f34bf2482a
parent17cc86d1721d275d56845754b9a32710b0e0d2f0 (diff)
downloadscummvm-rg350-7c017cfdb924ade0faa8b01faf9580a7c444d4df.tar.gz
scummvm-rg350-7c017cfdb924ade0faa8b01faf9580a7c444d4df.tar.bz2
scummvm-rg350-7c017cfdb924ade0faa8b01faf9580a7c444d4df.zip
FULLPIPE: Implement MovGraph2::getItemSubIndexByMGM()
-rw-r--r--engines/fullpipe/motion.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index adfc2f7326..85069262f8 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -816,6 +816,7 @@ void MovGraph::freeItems() {
_items.clear();
}
+
Common::Array<MovItem *> *MovGraph::method28(StaticANIObject *ani, int x, int y, int flag1, int *rescount) {
*rescount = 0;
@@ -1629,8 +1630,22 @@ int MovGraph2::getItemSubIndexByMovementId(int idx, int movId) {
return -1;
}
-int MovGraph2::getItemSubIndexByMGM(int idx, StaticANIObject *ani) {
- warning("STUB: MovGraph2::getItemSubIndexByMGM()");
+int MovGraph2::getItemSubIndexByMGM(int index, StaticANIObject *ani) {
+ if (findNode(ani->_ox, ani->_oy, 0) || findLink1(ani->_ox, ani->_oy, -1, 0) || findLink2(ani->_ox, ani->_oy)) {
+ int minidx = -1;
+ int min = 0;
+
+ for (int i = 0; i < 4; i++) {
+ int tmp = _mgm.refreshOffsets(ani->_id, ani->_statics->_staticsId, _items2[index]->_subItems[i]._staticsId1);
+
+ if (tmp >= 0 && (minidx == -1 || tmp < min)) {
+ minidx = i;
+ min = tmp;
+ }
+ }
+
+ return minidx;
+ }
return -1;
}