refactor: addLakesInDeepDepressions

This commit is contained in:
max 2022-07-24 15:18:47 +03:00
parent b2f16c4b8f
commit 3c6da6585e
16 changed files with 250 additions and 266 deletions

View file

@ -22,10 +22,10 @@ import {debounce} from "utils/functionUtils";
import {rn} from "utils/numberUtils";
import {generateSeed} from "utils/probabilityUtils";
import {byId} from "utils/shorthands";
import {createGrid} from "./grid";
import {createGrid} from "./grid/grid";
import {createPack} from "./pack/pack";
import {getInputValue, setInputValue} from "utils/nodeUtils";
// import {Ruler} from "modules/measurers";
import {calculateMapCoordinates} from "modules/coordinates";
const {Zoom, ThreeD} = window;
@ -50,6 +50,8 @@ async function generate(options?: IGenerationOptions) {
applyMapSize();
randomizeOptions();
window.mapCoordinates = calculateMapCoordinates();
const newGrid = await createGrid(grid, precreatedGraph);
const newPack = createPack(newGrid);
@ -60,10 +62,10 @@ async function generate(options?: IGenerationOptions) {
pack = newPack;
// temp rendering for debug
renderLayer("cells");
// renderLayer("cells");
renderLayer("features");
renderLayer("heightmap");
renderLayer("rivers", pack);
// renderLayer("heightmap");
// renderLayer("rivers", pack);
WARN && console.warn(`TOTAL: ${rn((performance.now() - timeStart) / 1000, 2)}s`);
// showStatistics();