aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2014-05-20 08:10:04 +0300
committerEugene Sandulenko2014-05-20 08:10:04 +0300
commit510ed39c5a56566e6c86bd3c936c6b1adb4df080 (patch)
treed0e47121e1e8927a31c6b4e032030b8c50d97dd6
parentd9112a586303d3093c852855ea59b841024bbd9b (diff)
downloadscummvm-rg350-510ed39c5a56566e6c86bd3c936c6b1adb4df080.tar.gz
scummvm-rg350-510ed39c5a56566e6c86bd3c936c6b1adb4df080.tar.bz2
scummvm-rg350-510ed39c5a56566e6c86bd3c936c6b1adb4df080.zip
FULLPIPE: Implement MovGraph::method34()
-rw-r--r--engines/fullpipe/motion.cpp43
-rw-r--r--engines/fullpipe/motion.h2
2 files changed, 19 insertions, 26 deletions
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index 21df1c3aae..be27b7cd67 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -612,14 +612,14 @@ int MovGraph::method2C(StaticANIObject *obj, int x, int y) {
}
MessageQueue *MovGraph::method34(StaticANIObject *ani, int xpos, int ypos, int fuzzyMatch, int staticsId) {
-#if 0
if (!ani) {
- if (_itemsCount < 1)
+ if (!_items.size())
return 0;
- ani = _items->ani;
+ ani = _items[0]->ani;
}
- if (ABS(ani->_ox - x) < 50 && ABS(ani->_oy - y) < 50)
+
+ if (ABS(ani->_ox - xpos) < 50 && ABS(ani->_oy - ypos) < 50)
return 0;
if (!ani->isIdle())
@@ -628,20 +628,18 @@ MessageQueue *MovGraph::method34(StaticANIObject *ani, int xpos, int ypos, int f
if (ani->_flags & 0x100)
return 0;
- v10 = method28(ani, x, y, fuzzyMatch, (int *)&ani);
+ int count;
+ Common::Array<MovItem *> *movitems = method28(ani, xpos, ypos, fuzzyMatch, &count);
- if (!v10)
+ if (!movitems)
return 0;
- if (!ani->_movement) {
- v20 = v10;
- v33 = (int)ani;
- } else {
+ if (ani->_movement) {
Common::Point point;
ani->calcStepLen(&point);
- MessageQueue *mq = sub1(ani, ani->_ox - point.x, ani->_oy - point.y, ani->_movement->_staticsObj1->_staticsId, x, y, 0, fuzzyMatch);
+ MessageQueue *mq = sub1(ani, ani->_ox - point.x, ani->_oy - point.y, ani->_movement->_staticsObj1->_staticsId, xpos, ypos, 0, fuzzyMatch);
if (!mq || !mq->getExCommandByIndex(0))
return 0;
@@ -655,10 +653,10 @@ MessageQueue *MovGraph::method34(StaticANIObject *ani, int xpos, int ypos, int f
ex = new ExCommand(ani->_id, 21, 0, 0, 0, 0, 1, 0, 0, 0);
ex->_keyCode = ani->_okeyCode;
ex->_field_3C = 1;
- ex->msg._field_24 = 0;
+ ex->_field_24 = 0;
mq->addExCommandToEnd(ex);
- ex = new ExCommand(ani->_id, 51, 0, x, y, 0, 1, 0, 0, 0);
+ ex = new ExCommand(ani->_id, 51, 0, xpos, ypos, 0, 1, 0, 0, 0);
ex->_keyCode = ani->_okeyCode;
ex->_field_3C = 1;
ex->_field_24 = 0;
@@ -673,22 +671,17 @@ MessageQueue *MovGraph::method34(StaticANIObject *ani, int xpos, int ypos, int f
return 0;
}
- StaticANIObject *ani2;
+ int count2;
ani->setSomeDynamicPhaseIndex(ex->_field_14);
- method28(ani, x, y, fuzzyMatch, ani2);
+ method28(ani, xpos, ypos, fuzzyMatch, &count2);
- int idx = getItemIndexByStaticAni(ani2);
- v33 = this->_items[idx].count;
- v20 = this->_items[idx].movitems;
+ int idx = getItemIndexByStaticAni(ani);
+ count = _items[idx]->count;
+ movitems = _items[idx]->movitems;
}
- v32 = this->_callback1(ani, v20, v33);
- return method50(ani, v32, mq);
-#endif
- warning("STUB: MovGraph::method34()");
-
- return 0;
+ return method50(ani, _callback1(ani, movitems, count), staticsId);
}
int MovGraph::changeCallback() {
@@ -825,7 +818,7 @@ MessageQueue *MovGraph::fillMGMinfo(StaticANIObject *ani, MovArr *movarr, int st
return 0;
}
-int MovGraph::method50() {
+MessageQueue *MovGraph::method50(StaticANIObject *ani, Common::Array<MovArr *> *movarr, int staticsId) {
warning("STUB: MovGraph::method50()");
return 0;
diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h
index cfbca1d8a4..fc199e305b 100644
--- a/engines/fullpipe/motion.h
+++ b/engines/fullpipe/motion.h
@@ -368,7 +368,7 @@ public:
virtual int 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 int method50();
+ virtual MessageQueue *method50(StaticANIObject *ani, Common::Array<MovArr *> *movarr, int staticsId);
double calcDistance(Common::Point *point, MovGraphLink *link, int fuzzyMatch);
void calcNodeDistancesAndAngles();