feat: allow to render ocean heightmap - cleanup

This commit is contained in:
Azgaar 2024-02-11 22:37:40 +01:00
parent 2d0cd90f6e
commit 7ab1a0a004

27
main.js
View file

@ -722,30 +722,10 @@ function markFeatures() {
grid.features = [0];
for (let i = 1, queue = [0]; queue[0] !== -1; i++) {
// [1864, 1731]
// if (queue[0] === 1864 || queue[0] === 1731) {
// cells.f[queue[0]] = 1;
// cells.t[queue[0]] = -1;
// queue = [cells.f.findIndex(f => !f)];
// i--;
// continue;
// }
cells.f[queue[0]] = i; // feature number
const land = heights[queue[0]] >= 20;
let border = false; // true if feature touches map border
// if (i === 11) {
// debug
// .append("g")
// .attr("id", "feature11")
// .append("circle")
// .attr("cx", grid.points[queue[0]][0])
// .attr("cy", grid.points[queue[0]][1])
// .attr("r", 2)
// .attr("fill", "red");
// }
while (queue.length) {
const q = queue.pop();
if (cells.b[q]) border = true;
@ -1277,13 +1257,6 @@ function drawCoastline() {
const path = round(lineGen(points));
// debug
// .append("path")
// .attr("d", path)
// .attr("id", "feature_" + features[f].type)
// .attr("data-f", f) // draw the lake
// .attr("fill", getRandomColor());
if (features[f].type === "lake") {
landMask
.append("path")