mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 21:53:59 +00:00
Fixed bug where scroll was effectively applied twice.
This commit is contained in:
parent
446eab60af
commit
c7476a6583
1 changed files with 4 additions and 3 deletions
|
@ -247,9 +247,6 @@ PIXI.Tilemap.prototype._renderBatch = function( renderSession )
|
||||||
{
|
{
|
||||||
var shader = renderSession.shaderManager.tilemapShader;
|
var shader = renderSession.shaderManager.tilemapShader;
|
||||||
|
|
||||||
// set the scroll offset (in screen units)
|
|
||||||
gl.uniform2f( shader.uScrollOffset, this.scrollX * iWide, -this.scrollY * iHigh );
|
|
||||||
|
|
||||||
// upload the VBO
|
// upload the VBO
|
||||||
gl.bufferData( gl.ARRAY_BUFFER, buffer, gl.STATIC_DRAW );
|
gl.bufferData( gl.ARRAY_BUFFER, buffer, gl.STATIC_DRAW );
|
||||||
|
|
||||||
|
@ -281,6 +278,10 @@ PIXI.Tilemap.prototype._renderWholeTilemap = function(renderSession)
|
||||||
gl.uniform1i( shader.uImageSampler, 0 );
|
gl.uniform1i( shader.uImageSampler, 0 );
|
||||||
gl.activeTexture(gl.TEXTURE0);
|
gl.activeTexture(gl.TEXTURE0);
|
||||||
gl.uniform2f(shader.uTileSize, this.tileWide, this.tileHigh);
|
gl.uniform2f(shader.uTileSize, this.tileWide, this.tileHigh);
|
||||||
|
// set the base offset (in screen units) (it's zero, scrolling is now handled by the batch buffer values)
|
||||||
|
gl.uniform2f( shader.uScrollOffset, 0, 0 );
|
||||||
|
//gl.uniform2f( shader.uScrollOffset, this.scrollX * iWide, -this.scrollY * iHigh );
|
||||||
|
|
||||||
|
|
||||||
// check if a texture is dirty..
|
// check if a texture is dirty..
|
||||||
if(this.texture.baseTexture._dirty[gl.id])
|
if(this.texture.baseTexture._dirty[gl.id])
|
||||||
|
|
Loading…
Reference in a new issue