Fixed issue with blitter batch incorrect instruction order and forced unsigned int result for color tint operation

This commit is contained in:
Felipe Alfonso 2018-01-12 13:46:46 -03:00
parent 40262eb0cb
commit 5ca2805dbc
2 changed files with 4 additions and 4 deletions

View file

@ -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;
}
};

View file

@ -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;