diff options
-rw-r--r-- | engines/fullpipe/motion.cpp | 35 | ||||
-rw-r--r-- | engines/fullpipe/motion.h | 4 |
2 files changed, 34 insertions, 5 deletions
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index 0b1c159337..0e60847bc9 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -690,10 +690,39 @@ int MovGraph::changeCallback() { return 0; } -int MovGraph::method3C(StaticANIObject *ani, int flag) { - warning("STUB: MovGraph::method3C()"); +bool MovGraph::method3C(StaticANIObject *ani, int flag) { + int idx = getItemIndexByStaticAni(ani); - return 0; + if (idx == -1) + return false; + + Common::Point point; + MovArr movarr; + + point.x = ani->_ox; + point.y = ani->_oy; + + findClosestLink(idx, &point, &movarr); + ani->setOXY(point.x, point.y); + + if (flag) { + Statics *st; + + if (ani->_statics) { + int t = _mgm.refreshOffsets(ani->_id, ani->_statics->_staticsId, movarr._link->_dwordArray2[_field_44]); + if (t > _mgm.refreshOffsets(ani->_id, ani->_statics->_staticsId, movarr._link->_dwordArray2[_field_44 + 1])) + st = ani->getStaticsById(movarr._link->_dwordArray2[_field_44 + 1]); + else + st = ani->getStaticsById(movarr._link->_dwordArray2[_field_44]); + } else { + ani->stopAnim_maybe(); + st = ani->getStaticsById(movarr._link->_dwordArray2[_field_44]); + } + + ani->_statics = st; + } + + return true; } bool MovGraph::method44(StaticANIObject *ani, int x, int y) { diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h index fc199e305b..aa40379717 100644 --- a/engines/fullpipe/motion.h +++ b/engines/fullpipe/motion.h @@ -58,7 +58,7 @@ public: virtual int method30() { return 0; } virtual MessageQueue *method34(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) { return 0; } virtual int changeCallback() { return 0; } - virtual int method3C(StaticANIObject *ani, int flag) { return 0; } + virtual bool method3C(StaticANIObject *ani, int flag) { return 0; } virtual int method40() { return 0; } virtual bool method44(StaticANIObject *ani, int x, int y) { return false; } virtual int method48() { return -1; } @@ -365,7 +365,7 @@ public: virtual int method2C(StaticANIObject *obj, int x, int y); virtual MessageQueue *method34(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId); virtual int changeCallback(); - virtual int method3C(StaticANIObject *ani, int flag); + virtual bool method3C(StaticANIObject *ani, int flag); virtual bool method44(StaticANIObject *ani, int x, int y); virtual MessageQueue *doWalkTo(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId); virtual MessageQueue *method50(StaticANIObject *ani, Common::Array<MovArr *> *movarr, int staticsId); |