feat: allow to render ocean heightmap - fix issue

This commit is contained in:
Azgaar 2024-02-11 22:35:53 +01:00
parent 94280e0acf
commit 2d0cd90f6e
9 changed files with 37 additions and 42 deletions

View file

@ -54,8 +54,6 @@ window.Cultures = (function () {
const colors = getColors(count);
const emblemShape = document.getElementById("emblemShape").value;
console.log("--- c1 ---", Math.random());
const codes = [];
cultures.forEach(function (c, i) {
@ -73,33 +71,24 @@ window.Cultures = (function () {
return;
}
console.log(JSON.stringify(c, null, 2));
console.log(Array.from(pack.cells.s).join());
const sortingFn = c.sort ? c.sort : i => cells.s[i];
const center = placeCenter(sortingFn);
console.log("--- c2-1 ---", i, Math.random());
centers.add(cells.p[center]);
c.center = center;
c.i = newId;
delete c.odd;
delete c.sort;
c.color = colors[i];
console.log("--- c2-2 ---", i, Math.random());
c.type = defineCultureType(center);
console.log("--- c2-3 ---", i, Math.random());
c.expansionism = defineCultureExpansionism(c.type);
c.origins = [0];
c.code = abbreviate(c.name, codes);
codes.push(c.code);
cultureIds[center] = newId;
if (emblemShape === "random") c.shield = getRandomShield();
console.log("--- c2-4 ---", i, Math.random());
});
console.log("--- c3 ---", Math.random());
cells.culture = cultureIds;
function placeCenter(sortingFn) {