From 1d5d96b86287878469e22171fde252a88f0ab347 Mon Sep 17 00:00:00 2001 From: CanisArtorus Date: Mon, 25 Jan 2021 21:31:44 -0700 Subject: [PATCH] Delete extraneous (de-)elevateLakes --- main.js | 18 ------------------ modules/ui/heightmap-editor.js | 5 ++--- modules/ui/tools.js | 5 ----- modules/ui/world-configurator.js | 1 - 4 files changed, 2 insertions(+), 27 deletions(-) diff --git a/main.js b/main.js index 23d8cbea..a15f6c33 100644 --- a/main.js +++ b/main.js @@ -1122,23 +1122,6 @@ function reMarkFeatures() { TIME && console.timeEnd("reMarkFeatures"); } -// temporary elevate some lakes to resolve depressions and flux the water to form an open (exorheic) lake -function elevateLakes() { - return; - if (templateInput.value === "Atoll") return; // no need for Atolls - TIME && console.time('elevateLakes'); - const cells = pack.cells, features = pack.features; - const maxCells = cells.i.length / 100; // size limit; let big lakes be closed (endorheic) - cells.i.forEach(i => { - if (cells.h[i] >= 20) return; - if (features[cells.f[i]].group !== "freshwater" || features[cells.f[i]].cells > maxCells) return; - cells.h[i] = 20; - //debug.append("circle").attr("cx", cells.p[i][0]).attr("cy", cells.p[i][1]).attr("r", .5).attr("fill", "blue"); - }); - - TIME && console.timeEnd('elevateLakes'); -} - // assign biome id for each cell function defineBiomes() { TIME && console.time("defineBiomes"); @@ -1146,7 +1129,6 @@ function defineBiomes() { cells.biome = new Uint8Array(cells.i.length); // biomes array for (const i of cells.i) { - // if (f[cells.f[i]].group === "freshwater") cells.h[i] = 19; // de-elevate lakes; here to save some resources const t = temp[cells.g[i]]; // cell temperature const h = cells.h[i]; // cell height const m = h < 20 ? 0 : calculateMoisture(i); // cell moisture diff --git a/modules/ui/heightmap-editor.js b/modules/ui/heightmap-editor.js index 66fba656..c64265f2 100644 --- a/modules/ui/heightmap-editor.js +++ b/modules/ui/heightmap-editor.js @@ -176,7 +176,6 @@ function editHeightmap() { reGraph(); drawCoastline(); - elevateLakes(); Rivers.generate(change); if (!change) { @@ -289,7 +288,7 @@ function editHeightmap() { drawCoastline(); if (changeHeights.checked) { - elevateLakes(); + // elevateLakes(); Rivers.generate(changeHeights.checked); } @@ -314,7 +313,7 @@ function editHeightmap() { for (const i of pack.cells.i) { const g = pack.cells.g[i]; - if (pack.features[pack.cells.f[i]].group === "freshwater") pack.cells.h[i] = 19; // de-elevate lakes + // if (pack.features[pack.cells.f[i]].group === "freshwater") pack.cells.h[i] = 19; // de-elevate lakes const land = pack.cells.h[i] >= 20; // check biome diff --git a/modules/ui/tools.js b/modules/ui/tools.js index 066eda0b..15988bf8 100644 --- a/modules/ui/tools.js +++ b/modules/ui/tools.js @@ -72,12 +72,7 @@ function processFeatureRegeneration(event, button) { } function regenerateRivers() { - elevateLakes(); Rivers.generate(); - for (const i of pack.cells.i) { - const f = pack.features[pack.cells.f[i]]; // feature - if (f.group === "freshwater") pack.cells.h[i] = 19; // de-elevate lakes - } Rivers.specify(); if (!layerIsOn("toggleRivers")) toggleRivers(); } diff --git a/modules/ui/world-configurator.js b/modules/ui/world-configurator.js index ffcef39f..fc3f93b6 100644 --- a/modules/ui/world-configurator.js +++ b/modules/ui/world-configurator.js @@ -45,7 +45,6 @@ function editWorld() { updateGlobePosition(); calculateTemperatures(); generatePrecipitation(); - elevateLakes(); const heights = new Uint8Array(pack.cells.h); Rivers.generate(); Rivers.specify();