Recast: fix compile error caused by missed version checks

This commit is contained in:
Amos 2024-07-24 10:26:41 +02:00
parent 1c637230d5
commit 2a45ced5f4
4 changed files with 11 additions and 1 deletions

View File

@ -447,7 +447,9 @@ bool Editor_TileMesh::handleBuild()
params.polyGroupCount = 0;
params.traversalTableSize = 0;
params.traversalTableCount = NavMesh_GetTraversalTableCountForNavMeshType(m_selectedNavMeshType);
#if DT_NAVMESH_SET_VERSION >= 8
params.magicDataCount = 0;
#endif
dtStatus status;

View File

@ -202,6 +202,10 @@ static void drawTileCells(duDebugDraw* dd, const dtMeshTile* tile, const float*
const dtCell& probe = tile->cells[i];
duDebugDrawCross(dd, probe.pos[0], probe.pos[1], probe.pos[2], 25.f, duRGBA(255,0,0,255), 2, offset);
}
#else
rdIgnoreUnused(dd);
rdIgnoreUnused(tile);
rdIgnoreUnused(offset);
#endif
}

View File

@ -24,7 +24,7 @@
// NOTE: these are defines as we need to be able to switch between code that is
// dedicated for each version, during compile time.
#define DT_NAVMESH_SET_VERSION 9 // Public versions: 5,7,8,9.
#define DT_NAVMESH_SET_VERSION 8 // Public versions: 5,7,8,9.
#define DT_NAVMESH_SET_MAGIC ('M'<<24 | 'S'<<16 | 'E'<<8 | 'T')
int dtGetNavMeshVersionForSet(const int setVersion);
@ -395,7 +395,9 @@ struct dtMeshHeader
int bvNodeCount; ///< The number of bounding volume nodes. (Zero if bounding volumes are disabled.)
int offMeshConCount; ///< The number of off-mesh connections.
int offMeshBase; ///< The index of the first polygon which is an off-mesh connection.
#if DT_NAVMESH_SET_VERSION >= 8
int maxCellCount; ///< The number of allocated cells.
#endif
float walkableHeight; ///< The height of the agents using the tile.
float walkableRadius; ///< The radius of the agents using the tile.

View File

@ -315,7 +315,9 @@ dtStatus dtNavMesh::init(unsigned char* data, const int dataSize, const int tabl
params.polyGroupCount = 0;
params.traversalTableSize = 0;
params.traversalTableCount = tableCount;
#if DT_NAVMESH_SET_VERSION >= 7
params.magicDataCount = 0;
#endif
dtStatus status = init(&params);
if (dtStatusFailed(status))