aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe
diff options
context:
space:
mode:
authorEugene Sandulenko2014-05-21 08:04:44 +0300
committerEugene Sandulenko2014-05-21 08:05:05 +0300
commit29eda4c02e52279c9be4edf5764a41c8d2a9e88a (patch)
treeefe6054c7eadfaa501321f727cf36293fd92846b /engines/fullpipe
parentfc8e00b17a31b9013fc3509abf343e0ec614b0a2 (diff)
downloadscummvm-rg350-29eda4c02e52279c9be4edf5764a41c8d2a9e88a.tar.gz
scummvm-rg350-29eda4c02e52279c9be4edf5764a41c8d2a9e88a.tar.bz2
scummvm-rg350-29eda4c02e52279c9be4edf5764a41c8d2a9e88a.zip
FULLPIPE: Implement MovGraph::method3C()
Diffstat (limited to 'engines/fullpipe')
-rw-r--r--engines/fullpipe/motion.cpp35
-rw-r--r--engines/fullpipe/motion.h4
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);