Tilemap update.

This commit is contained in:
photonstorm 2016-04-27 03:38:07 +01:00
parent b10c8858c3
commit d55b0c9e51
2 changed files with 3 additions and 3 deletions

View file

@ -39,7 +39,7 @@ PIXI.Tilemap = function(texture)
this.colors = new PIXI.Float32Array([1, 1, 1, 1]);
this.indices = new PIXI.Uint16Array([0, 1, 2, 3]);
this.indices = new PIXI.Uint16Array([0, 1, 2, 0, 2, 3]);
};
@ -126,6 +126,6 @@ PIXI.Tilemap.prototype._renderTilemap = function(renderSession)
// dont need to upload!
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer);
gl.drawElements(PIXI.Strip.DrawModes.TRIANGLE_STRIP, this.indices.length, gl.UNSIGNED_SHORT, 0);
gl.drawElements(gl.TRIANGLES, this.indices.length, gl.UNSIGNED_SHORT, 0);
};

View file

@ -93,7 +93,7 @@ PIXI.TilemapShader.prototype.init = function()
this.projectionVector = gl.getUniformLocation(program, 'projectionVector');
this.offsetVector = gl.getUniformLocation(program, 'offsetVector');
this.dimensions = gl.getUniformLocation(program, 'dimensions');
// this.uMatrix = gl.getUniformLocation(program, 'uMatrix');
this.uMatrix = gl.getUniformLocation(program, 'uMatrix');
// get and store the attributes
this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');