MCPcopy Create free account
hub / github.com/doldecomp/mkdd / recursiveTargetCalcBack

Method recursiveTargetCalcBack

src/Sato/ItemFlyTurtle.cpp:777–806  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

775}
776
777void CLPointControllerFlyTurtle::recursiveTargetCalcBack(CLPoint *point, int groupID, int *pPointNo, u8 *pCount, bool *pFoundTarget) {
778 (*pCount)++;
779 if(*pCount > 2)
780 return;
781 int prevPointNo = point->getPrevPointNumber();
782 if(prevPointNo == 1) {
783 for(int i = 0; i < 1; i++) {} // fakematch, affects inline depth
784 if(point->getPrevPoint(0)->getNextPointNumber() < 2)
785 return;
786 }
787
788 for(int i = 0; i < prevPointNo; i++) {
789 if(*pCount == 1) {
790 *pPointNo = i;
791 }
792 CLPoint *prevPoint = point->getPrevPoint(i);
793 u8 prevGroupID = prevPoint->getGroupID();
794 if(prevGroupID == groupID)
795 *pFoundTarget = true;
796 else {
797 CLPoint *div = prevPoint->getDivPoint();
798 if (div) {
799 recursiveTargetCalcBack(div, groupID, pPointNo, pCount, pFoundTarget);
800 (*pCount)--;
801 }
802 }
803 if(*pFoundTarget)
804 return;
805 }
806}
807
808#include "JSystem/JAudio/JASFakeMatch2.h"

Callers

nothing calls this directly

Calls 5

getPrevPointNumberMethod · 0.80
getNextPointNumberMethod · 0.80
getPrevPointMethod · 0.80
getDivPointMethod · 0.80
getGroupIDMethod · 0.45

Tested by

no test coverage detected