well, I converted Biomes to have a class instead of a series of arrays. Limited testing has been done but it works

This commit is contained in:
Zoltan 2019-11-09 01:48:01 -08:00
parent 7a06e0bdd4
commit d9df7c2f15
10 changed files with 144 additions and 96 deletions

View file

@ -333,7 +333,7 @@ function drawBiomes() {
biomes.selectAll("path").remove();
const cells = pack.cells, vertices = pack.vertices, n = cells.i.length;
const used = new Uint8Array(cells.i.length);
const paths = new Array(biomesData.i.length).fill("");
const paths = new Array(biomesData.biomeList.length).fill("");
for (const i of cells.i) {
if (!cells.biome[i]) continue; // no need to mark water
@ -350,7 +350,7 @@ function drawBiomes() {
paths.forEach(function(d, i) {
if (d.length < 10) return;
biomes.append("path").attr("d", d).attr("fill", biomesData.color[i]).attr("stroke", biomesData.color[i]).attr("id", "biome"+i);
biomes.append("path").attr("d", d).attr("fill", biomesData.biomeList[i].color).attr("stroke", biomesData.biomeList[i].color).attr("id", "biome"+i);
});
// connect vertices to chain