mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 03:51:23 +01:00
feat: allow to render ocean heightmap - cleanup
This commit is contained in:
parent
2d0cd90f6e
commit
7ab1a0a004
1 changed files with 0 additions and 27 deletions
27
main.js
27
main.js
|
|
@ -722,30 +722,10 @@ function markFeatures() {
|
||||||
grid.features = [0];
|
grid.features = [0];
|
||||||
|
|
||||||
for (let i = 1, queue = [0]; queue[0] !== -1; i++) {
|
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
|
cells.f[queue[0]] = i; // feature number
|
||||||
const land = heights[queue[0]] >= 20;
|
const land = heights[queue[0]] >= 20;
|
||||||
let border = false; // true if feature touches map border
|
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) {
|
while (queue.length) {
|
||||||
const q = queue.pop();
|
const q = queue.pop();
|
||||||
if (cells.b[q]) border = true;
|
if (cells.b[q]) border = true;
|
||||||
|
|
@ -1277,13 +1257,6 @@ function drawCoastline() {
|
||||||
|
|
||||||
const path = round(lineGen(points));
|
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") {
|
if (features[f].type === "lake") {
|
||||||
landMask
|
landMask
|
||||||
.append("path")
|
.append("path")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue