mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Recast: draw crosses in dark color if a reverse link is broken
This commit is contained in:
parent
272818ade0
commit
f6e27b8b86
@ -354,15 +354,22 @@ static void drawTraverseLinks(duDebugDraw* dd, const dtNavMesh& mesh, const dtNa
|
||||
dd->vertex(targetStartPos, col);
|
||||
dd->vertex(targetEndPos, col);
|
||||
|
||||
const bool hasReverseLink = link->reverseLink != DT_NULL_TRAVERSE_REVERSE_LINK;
|
||||
bool hasValidReverseLink = false;
|
||||
|
||||
if (hasReverseLink)
|
||||
if (link->reverseLink != DT_NULL_TRAVERSE_REVERSE_LINK)
|
||||
{
|
||||
// If the reverse link is set, render white crosses to confirm
|
||||
// the links are set properly.
|
||||
duAppendCross(dd, startPos[0], startPos[1], startPos[2], 10.f, duRGBA(255,255,255,196));
|
||||
dtLink& reverseLink = endTile->links[link->reverseLink];
|
||||
|
||||
if (reverseLink.ref == basePolyRef)
|
||||
hasValidReverseLink = true;
|
||||
}
|
||||
|
||||
// If the reverse link is set, render light crosses to confirm
|
||||
// the links are set properly, else render dark which will make
|
||||
// them look incomplete.
|
||||
const unsigned int crossCol = hasValidReverseLink ? duRGBA(255, 255, 255, 196) : duRGBA(0, 0, 0, 196);
|
||||
duAppendCross(dd, startPos[0], startPos[1], startPos[2], 10.f, crossCol);
|
||||
|
||||
dd->end();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user