- Changed gotos as cleanup mechanism to a scoped delete template.

- Removed unnecessary ptr casts to ints to allow to compile on 64bits systems.
- Added custom and portable qsort_r.
- Use gettimeofday() as performance timer on unix/bsd/osx
- Moved variables from rcCompactSpan to separate arrays.
This commit is contained in:
Mikko Mononen
2009-09-28 09:54:37 +00:00
parent 404491901a
commit ed73b46308
16 changed files with 1643 additions and 3108 deletions

View File

@@ -810,6 +810,23 @@ unsigned char* Sample_TileMesh::buildTileMesh(const float* bmin, const float* bm
v[0] -= (unsigned short)m_cfg.borderSize;
v[2] -= (unsigned short)m_cfg.borderSize;
}
if (m_pmesh->nverts >= 0xffff)
{
// The vertex indices are ushorts, and cannot point to more than 0xffff vertices.
if (rcGetLog())
rcGetLog()->log(RC_LOG_ERROR, "Too many vertices per tile %d (max: %d).", m_pmesh->nverts, 0xffff);
return false;
}
if (m_pmesh->npolys > DT_MAX_TILES)
{
// If you hit this error, you have too many polygons per tile.
// You can trade off tile count to poly count by adjusting DT_TILE_REF_TILE_BITS and DT_TILE_REF_POLY_BITS.
// The current setup is optimized for large number of tiles and small number of polys per tile.
if (rcGetLog())
rcGetLog()->log(RC_LOG_ERROR, "Too many polygons per tile %d (max: %d).", m_pmesh->npolys, DT_MAX_TILES);
return false;
}
if (!dtCreateNavMeshTileData(m_pmesh->verts, m_pmesh->nverts,
m_pmesh->polys, m_pmesh->npolys, m_pmesh->nvp,