From f999c6ae6dc720c21398efb6bfa511d10ea15ea5 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Wed, 3 Jul 2024 11:59:52 +0200 Subject: [PATCH] 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. --- .../recast/Detour/Include/DetourNavMesh.h | 4 ++- .../recast/Detour/Source/DetourNavMesh.cpp | 25 ++++++++++++++----- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/thirdparty/recast/Detour/Include/DetourNavMesh.h b/src/thirdparty/recast/Detour/Include/DetourNavMesh.h index 0ee390df..026f56da 100644 --- a/src/thirdparty/recast/Detour/Include/DetourNavMesh.h +++ b/src/thirdparty/recast/Detour/Include/DetourNavMesh.h @@ -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. diff --git a/src/thirdparty/recast/Detour/Source/DetourNavMesh.cpp b/src/thirdparty/recast/Detour/Source/DetourNavMesh.cpp index a84c509d..3e37133b 100644 --- a/src/thirdparty/recast/Detour/Source/DetourNavMesh.cpp +++ b/src/thirdparty/recast/Detour/Source/DetourNavMesh.cpp @@ -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; } } }