[Scummvm-cvs-logs] scummvm master -> 71002e26e7f798a583d408f0154d204ae65e29be

sev- sev at scummvm.org
Sun May 4 09:42:50 CEST 2014


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
71002e26e7 FULLPIPE: Implement MovGraph::freeItems()


Commit: 71002e26e7f798a583d408f0154d204ae65e29be
    https://github.com/scummvm/scummvm/commit/71002e26e7f798a583d408f0154d204ae65e29be
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-05-04T10:41:36+03:00

Commit Message:
FULLPIPE: Implement MovGraph::freeItems()

Changed paths:
    engines/fullpipe/motion.cpp
    engines/fullpipe/motion.h



diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index a1ad4de..8aa8794 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 aa1fa43..396fc65 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 {






More information about the Scummvm-git-logs mailing list