summaryrefslogtreecommitdiffstats
path: root/src/renderer
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2020-02-22 15:33:02 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2020-02-22 17:49:38 +0100
commitd35a68caf3987f24d85cb31cf3b327112459c7ac (patch)
tree1c7bb64d0794eb1a504d412ee985ecdecb2bbdc5 /src/renderer
parent764cd8344df2dc9b2c271d868ae193b98b829af7 (diff)
downloadrpgedit-d35a68caf3987f24d85cb31cf3b327112459c7ac.tar
rpgedit-d35a68caf3987f24d85cb31cf3b327112459c7ac.zip
Update deps
Diffstat (limited to 'src/renderer')
-rw-r--r--src/renderer/runtime/view/entity.ts2
-rw-r--r--src/renderer/runtime/view/renderer/renderer.ts6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/renderer/runtime/view/entity.ts b/src/renderer/runtime/view/entity.ts
index 4fc0937..12dd38f 100644
--- a/src/renderer/runtime/view/entity.ts
+++ b/src/renderer/runtime/view/entity.ts
@@ -13,7 +13,7 @@ export class EntityView {
const tile = await loadImage(`resources/sprite/entity/${data.sprite}.png`);
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);
r.snapToGrid(offset, offset);
diff --git a/src/renderer/runtime/view/renderer/renderer.ts b/src/renderer/runtime/view/renderer/renderer.ts
index 1e5b699..3c99c35 100644
--- a/src/renderer/runtime/view/renderer/renderer.ts
+++ b/src/renderer/runtime/view/renderer/renderer.ts
@@ -49,11 +49,11 @@ export class Renderer {
return this.shaders.samplerLoc;
}
- public setCenter(v: vec2 | number[]): void {
+ public setCenter(v: vec2): void {
this.snapToGrid(this.center, v);
}
- public setTranslation(v: vec2 | number[]): void {
+ public setTranslation(v: vec2): void {
vec2.sub(this.translation, v, this.center);
this.snapToGrid(this.translation, this.translation);
this.gl.uniform2fv(this.shaders.translateLoc, this.translation);
@@ -65,7 +65,7 @@ export class Renderer {
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.round(out, out);
vec2.scale(out, out, 1 / this.coordScale);