diff --git a/heightmaps/baltics.png b/heightmaps/baltics.png deleted file mode 100644 index 1bb311b5..00000000 Binary files a/heightmaps/baltics.png and /dev/null differ diff --git a/heightmaps/europe-accented.png b/heightmaps/europe-accented.png index a38cb5cd..01820a95 100644 Binary files a/heightmaps/europe-accented.png and b/heightmaps/europe-accented.png differ diff --git a/heightmaps/india.png b/heightmaps/india.png deleted file mode 100644 index e005ab0d..00000000 Binary files a/heightmaps/india.png and /dev/null differ diff --git a/heightmaps/oceania.png b/heightmaps/oceania.png deleted file mode 100644 index ab854d71..00000000 Binary files a/heightmaps/oceania.png and /dev/null differ diff --git a/heightmaps/philippines.png b/heightmaps/philippines.png deleted file mode 100644 index 8db168df..00000000 Binary files a/heightmaps/philippines.png and /dev/null differ diff --git a/index.html b/index.html index c43e430f..01ebd05c 100644 --- a/index.html +++ b/index.html @@ -964,7 +964,6 @@ - @@ -977,13 +976,10 @@ - - - diff --git a/main.js b/main.js index 91d10032..50b0743b 100644 --- a/main.js +++ b/main.js @@ -930,7 +930,29 @@ function defineMapSize() { function getSizeAndLatitude() { const template = document.getElementById("templateInput").value; // heightmap template - if (template === "europe") return [40, 50]; + if (template === "africa-centric") return [45, 53]; + if (template === "arabia") return [20, 35]; + if (template === "atlantics") return [42, 23]; + if (template === "britain") return [7, 20]; + if (template === "caribbean") return [15, 40]; + if (template === "east-asia") return [11, 28]; + if (template === "eurasia") return [38, 19]; + if (template === "europe") return [20, 16]; + if (template === "europe-accented") return [14, 22]; + if (template === "europe-and-central-asia") return [25, 10]; + if (template === "europe-central") return [11, 22]; + if (template === "europe-north") return [7, 18]; + if (template === "greenland") return [22, 7]; + if (template === "hellenica") return [8, 27]; + if (template === "iceland") return [2, 15]; + if (template === "indian-ocean") return [45, 55]; + if (template === "mediterranean-sea") return [10, 29]; + if (template === "middle-east") return [8, 31]; + if (template === "north-america") return [37, 17]; + if (template === "us-centric") return [66, 27]; + if (template === "us-mainland") return [16, 30]; + if (template === "world") return [78, 27]; + if (template === "world-from-pacific") return [75, 32]; const part = grid.features.some(f => f.land && f.border); // if land goes over map borders const max = part ? 80 : 100; // max size diff --git a/modules/heightmap-generator.js b/modules/heightmap-generator.js index d079ec69..d8ee7634 100644 --- a/modules/heightmap-generator.js +++ b/modules/heightmap-generator.js @@ -444,7 +444,7 @@ window.HeightmapGenerator = (function () { for (let i = 0; i < cells.i.length; i++) { const lightness = imageData[i * 4] / 255; const powered = lightness < 0.2 ? lightness : 0.2 + (lightness - 0.2) ** 0.8; - cells.h[i] = minmax(rn(powered * 100), 0, 100); + cells.h[i] = minmax(Math.floor(powered * 100), 0, 100); } } diff --git a/modules/ui/options.js b/modules/ui/options.js index 74b214d5..ae2f8d88 100644 --- a/modules/ui/options.js +++ b/modules/ui/options.js @@ -306,10 +306,8 @@ function showSeedHistoryDialog() { // generate map with historical seed function restoreSeed(id) { - if (mapHistory[id].seed == seed) { - tip("The current map is already generated with this seed", null, "error"); - return; - } + if (mapHistory[id].seed == seed) return tip("The current map is already generated with this seed", null, "error"); + optionsSeed.value = mapHistory[id].seed; mapWidthInput.value = mapHistory[id].width; mapHeightInput.value = mapHistory[id].height;