summaryrefslogtreecommitdiffstats
path: root/src/renderer
diff options
context:
space:
mode:
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);