From 3821ba5edec75012c62fd13bd4ba017636eebba1 Mon Sep 17 00:00:00 2001 From: Felipe Alfonso Date: Wed, 7 Feb 2018 13:14:52 -0300 Subject: [PATCH] WebGL tile flipping and rotation --- .../webgl/pipelines/TextureTintPipeline.js | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/renderer/webgl/pipelines/TextureTintPipeline.js b/src/renderer/webgl/pipelines/TextureTintPipeline.js index c48be0df3..2be77351c 100644 --- a/src/renderer/webgl/pipelines/TextureTintPipeline.js +++ b/src/renderer/webgl/pipelines/TextureTintPipeline.js @@ -1141,23 +1141,23 @@ var TextureTintPipeline = new Class({ var tileTexCoords = tileset.getTileTextureCoordinates(tile.index); if (tileTexCoords === null) { continue; } - var frameWidth = tile.width * (tile.flipX ? -1 : 1); - var frameHeight = tile.height * (tile.flipY ? -1 : 1); - var frameX = tileTexCoords.x + (tile.flipX ? tile.width : 0); - var frameY = tileTexCoords.y + (tile.flipY ? tile.height : 0); + var frameWidth = tile.width; + var frameHeight = tile.height; + var frameX = tileTexCoords.x; + var frameY = tileTexCoords.y; var tint = getTint(tile.tint, alpha * tile.alpha); this.batchTexture( tilemapLayer, texture, texture.width, texture.height, - x + tile.pixelX * sx, y + tile.pixelY * sy, - tile.width * sx, tile.height * sy, - 1, 1, - 0, - false, false, + tile.width / 2 + x + tile.pixelX, tile.height / 2 + y + tile.pixelY, + tile.width, tile.height, + sx, sy, + tile.rotation, + tile.flipX, tile.flipY, scrollFactorX, scrollFactorY, - 0, 0, + tile.width / 2, tile.height / 2, frameX, frameY, frameWidth, frameHeight, tint, tint, tint, tint, 0, 0,