refactor: move assets

This commit is contained in:
Azgaar 2022-07-06 01:33:01 +03:00
parent 95baf27d58
commit da1cb4ff9b
230 changed files with 16 additions and 18 deletions

View file

@ -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");

View file

@ -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);