mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 18:11:24 +01:00
refactor(es modules): remove gloval var lineGen
This commit is contained in:
parent
32d7db765d
commit
aa214a7826
17 changed files with 27 additions and 22 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue