aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe/motion.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2013-10-17 00:55:34 +0300
committerEugene Sandulenko2013-10-17 00:55:34 +0300
commit8880077ec3899fc7bf752c5ede2434505b948157 (patch)
tree8899c73bf3dffe996c21abb0a4cd1a34d1d18e59 /engines/fullpipe/motion.cpp
parent1cfafc6cfd8b7de11c1bb28df082199092e5774c (diff)
downloadscummvm-rg350-8880077ec3899fc7bf752c5ede2434505b948157.tar.gz
scummvm-rg350-8880077ec3899fc7bf752c5ede2434505b948157.tar.bz2
scummvm-rg350-8880077ec3899fc7bf752c5ede2434505b948157.zip
FULLPIPE: Implement MovGraph2::findNode()
Diffstat (limited to 'engines/fullpipe/motion.cpp')
-rw-r--r--engines/fullpipe/motion.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index 53b2906599..aced36fa79 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;
}