[Scummvm-cvs-logs] scummvm master -> 8880077ec3899fc7bf752c5ede2434505b948157

sev- sev at scummvm.org
Thu Oct 17 00:00:03 CEST 2013


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:
8880077ec3 FULLPIPE: Implement MovGraph2::findNode()


Commit: 8880077ec3899fc7bf752c5ede2434505b948157
    https://github.com/scummvm/scummvm/commit/8880077ec3899fc7bf752c5ede2434505b948157
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-10-16T14:55:34-07:00

Commit Message:
FULLPIPE: Implement MovGraph2::findNode()

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



diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index 53b2906..aced36f 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -796,7 +796,19 @@ MessageQueue *MovGraph2::doWalkTo(StaticANIObject *obj, int xpos, int ypos, int
 }
 
 MovGraphNode *MovGraph2::findNode(int x, int y, int fuzzyMatch) {
-	warning("STUB: MovGraphLink *MovGraph2::findNode()");
+	for (ObList::iterator i = _nodes.begin(); i != _nodes.end(); ++i) {
+		assert(((CObject *)*i)->_objtype == kObjTypeMovGraphNode);
+
+		MovGraphNode *node = (MovGraphNode *)*i;
+
+		if (fuzzyMatch) {
+			if (abs(node->_x - x) < 15 && abs(node->_y - y) < 15)
+				return node;
+		} else {
+			if (node->_x == x && node->_y == y)
+				return node;
+		}
+	}
 
 	return 0;
 }
diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h
index eedc292..6901a72 100644
--- a/engines/fullpipe/motion.h
+++ b/engines/fullpipe/motion.h
@@ -147,15 +147,15 @@ public:
 };
 
 class MovGraphNode : public CObject {
- public:
+public:
 	int _x;
 	int _y;
 	int _distance;
 	int16 _field_10;
 	int _field_14;
 
-  public:
-	MovGraphNode() : _x(0), _y(0), _distance(0), _field_10(0), _field_14(0) {}
+public:
+	MovGraphNode() : _x(0), _y(0), _distance(0), _field_10(0), _field_14(0) { _objtype = kObjTypeMovGraphNode; }
 	virtual bool load(MfcArchive &file);
 };
 
diff --git a/engines/fullpipe/utils.h b/engines/fullpipe/utils.h
index e593bd9..d976e09 100644
--- a/engines/fullpipe/utils.h
+++ b/engines/fullpipe/utils.h
@@ -66,15 +66,16 @@ class MfcArchive : public Common::SeekableReadStream {
 
 enum ObjType {
 	kObjTypeDefault,
+	kObjTypeMovGraph,
+	kObjTypeMovGraphNode,
+	kObjTypeMctlCompound,
 	kObjTypeObjstateCommand,
-	kObjTypeStaticANIObject,
 	kObjTypePictureObject,
-	kObjTypeMovGraph,
-	kObjTypeMctlCompound
+	kObjTypeStaticANIObject
 };
 
 class CObject {
- public:
+public:
 	ObjType _objtype;
 
 	CObject() : _objtype(kObjTypeDefault) {}






More information about the Scummvm-git-logs mailing list