fixed a small potentially non-determinimistic tree problem

This commit is contained in:
Grimsace
2026-02-26 14:22:23 -06:00
parent 4925aab8bf
commit 505d9ebbdd
2 changed files with 23 additions and 1 deletions
+8 -1
View File
@@ -261,7 +261,6 @@ func GenerateTrees(img *image.RGBA, waterMask, roadMask, buildingMask *PixelMask
}
if (math.Pow(float64(x-p.X), 2) + math.Pow(float64(y-p.Y), 2)) <= r*r {
img.Set(x, y, color.RGBA{R: 0, G: 100, B: 0, A: 255})
localTreePixels = append(localTreePixels, pt)
}
}
@@ -280,6 +279,14 @@ func GenerateTrees(img *image.RGBA, waterMask, roadMask, buildingMask *PixelMask
treeMask.SetPoint(p)
}
}
for y := 0; y < treeMask.Height; y++ {
row := y * treeMask.Width
for x := 0; x < treeMask.Width; x++ {
if treeMask.Data[row+x] != 0 {
img.Set(x, y, color.RGBA{R: 0, G: 100, B: 0, A: 255})
}
}
}
return treeMask
}