Recast: add missing prefix to utility function

Needs to be prefixed with 'dt' for consistency and to avoid cluttering the global namespace.
This commit is contained in:
Amos 2024-07-21 22:27:55 +02:00
parent 79cbf2e1dd
commit bff3bfd5ea
3 changed files with 7 additions and 7 deletions

View File

@ -842,14 +842,14 @@ private:
/// @param[in] polyGroup2 The poly group ID of the second island. /// @param[in] polyGroup2 The poly group ID of the second island.
/// @return The cell index for the static traversal table. /// @return The cell index for the static traversal table.
/// @ingroup detour /// @ingroup detour
int calcTraversalTableCellIndex(const int numPolyGroups, int dtCalcTraversalTableCellIndex(const int numPolyGroups,
const unsigned short polyGroup1, const unsigned short polyGroup2); const unsigned short polyGroup1, const unsigned short polyGroup2);
/// Returns the total size needed for the static traversal table. /// Returns the total size needed for the static traversal table.
/// @param[in] numPolyGroups The total number of poly groups. /// @param[in] numPolyGroups The total number of poly groups.
/// @return the total size needed for the static traversal table. /// @return the total size needed for the static traversal table.
/// @ingroup detour /// @ingroup detour
int calcTraversalTableSize(const int numPolyGroups); int dtCalcTraversalTableSize(const int numPolyGroups);
/// Defines a navigation mesh tile data block. /// Defines a navigation mesh tile data block.
/// @ingroup detour /// @ingroup detour

View File

@ -130,13 +130,13 @@ inline void freeLink(dtMeshTile* tile, unsigned int link)
tile->linksFreeList = link; tile->linksFreeList = link;
} }
int calcTraversalTableCellIndex(const int numPolyGroups, int dtCalcTraversalTableCellIndex(const int numPolyGroups,
const unsigned short polyGroup1, const unsigned short polyGroup2) const unsigned short polyGroup1, const unsigned short polyGroup2)
{ {
return polyGroup1*((numPolyGroups+(RD_BITS_PER_BIT_CELL-1))/RD_BITS_PER_BIT_CELL)+(polyGroup2/RD_BITS_PER_BIT_CELL); return polyGroup1*((numPolyGroups+(RD_BITS_PER_BIT_CELL-1))/RD_BITS_PER_BIT_CELL)+(polyGroup2/RD_BITS_PER_BIT_CELL);
} }
int calcTraversalTableSize(const int numPolyGroups) int dtCalcTraversalTableSize(const int numPolyGroups)
{ {
return sizeof(int)*(numPolyGroups*((numPolyGroups+(RD_BITS_PER_BIT_CELL-1))/RD_BITS_PER_BIT_CELL)); return sizeof(int)*(numPolyGroups*((numPolyGroups+(RD_BITS_PER_BIT_CELL-1))/RD_BITS_PER_BIT_CELL));
} }
@ -1351,7 +1351,7 @@ bool dtNavMesh::isGoalPolyReachable(const dtPolyRef fromRef, const dtPolyRef goa
return true; return true;
const int polyGroupCount = m_params.polyGroupCount; const int polyGroupCount = m_params.polyGroupCount;
const int fromPolyBitCell = traversalTable[calcTraversalTableCellIndex(polyGroupCount, fromPolyGroupId, goalPolyGroupId)]; const int fromPolyBitCell = traversalTable[dtCalcTraversalTableCellIndex(polyGroupCount, fromPolyGroupId, goalPolyGroupId)];
// Check if the bit corresponding to our goal poly is set, if it isn't then // Check if the bit corresponding to our goal poly is set, if it isn't then
// there are no available traversal links from the current poly to the goal. // there are no available traversal links from the current poly to the goal.

View File

@ -267,7 +267,7 @@ static unsigned char classifyOffMeshPoint(const float* pt, const float* bmin, co
static void setPolyGroupsTraversalReachability(int* const tableData, const int numPolyGroups, static void setPolyGroupsTraversalReachability(int* const tableData, const int numPolyGroups,
const unsigned short polyGroup1, const unsigned short polyGroup2, const bool isReachable) const unsigned short polyGroup1, const unsigned short polyGroup2, const bool isReachable)
{ {
const int index = calcTraversalTableCellIndex(numPolyGroups, polyGroup1, polyGroup2); const int index = dtCalcTraversalTableCellIndex(numPolyGroups, polyGroup1, polyGroup2);
const int value = 1<<(polyGroup2 & 31); const int value = 1<<(polyGroup2 & 31);
if (isReachable) if (isReachable)
@ -463,7 +463,7 @@ bool dtCreateDisjointPolyGroups(dtNavMesh* nav, dtDisjointSet& disjoint)
bool dtCreateTraversalTableData(dtNavMesh* nav, const dtDisjointSet& disjoint, const int tableCount) bool dtCreateTraversalTableData(dtNavMesh* nav, const dtDisjointSet& disjoint, const int tableCount)
{ {
const int polyGroupCount = nav->getPolyGroupCount(); const int polyGroupCount = nav->getPolyGroupCount();
const int tableSize = calcTraversalTableSize(polyGroupCount); const int tableSize = dtCalcTraversalTableSize(polyGroupCount);
// TODO: currently we allocate 5 buffers and just copy the same traversal // TODO: currently we allocate 5 buffers and just copy the same traversal
// tables in, this works fine since we don't generate jump links and // tables in, this works fine since we don't generate jump links and