[Upstream] fix:rcBuildLayerRegions missing areaType (#470)

- ddaa361b08

It's already been modified, just align the code.
This commit is contained in:
ikpil 2023-11-13 23:35:43 +09:00
parent 8fcd8b5006
commit 4c29fa0686
1 changed files with 5 additions and 3 deletions

View File

@ -1169,8 +1169,7 @@ namespace DotRecast.Recast
} }
} }
private static int MergeAndFilterLayerRegions(RcTelemetry ctx, int minRegionArea, int maxRegionId, private static int MergeAndFilterLayerRegions(RcTelemetry ctx, int minRegionArea, int maxRegionId, RcCompactHeightfield chf, int[] srcReg, List<int> overlaps)
RcCompactHeightfield chf, int[] srcReg, List<int> overlaps)
{ {
int w = chf.width; int w = chf.width;
int h = chf.height; int h = chf.height;
@ -1197,6 +1196,7 @@ namespace DotRecast.Recast
for (int i = c.index, ni = c.index + c.count; i < ni; ++i) for (int i = c.index, ni = c.index + c.count; i < ni; ++i)
{ {
ref RcCompactSpan s = ref chf.spans[i]; ref RcCompactSpan s = ref chf.spans[i];
int area = chf.areas[i];
int ri = srcReg[i]; int ri = srcReg[i];
if (ri == 0 || ri >= nreg) if (ri == 0 || ri >= nreg)
{ {
@ -1206,9 +1206,11 @@ namespace DotRecast.Recast
RcRegion reg = regions[ri]; RcRegion reg = regions[ri];
reg.spanCount++; reg.spanCount++;
reg.areaType = chf.areas[i]; reg.areaType = area;
reg.ymin = Math.Min(reg.ymin, s.y); reg.ymin = Math.Min(reg.ymin, s.y);
reg.ymax = Math.Max(reg.ymax, s.y); reg.ymax = Math.Max(reg.ymax, s.y);
// Collect all region layers. // Collect all region layers.
lregs.Add(ri); lregs.Add(ri);