diff options
Diffstat (limited to 'engines/fullpipe')
-rw-r--r-- | engines/fullpipe/motion.cpp | 44 | ||||
-rw-r--r-- | engines/fullpipe/motion.h | 26 |
2 files changed, 65 insertions, 5 deletions
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index da0c614e72..283777041a 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -140,6 +140,25 @@ bool MctlCompoundArray::load(MfcArchive &file) { return true; } +MovGraphItem::MovGraphItem() { + ani = 0; + field_4 = 0; + field_8 = 0; + field_C = 0; + field_10 = 0; + field_14 = 0; + field_18 = 0; + field_1C = 0; + field_20 = 0; + field_24 = 0; + items = 0; + count = 0; + field_30 = 0; + field_34 = 0; + field_38 = 0; + field_3C = 0; +} + int MovGraph_messageHandler(ExCommand *cmd); int MovGraphCallback(int a1, int a2, int a3) { @@ -149,8 +168,6 @@ int MovGraphCallback(int a1, int a2, int a3) { } MovGraph::MovGraph() { - _itemsCount = 0; - _items = 0; _callback1 = MovGraphCallback; _field_44 = 0; insertMessageHandler(MovGraph_messageHandler, getMessageHandlersCount() - 1, 129); @@ -168,7 +185,20 @@ bool MovGraph::load(MfcArchive &file) { } void MovGraph::addObject(StaticANIObject *obj) { - warning("STUB: MovGraph::addObject()"); + _mgm.clear(); + _mgm.addItem(obj->_id); + + for (uint i = 0; i < _items.size(); i++) + if (_items[i]->ani == obj) + return; + + MovGraphItem *item = new MovGraphItem(); + + item->ani = obj; + + _items.push_back(item); + + _mgm.addItem(obj->_id); // FIXME: Is it really needed? } int MovGraph::removeObject(StaticANIObject *obj) { @@ -448,6 +478,14 @@ MovGraphNode *MovGraph::calcOffset(int ox, int oy) { return 0; } +void MGM::clear() { + warning("STUB: MGM:clear()"); +} + +void MGM::addItem(int objId) { + warning("STUB: MGM:addItem(%d)", objId); +} + MovGraphLink::MovGraphLink() { _distance = 0; _angle = 0; diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h index 00c6404690..23472297a9 100644 --- a/engines/fullpipe/motion.h +++ b/engines/fullpipe/motion.h @@ -107,6 +107,8 @@ public: public: MGM() : _items(0), _count(0) {} + void clear(); + void addItem(int objId); }; class MovGraphNode : public CObject { @@ -170,13 +172,33 @@ class MovGraphLink : public CObject { virtual bool load(MfcArchive &file); }; +struct MovGraphItem { + StaticANIObject *ani; + int field_4; + int field_8; + int field_C; + int field_10; + int field_14; + int field_18; + int field_1C; + int field_20; + int field_24; + int items; + int count; + int field_30; + int field_34; + int field_38; + int field_3C; + + MovGraphItem(); +}; + class MovGraph : public MotionController { public: ObList _nodes; ObList _links; int _field_44; - int _items; - int _itemsCount; + Common::Array<MovGraphItem *> _items; int (*_callback1)(int, int, int); MGM _mgm; |