Update deps

This commit is contained in:
Matthias Schiffer 2020-02-22 15:33:02 +01:00
parent 764cd8344d
commit d35a68caf3
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
4 changed files with 813 additions and 725 deletions

View file

@ -5,21 +5,20 @@
"lint": "eslint 'src/**/*.ts'" "lint": "eslint 'src/**/*.ts'"
}, },
"devDependencies": { "devDependencies": {
"@types/gl-matrix": "^2.4.5", "@typescript-eslint/eslint-plugin": "^2.20.0",
"@typescript-eslint/eslint-plugin": "^2.13.0", "@typescript-eslint/parser": "^2.20.0",
"@typescript-eslint/parser": "^2.13.0", "electron": "^8.0.1",
"electron": "^7.1.7",
"electron-webpack": "^2.7.4", "electron-webpack": "^2.7.4",
"electron-webpack-ts": "^3.2.0", "electron-webpack-ts": "^3.2.0",
"eslint": "^6.8.0", "eslint": "^6.8.0",
"eslint-config-prettier": "^6.7.0", "eslint-config-prettier": "^6.10.0",
"eslint-plugin-prettier": "^3.1.2", "eslint-plugin-prettier": "^3.1.2",
"prettier": "^1.19.1", "prettier": "^1.19.1",
"raw-loader": "^4.0.0", "raw-loader": "^4.0.0",
"typescript": "^3.7.4", "typescript": "^3.8.2",
"webpack": "^4.41.4" "webpack": "^4.41.6"
}, },
"dependencies": { "dependencies": {
"gl-matrix": "^3.1.0" "gl-matrix": "^3.2.1"
} }
} }

View file

@ -13,7 +13,7 @@ export class EntityView {
const tile = await loadImage(`resources/sprite/entity/${data.sprite}.png`); const tile = await loadImage(`resources/sprite/entity/${data.sprite}.png`);
const [texture, size] = mkTexture(r, tile); const [texture, size] = mkTexture(r, tile);
const frameSize = [size[0], size[1] / data.frames]; const frameSize: [number, number] = [size[0], size[1] / data.frames];
const offset = vec2.mul(vec2.create(), frameSize, data.anchor); const offset = vec2.mul(vec2.create(), frameSize, data.anchor);
r.snapToGrid(offset, offset); r.snapToGrid(offset, offset);

View file

@ -49,11 +49,11 @@ export class Renderer {
return this.shaders.samplerLoc; return this.shaders.samplerLoc;
} }
public setCenter(v: vec2 | number[]): void { public setCenter(v: vec2): void {
this.snapToGrid(this.center, v); this.snapToGrid(this.center, v);
} }
public setTranslation(v: vec2 | number[]): void { public setTranslation(v: vec2): void {
vec2.sub(this.translation, v, this.center); vec2.sub(this.translation, v, this.center);
this.snapToGrid(this.translation, this.translation); this.snapToGrid(this.translation, this.translation);
this.gl.uniform2fv(this.shaders.translateLoc, this.translation); this.gl.uniform2fv(this.shaders.translateLoc, this.translation);
@ -65,7 +65,7 @@ export class Renderer {
this.setTranslation([0, 0]); this.setTranslation([0, 0]);
} }
public snapToGrid(out: vec2, a: vec2 | number[]): void { public snapToGrid(out: vec2, a: vec2): void {
vec2.scale(out, a, this.coordScale); vec2.scale(out, a, this.coordScale);
vec2.round(out, out); vec2.round(out, out);
vec2.scale(out, out, 1 / this.coordScale); vec2.scale(out, out, 1 / this.coordScale);

1515
yarn.lock

File diff suppressed because it is too large Load diff