From ed62aca66c33272787d8b70727335c10790a8133 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 2 Oct 2016 15:46:19 +0200 Subject: FULLPIPE: Implement MotionController::enableLinks() --- engines/fullpipe/motion.cpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'engines/fullpipe') diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index 331799f9b5..e5eb9721f4 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -38,7 +38,31 @@ bool MotionController::load(MfcArchive &file) { } void MotionController::enableLinks(const char *linkName, bool enable) { - warning("STUB: MotionController::enableLinks()"); + if (_objtype != kObjTypeMctlCompound) + return; + + 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, linkName)) { + if (enable) + lnk->_flags |= 0x20000000; + else + lnk->_flags &= 0xDFFFFFFF; + } + } + } + } } MovGraphLink *MotionController::getLinkByName(const char *name) { -- cgit v1.2.3