diff options
-rw-r--r-- | engines/fullpipe/motion.cpp | 17 | ||||
-rw-r--r-- | engines/fullpipe/motion.h | 21 |
2 files changed, 26 insertions, 12 deletions
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index a1ad4de89f..8aa879477f 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -507,7 +507,7 @@ bool MctlCompoundArray::load(MfcArchive &file) { MovGraphItem::MovGraphItem() { ani = 0; field_4 = 0; - field_8 = 0; + movarr = 0; field_C = 0; field_10 = 0; field_14 = 0; @@ -523,6 +523,10 @@ MovGraphItem::MovGraphItem() { field_3C = 0; } +void MovGraphItem::free() { + warning("STUB: MovGraphItem::free()"); +} + int MovGraph_messageHandler(ExCommand *cmd); int MovGraphCallback(int a1, int a2, int a3) { @@ -576,7 +580,16 @@ int MovGraph::removeObject(StaticANIObject *obj) { } void MovGraph::freeItems() { - warning("STUB: MovGraph::freeItems()"); + for (uint i = 0; i < _items.size(); i++) { + _items[i]->free(); + + for (int j = 0; j < _items[i]->movarr->size(); j++) + delete (_items[i]->movarr)->operator[](j); + + delete _items[i]->movarr; + } + + _items.clear(); } int MovGraph::method28() { diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h index aa1fa436c2..396fc6578f 100644 --- a/engines/fullpipe/motion.h +++ b/engines/fullpipe/motion.h @@ -299,10 +299,19 @@ class MovGraphLink : public CObject { void calcNodeDistanceAndAngle(); }; +struct MovArr { + int _afield_0; + int _afield_4; + int _afield_8; + MovGraphLink *_link; + double _dist; + Common::Point _point; +}; + struct MovGraphItem { StaticANIObject *ani; int field_4; - int field_8; + Common::Array<MovArr *> *movarr; int field_C; int field_10; int field_14; @@ -318,15 +327,7 @@ struct MovGraphItem { int field_3C; MovGraphItem(); -}; - -struct MovArr { - int _afield_0; - int _afield_4; - int _afield_8; - MovGraphLink *_link; - double _dist; - Common::Point _point; + void free(); }; class MovGraph : public MotionController { |