mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
predefined-heightmaps
This commit is contained in:
parent
d570886816
commit
7f13f1c367
31 changed files with 59 additions and 12 deletions
9
main.js
9
main.js
|
|
@ -253,7 +253,7 @@ function checkLoadParameters() {
|
|||
|
||||
async function generateMapOnLoad() {
|
||||
await applyStyleOnLoad(); // apply previously selected default or custom style
|
||||
generate(); // generate map
|
||||
await generate(); // generate map
|
||||
focusOn(); // based on searchParams focus on point, cell or burg from MFCG
|
||||
applyPreset(); // apply saved layers preset
|
||||
}
|
||||
|
|
@ -632,7 +632,7 @@ void (function addDragToUpload() {
|
|||
});
|
||||
})();
|
||||
|
||||
function generate() {
|
||||
async function generate() {
|
||||
try {
|
||||
const timeStart = performance.now();
|
||||
invokeActiveZooming();
|
||||
|
|
@ -643,7 +643,7 @@ function generate() {
|
|||
placePoints();
|
||||
calculateVoronoi(grid, grid.points);
|
||||
drawScaleBar();
|
||||
HeightmapGenerator.generate();
|
||||
await HeightmapGenerator.generate();
|
||||
markFeatures();
|
||||
markupGridOcean();
|
||||
addLakesInDeepDepressions();
|
||||
|
|
@ -929,6 +929,9 @@ function defineMapSize() {
|
|||
|
||||
function getSizeAndLatitude() {
|
||||
const template = document.getElementById("templateInput").value; // heightmap template
|
||||
|
||||
if (template === "europe") return [40, 50];
|
||||
|
||||
const part = grid.features.some(f => f.land && f.border); // if land goes over map borders
|
||||
const max = part ? 80 : 100; // max size
|
||||
const lat = () => gauss(P(0.5) ? 40 : 60, 15, 25, 75); // latitude shift
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue