mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
set size for pre-defined maps
This commit is contained in:
parent
7f13f1c367
commit
5b6ec0cc2e
9 changed files with 26 additions and 10 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue