FULLPIPE: Implement MotionController::getLinkByName()

This commit is contained in:
Eugene Sandulenko 2013-12-29 23:50:15 +02:00
parent b10bc540a3
commit ec6da5a450
2 changed files with 36 additions and 1 deletions
engines/fullpipe

@ -47,7 +47,39 @@ void MotionController::enableLinks(const char *linkName, bool enable) {
}
MovGraphLink *MotionController::getLinkByName(const char *name) {
warning("STUB: MotionController::getLinkByName()");
if (_objtype == kObjTypeMctlCompound) {
MctlCompound *obj = (MctlCompound *)this;
for (uint i = 0; i < obj->getMotionControllerCount(); i++) {
MotionController *con = obj->getMotionController(i);
if (con->_objtype == kObjTypeMovGraph) {
MovGraph *gr = (MovGraph *)con;
for (ObList::iterator l = gr->_links.begin(); l != gr->_links.end(); ++l) {
assert(((CObject *)*l)->_objtype == kObjTypeMovGraphLink);
MovGraphLink *lnk = (MovGraphLink *)*l;
if (!strcmp(lnk->_name, name))
return lnk;
}
}
}
}
if (_objtype == kObjTypeMovGraph) {
MovGraph *gr = (MovGraph *)this;
for (ObList::iterator l = gr->_links.begin(); l != gr->_links.end(); ++l) {
assert(((CObject *)*l)->_objtype == kObjTypeMovGraphLink);
MovGraphLink *lnk = (MovGraphLink *)*l;
if (!strcmp(lnk->_name, name))
return lnk;
}
}
return 0;
}

@ -115,6 +115,9 @@ public:
void initMovGraph2();
MctlConnectionPoint *findClosestConnectionPoint(int ox, int oy, int destIndex, int connectionX, int connectionY, int sourceIndex, int *minDistancePtr);
void replaceNodeX(int from, int to);
uint getMotionControllerCount() { return _motionControllers.size(); }
MotionController *getMotionController(int num) { return _motionControllers[num]->_motionControllerObj; }
};
struct MGMSubItem {