From 02aa7acd4afba5ee67b575273101a02ab4fb0573 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Tue, 2 Jul 2024 01:24:46 +0200 Subject: [PATCH] Recast: update dtNode parent bit counts DT_NODE_PARENT_BITS has been changed to 19 in r2 and r5. All bit masks align 1:1 after this change. DT_NODE_STATE_BITS is confirmed to be 2 by r2's implementation of dtNavMeshQuery::isInClosedList. dtNode::flags is 3 bits as the bitmask constants compiled in after changing DT_NODE_PARENT_BITS, are identical for all enumerants of dtNodeFlags. --- src/thirdparty/recast/Detour/Include/DetourNode.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/thirdparty/recast/Detour/Include/DetourNode.h b/src/thirdparty/recast/Detour/Include/DetourNode.h index 99666925..ee8b155e 100644 --- a/src/thirdparty/recast/Detour/Include/DetourNode.h +++ b/src/thirdparty/recast/Detour/Include/DetourNode.h @@ -23,15 +23,15 @@ enum dtNodeFlags { - DT_NODE_OPEN = 0x01, - DT_NODE_CLOSED = 0x02, - DT_NODE_PARENT_DETACHED = 0x04, // parent of the node is not adjacent. Found using raycast. + DT_NODE_OPEN = (1<<0), + DT_NODE_CLOSED = (1<<1), + DT_NODE_PARENT_DETACHED = (1<<2), // parent of the node is not adjacent. Found using raycast. }; typedef unsigned short dtNodeIndex; static const dtNodeIndex DT_NULL_IDX = (dtNodeIndex)~0; -static const int DT_NODE_PARENT_BITS = 24; +static const int DT_NODE_PARENT_BITS = 19; static const int DT_NODE_STATE_BITS = 2; struct dtNode {