Recast: split dtLink::flags into actual fields

Its split into 3 separate fields, this will be used in the future for fixing jump links between poly's.
This commit is contained in:
Kawe Mazidjatari 2024-07-03 11:59:52 +02:00
parent d03dfe645f
commit f999c6ae6d
2 changed files with 22 additions and 7 deletions

View File

@ -227,7 +227,9 @@ struct dtLink
unsigned char side; ///< If a boundary link, defines on which side the link is.
unsigned char bmin; ///< If a boundary link, defines the minimum sub-edge area.
unsigned char bmax; ///< If a boundary link, defines the maximum sub-edge area.
unsigned int flags;
unsigned char jumpType;
unsigned char otherUnk;
unsigned short reverseLinkIndex;
};
/// Bounding volume node.

View File

@ -425,7 +425,10 @@ void dtNavMesh::connectExtLinks(dtMeshTile* tile, dtMeshTile* target, int side)
link->next = poly->firstLink;
poly->firstLink = idx;
link->flags = 0xffff00ff;
link->jumpType = 0xFF;
link->otherUnk = 0;
link->reverseLinkIndex = 0xFFFF;
// Compress portal limits to a byte value.
if (dir == 0 || dir == 4)
@ -498,7 +501,9 @@ void dtNavMesh::connectExtOffMeshLinks(dtMeshTile* tile, dtMeshTile* target, int
// Add to linked list.
link->next = targetPoly->firstLink;
targetPoly->firstLink = idx;
link->flags = 0xffff00ff;
link->jumpType = 0xFF;
link->otherUnk = 0;
link->reverseLinkIndex = 0xFFFF;
}
// Link target poly to off-mesh connection.
@ -517,7 +522,9 @@ void dtNavMesh::connectExtOffMeshLinks(dtMeshTile* tile, dtMeshTile* target, int
// Add to linked list.
link->next = landPoly->firstLink;
landPoly->firstLink = tidx;
link->flags = 0xffff00ff;
link->jumpType = 0xFF;
link->otherUnk = 0;
link->reverseLinkIndex = 0xFFFF;
}
}
}
@ -555,7 +562,9 @@ void dtNavMesh::connectIntLinks(dtMeshTile* tile)
// Add to linked list.
link->next = poly->firstLink;
poly->firstLink = idx;
link->flags = 0xffff00ff;
link->jumpType = 0xFF;
link->otherUnk = 0;
link->reverseLinkIndex = 0xFFFF;
}
}
}
@ -599,7 +608,9 @@ void dtNavMesh::baseOffMeshLinks(dtMeshTile* tile)
// Add to linked list.
link->next = poly->firstLink;
poly->firstLink = idx;
link->flags = 0xffff00ff;
link->jumpType = 0xFF;
link->otherUnk = 0;
link->reverseLinkIndex = 0xFFFF;
}
// Start end-point is always connect back to off-mesh connection.
@ -616,7 +627,9 @@ void dtNavMesh::baseOffMeshLinks(dtMeshTile* tile)
// Add to linked list.
link->next = landPoly->firstLink;
landPoly->firstLink = tidx;
link->flags = 0xffff00ff;
link->jumpType = 0xFF;
link->otherUnk = 0;
link->reverseLinkIndex = 0xFFFF;
}
}
}