Skip to content

Commit

Permalink
Cleanup some formatting in DtTileCacheBuilder.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
ikpil committed Jan 5, 2025
1 parent 941a9f5 commit 3b3d9fe
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/DotRecast.Detour.TileCache/DtTileCacheBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1408,8 +1408,13 @@ public static void RemoveVertex(DtTileCachePolyMesh mesh, int rem, int maxTris)
int nv = CountPolyVerts(mesh.polys, p, maxVertsPerPoly);
bool hasRem = false;
for (int j = 0; j < nv; ++j)
{
if (mesh.polys[p + j] == rem)
{
hasRem = true;
}
}

if (hasRem)
{
// Collect edges which does not touch the removed vertex.
Expand Down Expand Up @@ -1450,8 +1455,12 @@ public static void RemoveVertex(DtTileCachePolyMesh mesh, int rem, int maxTris)
int p = i * maxVertsPerPoly * 2;
int nv = CountPolyVerts(mesh.polys, p, maxVertsPerPoly);
for (int j = 0; j < nv; ++j)
{
if (mesh.polys[p + j] > rem)
{
mesh.polys[p + j]--;
}
}
}

for (int i = 0; i < nedges; ++i)
Expand Down Expand Up @@ -1606,10 +1615,13 @@ public static void RemoveVertex(DtTileCachePolyMesh mesh, int rem, int maxTris)
{
if (mesh.npolys >= maxTris)
break;

int p = mesh.npolys * maxVertsPerPoly * 2;
Array.Fill(mesh.polys, DT_TILECACHE_NULL_IDX, p, maxVertsPerPoly * 2);

for (int j = 0; j < maxVertsPerPoly; ++j)
mesh.polys[p + j] = polys[i * maxVertsPerPoly + j];

mesh.areas[mesh.npolys] = pareas[i];
mesh.npolys++;
if (mesh.npolys > maxTris)
Expand Down

0 comments on commit 3b3d9fe

Please sign in to comment.