refactor(es modules): remove gloval var lineGen

This commit is contained in:
Azgaar 2022-06-27 01:47:31 +03:00
parent 32d7db765d
commit aa214a7826
17 changed files with 27 additions and 22 deletions

View file

@ -62,7 +62,6 @@ biomesData = Biomes.getDefault();
nameBases = Names.getNameBases(); // cultures-related data
// color = d3.scaleSequential(d3.interpolateSpectral); // default color scheme
// lineGen = d3.line().curve(d3.curveBasis); // d3 line generator with default curve interpolation
// voronoi graph extension, cannot be changed after generation
graphWidth = +byId("mapWidthInput").value;
@ -364,6 +363,8 @@ async function generate(options) {
applyMapSize();
randomizeOptions();
debugger;
if (shouldRegenerateGrid(grid)) grid = precreatedGraph || generateGrid();
else delete grid.cells.h;
grid.cells.h = await HeightmapGenerator.generate(grid);
@ -954,7 +955,7 @@ function drawCoastline() {
);
const landMask = defs.select("#land");
const waterMask = defs.select("#water");
lineGen.curve(d3.curveBasisClosed);
const lineGen = d3.line().curve(d3.curveBasis);
for (const i of cells.i) {
const startFromEdge = !i && cells.h[i] >= 20;