mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 03:51:23 +01:00
Delete extraneous (de-)elevateLakes
This commit is contained in:
parent
02698cc89e
commit
1d5d96b862
4 changed files with 2 additions and 27 deletions
18
main.js
18
main.js
|
|
@ -1122,23 +1122,6 @@ function reMarkFeatures() {
|
||||||
TIME && console.timeEnd("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
|
// assign biome id for each cell
|
||||||
function defineBiomes() {
|
function defineBiomes() {
|
||||||
TIME && console.time("defineBiomes");
|
TIME && console.time("defineBiomes");
|
||||||
|
|
@ -1146,7 +1129,6 @@ function defineBiomes() {
|
||||||
cells.biome = new Uint8Array(cells.i.length); // biomes array
|
cells.biome = new Uint8Array(cells.i.length); // biomes array
|
||||||
|
|
||||||
for (const i of cells.i) {
|
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 t = temp[cells.g[i]]; // cell temperature
|
||||||
const h = cells.h[i]; // cell height
|
const h = cells.h[i]; // cell height
|
||||||
const m = h < 20 ? 0 : calculateMoisture(i); // cell moisture
|
const m = h < 20 ? 0 : calculateMoisture(i); // cell moisture
|
||||||
|
|
|
||||||
|
|
@ -176,7 +176,6 @@ function editHeightmap() {
|
||||||
reGraph();
|
reGraph();
|
||||||
drawCoastline();
|
drawCoastline();
|
||||||
|
|
||||||
elevateLakes();
|
|
||||||
Rivers.generate(change);
|
Rivers.generate(change);
|
||||||
|
|
||||||
if (!change) {
|
if (!change) {
|
||||||
|
|
@ -289,7 +288,7 @@ function editHeightmap() {
|
||||||
drawCoastline();
|
drawCoastline();
|
||||||
|
|
||||||
if (changeHeights.checked) {
|
if (changeHeights.checked) {
|
||||||
elevateLakes();
|
// elevateLakes();
|
||||||
Rivers.generate(changeHeights.checked);
|
Rivers.generate(changeHeights.checked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -314,7 +313,7 @@ function editHeightmap() {
|
||||||
|
|
||||||
for (const i of pack.cells.i) {
|
for (const i of pack.cells.i) {
|
||||||
const g = pack.cells.g[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;
|
const land = pack.cells.h[i] >= 20;
|
||||||
|
|
||||||
// check biome
|
// check biome
|
||||||
|
|
|
||||||
|
|
@ -72,12 +72,7 @@ function processFeatureRegeneration(event, button) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function regenerateRivers() {
|
function regenerateRivers() {
|
||||||
elevateLakes();
|
|
||||||
Rivers.generate();
|
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();
|
Rivers.specify();
|
||||||
if (!layerIsOn("toggleRivers")) toggleRivers();
|
if (!layerIsOn("toggleRivers")) toggleRivers();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,6 @@ function editWorld() {
|
||||||
updateGlobePosition();
|
updateGlobePosition();
|
||||||
calculateTemperatures();
|
calculateTemperatures();
|
||||||
generatePrecipitation();
|
generatePrecipitation();
|
||||||
elevateLakes();
|
|
||||||
const heights = new Uint8Array(pack.cells.h);
|
const heights = new Uint8Array(pack.cells.h);
|
||||||
Rivers.generate();
|
Rivers.generate();
|
||||||
Rivers.specify();
|
Rivers.specify();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue