From 97204c20dc5365388b13117e994ba6eeaeb3588d Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Tue, 2 Jul 2024 14:13:05 +0200 Subject: [PATCH] Recast: light formatting improvements Keep the style consistent with the rest. --- .../DebugUtils/Source/DetourDebugDraw.cpp | 1 + .../recast/Detour/Include/DetourNavMesh.h | 40 +++++++++---------- .../Detour/Include/DetourNavMeshQuery.h | 1 + .../recast/Detour/Source/DetourNavMesh.cpp | 12 +++--- .../Source/DetourTileCacheBuilder.cpp | 2 +- 5 files changed, 29 insertions(+), 27 deletions(-) diff --git a/src/thirdparty/recast/DebugUtils/Source/DetourDebugDraw.cpp b/src/thirdparty/recast/DebugUtils/Source/DetourDebugDraw.cpp index 715d9b06..2b3db83e 100644 --- a/src/thirdparty/recast/DebugUtils/Source/DetourDebugDraw.cpp +++ b/src/thirdparty/recast/DebugUtils/Source/DetourDebugDraw.cpp @@ -468,6 +468,7 @@ void duDebugDrawNavMeshPoly(duDebugDraw* dd, const dtNavMesh& mesh, dtPolyRef re duAppendArc(dd, con->pos[0],con->pos[1],con->pos[2], con->pos[3],con->pos[4],con->pos[5], 0.25f, (con->flags & DT_OFFMESH_CON_BIDIR) ? 30.0f : 0.0f, 30.0f, c); + // Reference positions. drawOffMeshConnectionRefPosition(dd, con); dd->end(); diff --git a/src/thirdparty/recast/Detour/Include/DetourNavMesh.h b/src/thirdparty/recast/Detour/Include/DetourNavMesh.h index 1c0a8f6e..4b6147d1 100644 --- a/src/thirdparty/recast/Detour/Include/DetourNavMesh.h +++ b/src/thirdparty/recast/Detour/Include/DetourNavMesh.h @@ -70,13 +70,13 @@ static const int DT_VERTS_PER_POLYGON = 6; /// /// A magic number used to detect compatibility of navigation tile data. -static const int DT_NAVMESH_MAGIC = 'D' << 24 | 'N' << 16 | 'A' << 8 | 'V'; +static const int DT_NAVMESH_MAGIC = 'D'<<24 | 'N'<<16 | 'A'<<8 | 'V'; /// A version number used to detect compatibility of navigation tile data. static const int DT_NAVMESH_VERSION = 16; /// A magic number used to detect the compatibility of navigation tile states. -static const int DT_NAVMESH_STATE_MAGIC = 'D' << 24 | 'N' << 16 | 'M' << 8 | 'S'; +static const int DT_NAVMESH_STATE_MAGIC = 'D'<<24 | 'N'<<16 | 'M'<<8 | 'S'; /// A version number used to detect compatibility of navigation tile states. static const int DT_NAVMESH_STATE_VERSION = 1; @@ -583,9 +583,9 @@ public: inline dtPolyRef encodePolyId(unsigned int salt, unsigned int it, unsigned int ip) const { #ifdef DT_POLYREF64 - return ((dtPolyRef)salt << (DT_POLY_BITS + DT_TILE_BITS)) | ((dtPolyRef)it << DT_POLY_BITS) | (dtPolyRef)ip; + return ((dtPolyRef)salt << (DT_POLY_BITS+DT_TILE_BITS)) | ((dtPolyRef)it << DT_POLY_BITS) | (dtPolyRef)ip; #else - return ((dtPolyRef)salt << (m_polyBits + m_tileBits)) | ((dtPolyRef)it << m_polyBits) | (dtPolyRef)ip; + return ((dtPolyRef)salt << (m_polyBits+m_tileBits)) | ((dtPolyRef)it << m_polyBits) | (dtPolyRef)ip; #endif } @@ -599,17 +599,17 @@ public: inline void decodePolyId(dtPolyRef ref, unsigned int& salt, unsigned int& it, unsigned int& ip) const { #ifdef DT_POLYREF64 - const dtPolyRef saltMask = ((dtPolyRef)1 << DT_SALT_BITS) - 1; - const dtPolyRef tileMask = ((dtPolyRef)1 << DT_TILE_BITS) - 1; - const dtPolyRef polyMask = ((dtPolyRef)1 << DT_POLY_BITS) - 1; - salt = (unsigned int)((ref >> (DT_POLY_BITS + DT_TILE_BITS)) & saltMask); + const dtPolyRef saltMask = ((dtPolyRef)1<> (DT_POLY_BITS+DT_TILE_BITS)) & saltMask); it = (unsigned int)((ref >> DT_POLY_BITS) & tileMask); ip = (unsigned int)(ref & polyMask); #else - const dtPolyRef saltMask = ((dtPolyRef)1 << m_saltBits) - 1; - const dtPolyRef tileMask = ((dtPolyRef)1 << m_tileBits) - 1; - const dtPolyRef polyMask = ((dtPolyRef)1 << m_polyBits) - 1; - salt = (unsigned int)((ref >> (m_polyBits + m_tileBits)) & saltMask); + const dtPolyRef saltMask = ((dtPolyRef)1<> (m_polyBits+m_tileBits)) & saltMask); it = (unsigned int)((ref >> m_polyBits) & tileMask); ip = (unsigned int)(ref & polyMask); #endif @@ -622,11 +622,11 @@ public: inline unsigned int decodePolyIdSalt(dtPolyRef ref) const { #ifdef DT_POLYREF64 - const dtPolyRef saltMask = ((dtPolyRef)1 << DT_SALT_BITS) - 1; - return (unsigned int)((ref >> (DT_POLY_BITS + DT_TILE_BITS)) & saltMask); + const dtPolyRef saltMask = ((dtPolyRef)1<> (DT_POLY_BITS+DT_TILE_BITS)) & saltMask); #else - const dtPolyRef saltMask = ((dtPolyRef)1 << m_saltBits) - 1; - return (unsigned int)((ref >> (m_polyBits + m_tileBits)) & saltMask); + const dtPolyRef saltMask = ((dtPolyRef)1<> (m_polyBits+m_tileBits)) & saltMask); #endif } @@ -637,10 +637,10 @@ public: inline unsigned int decodePolyIdTile(dtPolyRef ref) const { #ifdef DT_POLYREF64 - const dtPolyRef tileMask = ((dtPolyRef)1 << DT_TILE_BITS) - 1; + const dtPolyRef tileMask = ((dtPolyRef)1<> DT_POLY_BITS) & tileMask); #else - const dtPolyRef tileMask = ((dtPolyRef)1 << m_tileBits) - 1; + const dtPolyRef tileMask = ((dtPolyRef)1<> m_polyBits) & tileMask); #endif } @@ -652,10 +652,10 @@ public: inline unsigned int decodePolyIdPoly(dtPolyRef ref) const { #ifdef DT_POLYREF64 - const dtPolyRef polyMask = ((dtPolyRef)1 << DT_POLY_BITS) - 1; + const dtPolyRef polyMask = ((dtPolyRef)1<