Globalize some of the main functions

This will allow to avoid nested 'dofile's
This commit is contained in:
Gael-de-Sailly
2022-01-21 14:22:22 +01:00
parent b0930f4d40
commit cd2a77803f
3 changed files with 7 additions and 12 deletions

View File

@ -1,6 +1,5 @@
local modpath = mapgen_rivers.modpath
local make_polygons = dofile(modpath .. 'polygons.lua')
local transform_quadri = dofile(modpath .. 'geometry.lua')
local sea_level = mapgen_rivers.settings.sea_level
@ -19,9 +18,9 @@ local function interp(v00, v01, v11, v10, xf, zf)
return v1*zf + v0*(1-zf)
end
local function heightmaps(minp, maxp)
function mapgen_rivers.make_heightmaps(minp, maxp)
local polygons = make_polygons(minp, maxp)
local polygons = mapgen_rivers.make_polygons(minp, maxp)
local incr = maxp.z-minp.z+1
local terrain_height_map = {}
@ -144,5 +143,3 @@ local function heightmaps(minp, maxp)
return terrain_height_map, lake_height_map
end
return heightmaps