revmoe Tuple<int, bool>

This commit is contained in:
ikpil 2023-07-01 11:54:19 +09:00
parent 3878fd0b95
commit a68df35d91
1 changed files with 5 additions and 7 deletions

View File

@ -583,7 +583,7 @@ namespace DotRecast.Detour.TileCache
} }
} }
static Tuple<int, bool> GetCornerHeight(DtTileCacheLayer layer, int x, int y, int z, int walkableClimb) static int GetCornerHeight(DtTileCacheLayer layer, int x, int y, int z, int walkableClimb, out bool shouldRemove)
{ {
int w = layer.header.width; int w = layer.header.width;
int h = layer.header.height; int h = layer.header.height;
@ -623,13 +623,13 @@ namespace DotRecast.Detour.TileCache
if ((portal & (1 << dir)) != 0) if ((portal & (1 << dir)) != 0)
portalCount++; portalCount++;
bool shouldRemove = false; shouldRemove = false;
if (n > 1 && portalCount == 1 && allSameReg) if (n > 1 && portalCount == 1 && allSameReg)
{ {
shouldRemove = true; shouldRemove = true;
} }
return Tuple.Create(height, shouldRemove); return height;
} }
// TODO: move this somewhere else, once the layer meshing is done. // TODO: move this somewhere else, once the layer meshing is done.
@ -687,10 +687,8 @@ namespace DotRecast.Detour.TileCache
// stored at segment // stored at segment
// vertex of a // vertex of a
// segment. // segment.
Tuple<int, bool> res = GetCornerHeight(layer, temp.verts[v], temp.verts[v + 1], int lh = GetCornerHeight(layer, temp.verts[v], temp.verts[v + 1], temp.verts[v + 2],
temp.verts[v + 2], walkableClimb); walkableClimb, out var shouldRemove);
int lh = res.Item1;
bool shouldRemove = res.Item2;
cont.verts[dst + 0] = temp.verts[v]; cont.verts[dst + 0] = temp.verts[v];
cont.verts[dst + 1] = lh; cont.verts[dst + 1] = lh;
cont.verts[dst + 2] = temp.verts[v + 2]; cont.verts[dst + 2] = temp.verts[v + 2];