Recast: use DT_MIN_POLY_GROUP_COUNT for dtCalcTraverseTableSize

Use the actual constant instead.
This commit is contained in:
Kawe Mazidjatari 2024-10-16 17:06:18 +02:00
parent 5460427cda
commit 9b44b098f8

View File

@ -191,9 +191,8 @@ int dtCalcTraverseTableCellIndex(const int numPolyGroups,
int dtCalcTraverseTableSize(const int numPolyGroups) int dtCalcTraverseTableSize(const int numPolyGroups)
{ {
// If we only have 2 poly groups, we don't need a traverse table as group // If we only have 2 poly groups, we don't need a traverse table.
// 1 is for unlinked polygons and group 2 for linked polygons. if (numPolyGroups < DT_MIN_POLY_GROUP_COUNT)
if (numPolyGroups <= 2)
return 0; return 0;
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));