MapGen: Optimization: Added single-color triangles. Close #10

This commit is contained in:
Van
2026-01-15 14:03:37 +03:00
parent 4f4b268d3c
commit 43bee3dae0
3 changed files with 22 additions and 3 deletions

View File

@@ -517,6 +517,14 @@ end
---@param z integer
---@return number
local function calcNoise2dValue(category, layer, triangle, x, y, z)
local triangleColor = triangle.color
-- If the triangle is monochromatic (all peaks have the same color and,
-- accordingly, the same noise), then there is no point in smoothing out the noise.
if triangleColor ~= nil then
return layer:getNoiseByColor(category, triangleColor):get_2d({x = x, y = z})
end
local peak1 = triangle.p1
local peak2 = triangle.p2
local peak3 = triangle.p3