From 5ca2805dbc16489c3ab9c116e6c54fe2291292ae Mon Sep 17 00:00:00 2001 From: Felipe Alfonso Date: Fri, 12 Jan 2018 13:46:46 -0300 Subject: [PATCH] Fixed issue with blitter batch incorrect instruction order and forced unsigned int result for color tint operation --- src/renderer/webgl/Utils.js | 4 ++-- src/renderer/webgl/pipelines/blitterbatch/BlitterBatch.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/renderer/webgl/Utils.js b/src/renderer/webgl/Utils.js index 0c82875d3..b97a684b8 100644 --- a/src/renderer/webgl/Utils.js +++ b/src/renderer/webgl/Utils.js @@ -7,7 +7,7 @@ module.exports = { var ub = ((b * 255.0)|0) & 0xFF; var ua = ((a * 255.0)|0) & 0xFF; - return (ua << 24) | (ub << 16) | (ug << 8) | ur; + return ((ua << 24) | (ub << 16) | (ug << 8) | ur) >>> 0; }, getTintAppendFloatAlpha: function (rgb, a) @@ -17,7 +17,7 @@ module.exports = { var ub = (rgb|0) & 0xff; var ua = ((a * 255.0)|0) & 0xFF; - return (ua << 24) | (ub << 16) | (ug << 8) | ur; + return ((ua << 24) | (ub << 16) | (ug << 8) | ur) >>> 0; } }; \ No newline at end of file diff --git a/src/renderer/webgl/pipelines/blitterbatch/BlitterBatch.js b/src/renderer/webgl/pipelines/blitterbatch/BlitterBatch.js index 369604248..bdaf592ca 100644 --- a/src/renderer/webgl/pipelines/blitterbatch/BlitterBatch.js +++ b/src/renderer/webgl/pipelines/blitterbatch/BlitterBatch.js @@ -117,10 +117,10 @@ var BlitterBatch = new Class({ var uvs = frame.uvs; var flipX = bob.flipX; var flipY = bob.flipY; - var x = bob.x + frame.x - cameraScrollX + (width * (flipX ? 1.0 : 0.0)); - var y = bob.y + frame.y - cameraScrollY + (height * (flipY ? 1.0 : 0.0)); var width = frame.width * (flipX ? -1.0 : 1.0); var height = frame.height * (flipY ? -1.0 : 1.0); + var x = bob.x + frame.x - cameraScrollX + (width * ((flipX) ? 1.0 : 0.0)); + var y = bob.y + frame.y - cameraScrollY + (height * ((flipY) ? 1.0 : 0.0)); var xw = x + width; var yh = y + height; var tx = x * a + y * c + e;