From 82f4e71d5604202ef364fb225f0dc7b527bd39c2 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 25 May 2014 12:50:09 +0300 Subject: FULLPIPE: Implement MovGraph::setEnds() --- engines/fullpipe/motion.cpp | 22 ++++++++++++++++++++++ engines/fullpipe/motion.h | 1 + 2 files changed, 23 insertions(+) diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index 2564096c04..9f34c8fab8 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -1296,6 +1296,28 @@ bool MovGraph::calcChunk(int idx, int x, int y, MovArr *arr, int a6) { return res; } +void MovGraph::setEnds(MovStep *step1, MovStep *step2) { + if (step1->link->_movGraphNode1 == step2->link->_movGraphNode2) { + step1->sfield_0 = 1; + step2->sfield_0 = 1; + + return; + } + + if (step1->link->_movGraphNode1 == step2->link->_movGraphNode1) { + step1->sfield_0 = 1; + step2->sfield_0 = 0; + } else { + step1->sfield_0 = 0; + + if (step1->link->_movGraphNode2 != step2->link->_movGraphNode1) { + step2->sfield_0 = 1; + } else { + step2->sfield_0 = 0; + } + } +} + int MovGraph2::getItemIndexByGameObjectId(int objectId) { for (uint i = 0; i < _items2.size(); i++) if (_items2[i]->_objectId == objectId) diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h index 2765cc3118..b72883174f 100644 --- a/engines/fullpipe/motion.h +++ b/engines/fullpipe/motion.h @@ -376,6 +376,7 @@ public: bool calcChunk(int idx, int x, int y, MovArr *arr, int a6); MessageQueue *sub1(StaticANIObject *ani, int x, int y, int a5, int x1, int y1, int a8, int a9); MessageQueue *fillMGMinfo(StaticANIObject *ani, MovArr *movarr, int staticsId); + void setEnds(MovStep *step1, MovStep *step2); }; class Movement; -- cgit v1.2.3