Recast: remove extraneous clamp for saltbits

Due to the change in 4ced95e2c111178a4127a663d95dc5c02e764d00, there are always 4 salt bits or less.
This commit is contained in:
Kawe Mazidjatari 2024-07-02 16:12:56 +02:00
parent f8cac07da2
commit b7bca8e15c
2 changed files with 2 additions and 4 deletions

View File

@ -255,8 +255,7 @@ dtStatus dtNavMesh::init(const dtNavMeshParams* params)
#ifndef DT_POLYREF64
m_tileBits = dtIlog2(dtNextPow2((unsigned int)params->maxTiles));
m_polyBits = dtIlog2(dtNextPow2((unsigned int)params->maxPolys));
// Only allow 31 salt bits, since the salt mask is calculated using 32bit uint and it will overflow.
m_saltBits = dtMin((unsigned int)31, 32 - m_tileBits - m_polyBits);
m_saltBits = 32 - m_tileBits - m_polyBits;
#endif
return DT_SUCCESS;

View File

@ -162,8 +162,7 @@ dtStatus dtTileCache::init(const dtTileCacheParams* params,
// Init ID generator values.
m_tileBits = dtIlog2(dtNextPow2((unsigned int)m_params.maxTiles));
// Only allow 31 salt bits, since the salt mask is calculated using 32bit uint and it will overflow.
m_saltBits = dtMin((unsigned int)31, 32 - m_tileBits);
m_saltBits = 32 - m_tileBits;
return DT_SUCCESS;
}