FULLPIPE: Implement MovGraph2::findNode()

This commit is contained in:
Eugene Sandulenko 2013-10-17 00:55:34 +03:00
parent 1cfafc6cfd
commit 8880077ec3
3 changed files with 22 additions and 9 deletions

View File

@ -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;
}

View File

@ -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);
};

View File

@ -66,15 +66,16 @@ class MfcArchive : public Common::SeekableReadStream {
enum ObjType {
kObjTypeDefault,
kObjTypeObjstateCommand,
kObjTypeStaticANIObject,
kObjTypePictureObject,
kObjTypeMovGraph,
kObjTypeMctlCompound
kObjTypeMovGraphNode,
kObjTypeMctlCompound,
kObjTypeObjstateCommand,
kObjTypePictureObject,
kObjTypeStaticANIObject
};
class CObject {
public:
public:
ObjType _objtype;
CObject() : _objtype(kObjTypeDefault) {}