mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2026-03-23 23:57:23 +01:00
feat: update relief rendering logic and version to 1.114.0
This commit is contained in:
parent
dc06f3d65c
commit
ab7baf83fd
6 changed files with 53 additions and 110 deletions
|
|
@ -1112,4 +1112,23 @@ export function resolveVersionConflicts(mapVersion) {
|
|||
zone.cells = unique(zone.cells);
|
||||
});
|
||||
}
|
||||
|
||||
if (isOlderThan("1.114.0")) {
|
||||
// v1.114.0 add reliefIcon to pack data and changed rendering method to WebGL
|
||||
const terrainEl = byId("terrain");
|
||||
if (!terrainEl) return;
|
||||
const relief = [];
|
||||
|
||||
terrainEl.querySelectorAll("use").forEach(u => {
|
||||
const href = u.getAttribute("href") || u.getAttribute("xlink:href") || "";
|
||||
if (!href) return;
|
||||
const x = +u.getAttribute("x");
|
||||
const y = +u.getAttribute("y");
|
||||
const s = +u.getAttribute("width");
|
||||
relief.push({i: relief.length, href, x, y, s});
|
||||
});
|
||||
terrainEl.innerHTML = "";
|
||||
pack.relief = relief;
|
||||
if (layerIsOn("toggleRelief")) drawRelief();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue