forked from mirror/ObjToSchematic
Resource pathing fixes
This commit is contained in:
parent
7d0de30ac6
commit
1741529526
@ -25,13 +25,14 @@
|
|||||||
"@types/bootstrap": "^5.1.1",
|
"@types/bootstrap": "^5.1.1",
|
||||||
"@types/jquery": "^3.5.6",
|
"@types/jquery": "^3.5.6",
|
||||||
"@types/pngjs": "^6.0.1",
|
"@types/pngjs": "^6.0.1",
|
||||||
"bootstrap": "^5.1.0",
|
|
||||||
"electron": "^13.1.4",
|
"electron": "^13.1.4",
|
||||||
"electron-packager": "^15.2.0",
|
"electron-packager": "^15.2.0",
|
||||||
"ts-node": "^10.1.0",
|
"ts-node": "^10.1.0",
|
||||||
"typescript": "^4.3.5"
|
"typescript": "^4.3.5"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@popperjs/core": "^2.9.3",
|
||||||
|
"bootstrap": "^5.1.0",
|
||||||
"expand-vertex-data": "^1.1.2",
|
"expand-vertex-data": "^1.1.2",
|
||||||
"jpeg-js": "^0.4.3",
|
"jpeg-js": "^0.4.3",
|
||||||
"pngjs": "^6.0.0",
|
"pngjs": "^6.0.0",
|
||||||
|
@ -3,6 +3,7 @@ import { HashMap } from "./hash_map";
|
|||||||
import { UV, RGB } from "./util";
|
import { UV, RGB } from "./util";
|
||||||
//import blocks from "../resources/blocks.json";
|
//import blocks from "../resources/blocks.json";
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
|
import path from "path";
|
||||||
|
|
||||||
interface BlockInfo {
|
interface BlockInfo {
|
||||||
name: string;
|
name: string;
|
||||||
@ -25,7 +26,9 @@ export class BlockAtlas {
|
|||||||
constructor() {
|
constructor() {
|
||||||
this._cachedBlocks = new HashMap(1024);
|
this._cachedBlocks = new HashMap(1024);
|
||||||
|
|
||||||
const blocksString = fs.readFileSync("./resources/blocks.json", "utf-8");
|
const _path = path.join(__dirname, "../resources/blocks.json");
|
||||||
|
console.log(_path);
|
||||||
|
const blocksString = fs.readFileSync(_path, "utf-8");
|
||||||
if (!blocksString) {
|
if (!blocksString) {
|
||||||
throw Error("Could not load blocks.json")
|
throw Error("Could not load blocks.json")
|
||||||
}
|
}
|
||||||
|
@ -20,8 +20,7 @@ function createWindow () {
|
|||||||
nodeIntegration: true,
|
nodeIntegration: true,
|
||||||
contextIsolation: false,
|
contextIsolation: false,
|
||||||
enableRemoteModule: true
|
enableRemoteModule: true
|
||||||
},
|
}
|
||||||
icon: "./resources/icon.png"
|
|
||||||
});
|
});
|
||||||
//mainWindow.removeMenu();
|
//mainWindow.removeMenu();
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import * as twgl from "twgl.js";
|
import * as twgl from "twgl.js";
|
||||||
|
import path from "path";
|
||||||
|
|
||||||
import { Vector3 } from "./vector";
|
import { Vector3 } from "./vector";
|
||||||
import { ArcballCamera } from "./camera";
|
import { ArcballCamera } from "./camera";
|
||||||
@ -55,7 +56,7 @@ export class Renderer {
|
|||||||
this._materialBuffers = [];
|
this._materialBuffers = [];
|
||||||
|
|
||||||
this._atlasTexture = twgl.createTexture(this._gl, {
|
this._atlasTexture = twgl.createTexture(this._gl, {
|
||||||
src: "./resources/blocks.png",
|
src: path.join(__dirname, "../resources/blocks.png"),
|
||||||
mag: this._gl.NEAREST
|
mag: this._gl.NEAREST
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user