mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 10:01:23 +01:00
refactor: move assets
This commit is contained in:
parent
95baf27d58
commit
da1cb4ff9b
230 changed files with 16 additions and 18 deletions
|
|
@ -1,4 +1,4 @@
|
|||
"use strict";
|
||||
import {ERROR} from "config/logging";
|
||||
|
||||
window.COArenderer = (function () {
|
||||
const colors = {
|
||||
|
|
@ -1945,9 +1945,8 @@ window.COArenderer = (function () {
|
|||
return fetchedCharges.join("");
|
||||
}
|
||||
|
||||
const url = location.hostname ? "./charges/" : "http://armoria.herokuapp.com/charges/"; // on local machine fetch files from server
|
||||
async function fetchCharge(charge, id) {
|
||||
const fetched = fetch(url + charge + ".svg")
|
||||
const fetched = fetch(`./images/charges/${charge}.svg`)
|
||||
.then(res => {
|
||||
if (res.ok) return res.text();
|
||||
else throw new Error("Cannot fetch charge");
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ window.HeightmapGenerator = (function () {
|
|||
|
||||
// load heightmap into image and render to canvas
|
||||
const img = new Image();
|
||||
img.src = `./heightmaps/${id}.png`;
|
||||
img.src = `../assets/heightmaps/${id}.png`;
|
||||
img.onload = () => {
|
||||
ctx.drawImage(img, 0, 0, cellsX, cellsY);
|
||||
const imageData = ctx.getImageData(0, 0, cellsX, cellsY);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue