summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2018-10-31 15:05:06 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2018-10-31 15:05:06 +0100
commit60f03e3c5e5d19a27eff0bb02b5995352767492b (patch)
tree8081b26d1afcbae34c9f754a5362a1c17b6cee90
parentda3e93a942f7e01d3d26b48d403ba091667d1404 (diff)
downloadrpgedit-60f03e3c5e5d19a27eff0bb02b5995352767492b.tar
rpgedit-60f03e3c5e5d19a27eff0bb02b5995352767492b.zip
view/tile: fix vertex count
-rw-r--r--src/view/tile.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/view/tile.ts b/src/view/tile.ts
index d748ec9..3dd7231 100644
--- a/src/view/tile.ts
+++ b/src/view/tile.ts
@@ -31,7 +31,7 @@ export class TileViewBuilder {
}
export class TileView {
- private readonly primitiveCount: number;
+ private readonly vertexCount: number;
private readonly vertexBuffer: WebGLBuffer;
private readonly textureBuffer: WebGLBuffer;
@@ -51,7 +51,7 @@ export class TileView {
gl.bindBuffer(gl.ARRAY_BUFFER, this.textureBuffer);
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(textureData), gl.STATIC_DRAW);
- this.primitiveCount = vertexData.length / 3;
+ this.vertexCount = vertexData.length / 2;
}
public render(): void {
@@ -69,6 +69,6 @@ export class TileView {
gl.bindBuffer(gl.ARRAY_BUFFER, this.textureBuffer);
gl.vertexAttribPointer(this.r.getTextureCoordLoc(), 2, gl.FLOAT, false, 0, 0);
- gl.drawArrays(gl.TRIANGLES, 0, this.primitiveCount);
+ gl.drawArrays(gl.TRIANGLES, 0, this.vertexCount);
}
}