Skip to content

Commit

Permalink
FULLPIPE: Implement MovGraph::getBboxes()
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed May 7, 2014
1 parent 4571f3e commit 4d75beb
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
32 changes: 32 additions & 0 deletions engines/fullpipe/motion.cpp
Expand Up @@ -847,6 +847,38 @@ void MovGraph::shuffleTree(MovGraphLink *lnk, MovGraphLink *lnk2, Common::Array<
}
}

Common::Array<Common::Rect *> *MovGraph::getBboxes(MovArr *movarr1, MovArr *movarr2, int *listCount) {
Common::Array<MovGraphLink *> tempObList1;
Common::Array<MovGraphLink *> tempObList2;

shuffleTree(movarr1->_link, movarr2->_link, tempObList1, tempObList2);

*listCount = 0;

if (!tempObList2.size())
return 0;

*listCount = tempObList2.size();

Common::Array<Common::Rect *> *res = new Common::Array<Common::Rect *>;

for (uint i = 0; i < *listCount; i++) {
Common::Rect *r = new Common::Rect;

calcBbox(r, tempObList2[i], movarr1, movarr2);

delete tempObList2[i];
}

movarr2->_link = movarr1->_link;

return res;
}

void MovGraph::calcBbox(Common::Rect *rect, MovGraphLink *grlink, MovArr *movarr1, MovArr *movarr2) {
warning("STUB: MovGraph::calcBbox()");
}

int MovGraph2::getItemIndexByGameObjectId(int objectId) {
for (uint i = 0; i < _items2.size(); i++)
if (_items2[i]->_objectId == objectId)
Expand Down
2 changes: 2 additions & 0 deletions engines/fullpipe/motion.h
Expand Up @@ -364,6 +364,8 @@ class MovGraph : public MotionController {
int getItemIndexByStaticAni(StaticANIObject *ani);
Common::Array<MovArr *> *genMovArr(int x, int y, int *arrSize, int flag1, int flag2);
void shuffleTree(MovGraphLink *lnk, MovGraphLink *lnk2, Common::Array<MovGraphLink *> &tempObList1, Common::Array<MovGraphLink *> &tempObList2);
Common::Array<Common::Rect *> *getBboxes(MovArr *movarr1, MovArr *movarr2, int *listCount);
void calcBbox(Common::Rect *rect, MovGraphLink *grlink, MovArr *movarr1, MovArr *movarr2);
};

class Movement;
Expand Down

0 comments on commit 4d75beb

Please sign in to comment.