mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 05:33:35 +00:00
Merge branch 'master' of https://github.com/photonstorm/phaser
This commit is contained in:
commit
d0878233e6
6 changed files with 219 additions and 156 deletions
|
@ -836,6 +836,10 @@ var Group = new Class({
|
|||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gameObject = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -853,6 +857,10 @@ var Group = new Class({
|
|||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gameObject = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -196,26 +196,6 @@ var Particle = new Class({
|
|||
*/
|
||||
this.rotation = 0;
|
||||
|
||||
/**
|
||||
* The horizontal scroll factor of this Particle.
|
||||
*
|
||||
* @name Phaser.GameObjects.Particles.Particle#scrollFactorX
|
||||
* @type {number}
|
||||
* @default 1
|
||||
* @since 3.0.0
|
||||
*/
|
||||
this.scrollFactorX = 1;
|
||||
|
||||
/**
|
||||
* The vertical scroll factor of this Particle.
|
||||
*
|
||||
* @name Phaser.GameObjects.Particles.Particle#scrollFactorY
|
||||
* @type {number}
|
||||
* @default 1
|
||||
* @since 3.0.0
|
||||
*/
|
||||
this.scrollFactorY = 1;
|
||||
|
||||
/**
|
||||
* The tint applied to this Particle.
|
||||
*
|
||||
|
|
|
@ -85,8 +85,8 @@ var ParticleManagerCanvasRenderer = function (renderer, emitterManager, interpol
|
|||
var x = -ox;
|
||||
var y = -oy;
|
||||
|
||||
var tx = particle.x - cameraScrollX * particle.scrollFactorX;
|
||||
var ty = particle.y - cameraScrollY * particle.scrollFactorY;
|
||||
var tx = particle.x - cameraScrollX;
|
||||
var ty = particle.y - cameraScrollY;
|
||||
|
||||
if (roundPixels)
|
||||
{
|
||||
|
|
|
@ -716,11 +716,11 @@ var FlatTintPipeline = new Class({
|
|||
|
||||
var cameraScrollX = camera.scrollX * graphics.scrollFactorX;
|
||||
var cameraScrollY = camera.scrollY * graphics.scrollFactorY;
|
||||
var srcX = graphics.x - cameraScrollX;
|
||||
var srcY = graphics.y - cameraScrollY;
|
||||
var srcX = graphics.x;
|
||||
var srcY = graphics.y;
|
||||
var srcScaleX = graphics.scaleX;
|
||||
var srcScaleY = graphics.scaleY;
|
||||
var srcRotation = -graphics.rotation;
|
||||
var srcRotation = graphics.rotation;
|
||||
var commands = graphics.commandBuffer;
|
||||
var alpha = graphics.alpha;
|
||||
var lineAlpha = 1.0;
|
||||
|
@ -748,8 +748,8 @@ var FlatTintPipeline = new Class({
|
|||
var sr = sin(srcRotation);
|
||||
var cr = cos(srcRotation);
|
||||
var sra = cr * srcScaleX;
|
||||
var srb = -sr * srcScaleX;
|
||||
var src = sr * srcScaleY;
|
||||
var srb = sr * srcScaleX;
|
||||
var src = -sr * srcScaleY;
|
||||
var srd = cr * srcScaleY;
|
||||
var sre = srcX;
|
||||
var srf = srcY;
|
||||
|
@ -769,12 +769,17 @@ var FlatTintPipeline = new Class({
|
|||
var pmd = parentMatrix[3];
|
||||
var pme = parentMatrix[4];
|
||||
var pmf = parentMatrix[5];
|
||||
var pca = cma * pma + cmb * pmc;
|
||||
var pcb = cma * pmb + cmb * pmd;
|
||||
var pcc = cmc * pma + cmd * pmc;
|
||||
var pcd = cmc * pmb + cmd * pmd;
|
||||
var pce = cme * pma + cmf * pmc + pme;
|
||||
var pcf = cme * pmb + cmf * pmd + pmf;
|
||||
var cse = -cameraScrollX;
|
||||
var csf = -cameraScrollY;
|
||||
var pse = cse * cma + csf * cmc + cme;
|
||||
var psf = cse * cmb + csf * cmd + cmf;
|
||||
var pca = pma * cma + pmb * cmc;
|
||||
var pcb = pma * cmb + pmb * cmd;
|
||||
var pcc = pmc * cma + pmd * cmc;
|
||||
var pcd = pmc * cmb + pmd * cmd;
|
||||
var pce = pme * cma + pmf * cmc + pse;
|
||||
var pcf = pme * cmb + pmf * cmd + psf;
|
||||
|
||||
mva = sra * pca + srb * pcc;
|
||||
mvb = sra * pcb + srb * pcd;
|
||||
mvc = src * pca + srd * pcc;
|
||||
|
@ -784,6 +789,9 @@ var FlatTintPipeline = new Class({
|
|||
}
|
||||
else
|
||||
{
|
||||
sre -= cameraScrollX;
|
||||
srf -= cameraScrollY;
|
||||
|
||||
mva = sra * cma + srb * cmc;
|
||||
mvb = sra * cmb + srb * cmd;
|
||||
mvc = src * cma + srd * cmc;
|
||||
|
|
|
@ -127,9 +127,10 @@ var ForwardDiffuseLightPipeline = new Class({
|
|||
*
|
||||
* @param {Phaser.Tilemaps.StaticTilemapLayer} tilemap - [description]
|
||||
* @param {Phaser.Cameras.Scene2D.Camera} camera - [description]
|
||||
* @param {Phaser.GameObjects.Components.TransformMatrix} parentTransformMatrix - [description]
|
||||
*
|
||||
*/
|
||||
drawStaticTilemapLayer: function (tilemap, camera)
|
||||
drawStaticTilemapLayer: function (tilemap, camera, parentTransformMatrix)
|
||||
{
|
||||
var normalTexture = tilemap.texture.dataSource[0];
|
||||
|
||||
|
@ -137,12 +138,12 @@ var ForwardDiffuseLightPipeline = new Class({
|
|||
{
|
||||
this.renderer.setPipeline(this);
|
||||
this.setTexture2D(normalTexture.glTexture, 1);
|
||||
TextureTintPipeline.prototype.drawStaticTilemapLayer.call(this, tilemap, camera);
|
||||
TextureTintPipeline.prototype.drawStaticTilemapLayer.call(this, tilemap, camera, parentTransformMatrix);
|
||||
}
|
||||
else
|
||||
{
|
||||
console.warn('Normal map texture missing for using Light2D pipeline. StaticTilemapLayer rendered with default pipeline.');
|
||||
this.renderer.pipelines.TextureTintPipeline.drawStaticTilemapLayer(tilemap, camera);
|
||||
this.renderer.pipelines.TextureTintPipeline.drawStaticTilemapLayer(tilemap, camera, parentTransformMatrix);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -154,9 +155,10 @@ var ForwardDiffuseLightPipeline = new Class({
|
|||
*
|
||||
* @param {Phaser.GameObjects.Particles.ParticleEmitterManager} emitterManager - [description]
|
||||
* @param {Phaser.Cameras.Scene2D.Camera} camera - [description]
|
||||
* @param {Phaser.GameObjects.Components.TransformMatrix} parentTransformMatrix - [description]
|
||||
*
|
||||
*/
|
||||
drawEmitterManager: function (emitterManager, camera)
|
||||
drawEmitterManager: function (emitterManager, camera, parentTransformMatrix)
|
||||
{
|
||||
var normalTexture = emitterManager.texture.dataSource[0];
|
||||
|
||||
|
@ -164,12 +166,12 @@ var ForwardDiffuseLightPipeline = new Class({
|
|||
{
|
||||
this.renderer.setPipeline(this);
|
||||
this.setTexture2D(normalTexture.glTexture, 1);
|
||||
TextureTintPipeline.prototype.drawEmitterManager.call(this, emitterManager, camera);
|
||||
TextureTintPipeline.prototype.drawEmitterManager.call(this, emitterManager, camera, parentTransformMatrix);
|
||||
}
|
||||
else
|
||||
{
|
||||
console.warn('Normal map texture missing for using Light2D pipeline. EmitterManager rendered with default pipeline.');
|
||||
this.renderer.pipelines.TextureTintPipeline.drawEmitterManager(emitterManager, camera);
|
||||
this.renderer.pipelines.TextureTintPipeline.drawEmitterManager(emitterManager, camera, parentTransformMatrix);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -181,9 +183,10 @@ var ForwardDiffuseLightPipeline = new Class({
|
|||
*
|
||||
* @param {Phaser.GameObjects.Blitter} blitter - [description]
|
||||
* @param {Phaser.Cameras.Scene2D.Camera} camera - [description]
|
||||
* @param {Phaser.GameObjects.Components.TransformMatrix} parentTransformMatrix - [description]
|
||||
*
|
||||
*/
|
||||
drawBlitter: function (blitter, camera)
|
||||
drawBlitter: function (blitter, camera, parentTransformMatrix)
|
||||
{
|
||||
var normalTexture = blitter.texture.dataSource[0];
|
||||
|
||||
|
@ -191,12 +194,12 @@ var ForwardDiffuseLightPipeline = new Class({
|
|||
{
|
||||
this.renderer.setPipeline(this);
|
||||
this.setTexture2D(normalTexture.glTexture, 1);
|
||||
TextureTintPipeline.prototype.drawBlitter.call(this, blitter, camera);
|
||||
TextureTintPipeline.prototype.drawBlitter.call(this, blitter, camera, parentTransformMatrix);
|
||||
}
|
||||
else
|
||||
{
|
||||
console.warn('Normal map texture missing for using Light2D pipeline. Blitter rendered with default pipeline.');
|
||||
this.renderer.pipelines.TextureTintPipeline.drawBlitter(blitter, camera);
|
||||
this.renderer.pipelines.TextureTintPipeline.drawBlitter(blitter, camera, parentTransformMatrix);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -208,9 +211,10 @@ var ForwardDiffuseLightPipeline = new Class({
|
|||
*
|
||||
* @param {Phaser.GameObjects.Sprite} sprite - [description]
|
||||
* @param {Phaser.Cameras.Scene2D.Camera} camera - [description]
|
||||
* @param {Phaser.GameObjects.Components.TransformMatrix} parentTransformMatrix - [description]
|
||||
*
|
||||
*/
|
||||
batchSprite: function (sprite, camera)
|
||||
batchSprite: function (sprite, camera, parentTransformMatrix)
|
||||
{
|
||||
var normalTexture = sprite.texture.dataSource[0];
|
||||
|
||||
|
@ -218,12 +222,12 @@ var ForwardDiffuseLightPipeline = new Class({
|
|||
{
|
||||
this.renderer.setPipeline(this);
|
||||
this.setTexture2D(normalTexture.glTexture, 1);
|
||||
TextureTintPipeline.prototype.batchSprite.call(this, sprite, camera);
|
||||
TextureTintPipeline.prototype.batchSprite.call(this, sprite, camera, parentTransformMatrix);
|
||||
}
|
||||
else
|
||||
{
|
||||
console.warn('Normal map texture missing for using Light2D pipeline. Sprite rendered with default pipeline.');
|
||||
this.renderer.pipelines.TextureTintPipeline.batchSprite(sprite, camera);
|
||||
this.renderer.pipelines.TextureTintPipeline.batchSprite(sprite, camera, parentTransformMatrix);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -235,9 +239,10 @@ var ForwardDiffuseLightPipeline = new Class({
|
|||
*
|
||||
* @param {Phaser.GameObjects.Mesh} mesh - [description]
|
||||
* @param {Phaser.Cameras.Scene2D.Camera} camera - [description]
|
||||
* @param {Phaser.GameObjects.Components.TransformMatrix} parentTransformMatrix - [description]
|
||||
*
|
||||
*/
|
||||
batchMesh: function (mesh, camera)
|
||||
batchMesh: function (mesh, camera, parentTransformMatrix)
|
||||
{
|
||||
var normalTexture = mesh.texture.dataSource[0];
|
||||
|
||||
|
@ -245,12 +250,12 @@ var ForwardDiffuseLightPipeline = new Class({
|
|||
{
|
||||
this.renderer.setPipeline(this);
|
||||
this.setTexture2D(normalTexture.glTexture, 1);
|
||||
TextureTintPipeline.prototype.batchMesh.call(this, mesh, camera);
|
||||
TextureTintPipeline.prototype.batchMesh.call(this, mesh, camera, parentTransformMatrix);
|
||||
}
|
||||
else
|
||||
{
|
||||
console.warn('Normal map texture missing for using Light2D pipeline. Mesh rendered with default pipeline.');
|
||||
this.renderer.pipelines.TextureTintPipeline.batchMesh(mesh, camera);
|
||||
this.renderer.pipelines.TextureTintPipeline.batchMesh(mesh, camera, parentTransformMatrix);
|
||||
|
||||
}
|
||||
},
|
||||
|
@ -263,9 +268,10 @@ var ForwardDiffuseLightPipeline = new Class({
|
|||
*
|
||||
* @param {Phaser.GameObjects.BitmapText} bitmapText - [description]
|
||||
* @param {Phaser.Cameras.Scene2D.Camera} camera - [description]
|
||||
* @param {Phaser.GameObjects.Components.TransformMatrix} parentTransformMatrix - [description]
|
||||
*
|
||||
*/
|
||||
batchBitmapText: function (bitmapText, camera)
|
||||
batchBitmapText: function (bitmapText, camera, parentTransformMatrix)
|
||||
{
|
||||
var normalTexture = bitmapText.texture.dataSource[0];
|
||||
|
||||
|
@ -273,12 +279,12 @@ var ForwardDiffuseLightPipeline = new Class({
|
|||
{
|
||||
this.renderer.setPipeline(this);
|
||||
this.setTexture2D(normalTexture.glTexture, 1);
|
||||
TextureTintPipeline.prototype.batchBitmapText.call(this, bitmapText, camera);
|
||||
TextureTintPipeline.prototype.batchBitmapText.call(this, bitmapText, camera, parentTransformMatrix);
|
||||
}
|
||||
else
|
||||
{
|
||||
console.warn('Normal map texture missing for using Light2D pipeline. BitmapText rendered with default pipeline.');
|
||||
this.renderer.pipelines.TextureTintPipeline.batchBitmapText(bitmapText, camera);
|
||||
this.renderer.pipelines.TextureTintPipeline.batchBitmapText(bitmapText, camera, parentTransformMatrix);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -290,9 +296,10 @@ var ForwardDiffuseLightPipeline = new Class({
|
|||
*
|
||||
* @param {Phaser.GameObjects.DynamicBitmapText} bitmapText - [description]
|
||||
* @param {Phaser.Cameras.Scene2D.Camera} camera - [description]
|
||||
* @param {Phaser.GameObjects.Components.TransformMatrix} parentTransformMatrix - [description]
|
||||
*
|
||||
*/
|
||||
batchDynamicBitmapText: function (bitmapText, camera)
|
||||
batchDynamicBitmapText: function (bitmapText, camera, parentTransformMatrix)
|
||||
{
|
||||
var normalTexture = bitmapText.texture.dataSource[0];
|
||||
|
||||
|
@ -300,12 +307,12 @@ var ForwardDiffuseLightPipeline = new Class({
|
|||
{
|
||||
this.renderer.setPipeline(this);
|
||||
this.setTexture2D(normalTexture.glTexture, 1);
|
||||
TextureTintPipeline.prototype.batchDynamicBitmapText.call(this, bitmapText, camera);
|
||||
TextureTintPipeline.prototype.batchDynamicBitmapText.call(this, bitmapText, camera, parentTransformMatrix);
|
||||
}
|
||||
else
|
||||
{
|
||||
console.warn('Normal map texture missing for using Light2D pipeline. DynamicBitmapText rendered with default pipeline.');
|
||||
this.renderer.pipelines.TextureTintPipeline.batchDynamicBitmapText(bitmapText, camera);
|
||||
this.renderer.pipelines.TextureTintPipeline.batchDynamicBitmapText(bitmapText, camera, parentTransformMatrix);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -317,9 +324,10 @@ var ForwardDiffuseLightPipeline = new Class({
|
|||
*
|
||||
* @param {Phaser.GameObjects.Text} text - [description]
|
||||
* @param {Phaser.Cameras.Scene2D.Camera} camera - [description]
|
||||
* @param {Phaser.GameObjects.Components.TransformMatrix} parentTransformMatrix - [description]
|
||||
*
|
||||
*/
|
||||
batchText: function (text, camera)
|
||||
batchText: function (text, camera, parentTransformMatrix)
|
||||
{
|
||||
var normalTexture = text.texture.dataSource[0];
|
||||
|
||||
|
@ -327,12 +335,12 @@ var ForwardDiffuseLightPipeline = new Class({
|
|||
{
|
||||
this.renderer.setPipeline(this);
|
||||
this.setTexture2D(normalTexture.glTexture, 1);
|
||||
TextureTintPipeline.prototype.batchText.call(this, text, camera);
|
||||
TextureTintPipeline.prototype.batchText.call(this, text, camera, parentTransformMatrix);
|
||||
}
|
||||
else
|
||||
{
|
||||
console.warn('Normal map texture missing for using Light2D pipeline. Text rendered with default pipeline.');
|
||||
this.renderer.pipelines.TextureTintPipeline.batchText(text, camera);
|
||||
this.renderer.pipelines.TextureTintPipeline.batchText(text, camera, parentTransformMatrix);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -344,9 +352,10 @@ var ForwardDiffuseLightPipeline = new Class({
|
|||
*
|
||||
* @param {Phaser.Tilemaps.DynamicTilemapLayer} tilemapLayer - [description]
|
||||
* @param {Phaser.Cameras.Scene2D.Camera} camera - [description]
|
||||
* @param {Phaser.GameObjects.Components.TransformMatrix} parentTransformMatrix - [description]
|
||||
*
|
||||
*/
|
||||
batchDynamicTilemapLayer: function (tilemapLayer, camera)
|
||||
batchDynamicTilemapLayer: function (tilemapLayer, camera, parentTransformMatrix)
|
||||
{
|
||||
var normalTexture = tilemapLayer.texture.dataSource[0];
|
||||
|
||||
|
@ -354,12 +363,12 @@ var ForwardDiffuseLightPipeline = new Class({
|
|||
{
|
||||
this.renderer.setPipeline(this);
|
||||
this.setTexture2D(normalTexture.glTexture, 1);
|
||||
TextureTintPipeline.prototype.batchDynamicTilemapLayer.call(this, tilemapLayer, camera);
|
||||
TextureTintPipeline.prototype.batchDynamicTilemapLayer.call(this, tilemapLayer, camera, parentTransformMatrix);
|
||||
}
|
||||
else
|
||||
{
|
||||
console.warn('Normal map texture missing for using Light2D pipeline. DynamicTilemapLayer rendered with default pipeline.');
|
||||
this.renderer.pipelines.TextureTintPipeline.batchDynamicTilemapLayer(tilemapLayer, camera);
|
||||
this.renderer.pipelines.TextureTintPipeline.batchDynamicTilemapLayer(tilemapLayer, camera, parentTransformMatrix);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -371,9 +380,10 @@ var ForwardDiffuseLightPipeline = new Class({
|
|||
*
|
||||
* @param {Phaser.GameObjects.TileSprite} tileSprite - [description]
|
||||
* @param {Phaser.Cameras.Scene2D.Camera} camera - [description]
|
||||
* @param {Phaser.GameObjects.Components.TransformMatrix} parentTransformMatrix - [description]
|
||||
*
|
||||
*/
|
||||
batchTileSprite: function (tileSprite, camera)
|
||||
batchTileSprite: function (tileSprite, camera, parentTransformMatrix)
|
||||
{
|
||||
var normalTexture = tileSprite.texture.dataSource[0];
|
||||
|
||||
|
@ -381,12 +391,12 @@ var ForwardDiffuseLightPipeline = new Class({
|
|||
{
|
||||
this.renderer.setPipeline(this);
|
||||
this.setTexture2D(normalTexture.glTexture, 1);
|
||||
TextureTintPipeline.prototype.batchTileSprite.call(this, tileSprite, camera);
|
||||
TextureTintPipeline.prototype.batchTileSprite.call(this, tileSprite, camera, parentTransformMatrix);
|
||||
}
|
||||
else
|
||||
{
|
||||
console.warn('Normal map texture missing for using Light2D pipeline. TileSprite rendered with default pipeline.');
|
||||
this.renderer.pipelines.TextureTintPipeline.batchTileSprite(tileSprite, camera);
|
||||
this.renderer.pipelines.TextureTintPipeline.batchTileSprite(tileSprite, camera, parentTransformMatrix);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -401,29 +401,16 @@ var TextureTintPipeline = new Class({
|
|||
var vertexCapacity = this.vertexCapacity;
|
||||
var texture = emitterManager.defaultFrame.source.glTexture;
|
||||
var pca, pcb, pcc, pcd, pce, pcf;
|
||||
var pma, pmb, pmc, pmd, pme, pmf;
|
||||
|
||||
if (parentMatrix)
|
||||
{
|
||||
var pma = parentMatrix[0];
|
||||
var pmb = parentMatrix[1];
|
||||
var pmc = parentMatrix[2];
|
||||
var pmd = parentMatrix[3];
|
||||
var pme = parentMatrix[4];
|
||||
var pmf = parentMatrix[5];
|
||||
|
||||
pca = cma * pma + cmb * pmc;
|
||||
pcb = cma * pmb + cmb * pmd;
|
||||
pcc = cmc * pma + cmd * pmc;
|
||||
pcd = cmc * pmb + cmd * pmd;
|
||||
pce = cme * pma + cmf * pmc + pme;
|
||||
pcf = cme * pmb + cmf * pmd + pmf;
|
||||
|
||||
cma = pca;
|
||||
cmb = pcb;
|
||||
cmc = pcc;
|
||||
cmd = pcd;
|
||||
cme = pce;
|
||||
cmf = pcf;
|
||||
pma = parentMatrix[0];
|
||||
pmb = parentMatrix[1];
|
||||
pmc = parentMatrix[2];
|
||||
pmd = parentMatrix[3];
|
||||
pme = parentMatrix[4];
|
||||
pmf = parentMatrix[5];
|
||||
}
|
||||
|
||||
this.setTexture2D(texture, 0);
|
||||
|
@ -438,6 +425,31 @@ var TextureTintPipeline = new Class({
|
|||
var scrollX = cameraScrollX * emitter.scrollFactorX;
|
||||
var scrollY = cameraScrollY * emitter.scrollFactorY;
|
||||
|
||||
if (parentMatrix)
|
||||
{
|
||||
var cse = -scrollX;
|
||||
var csf = -scrollY;
|
||||
var pse = cse * cma + csf * cmc + cme;
|
||||
var psf = cse * cmb + csf * cmd + cmf;
|
||||
var pca = pma * cma + pmb * cmc;
|
||||
var pcb = pma * cmb + pmb * cmd;
|
||||
var pcc = pmc * cma + pmd * cmc;
|
||||
var pcd = pmc * cmb + pmd * cmd;
|
||||
var pce = pme * cma + pmf * cmc + pse;
|
||||
var pcf = pme * cmb + pmf * cmd + psf;
|
||||
|
||||
cma = pca;
|
||||
cmb = pcb;
|
||||
cmc = pcc;
|
||||
cmd = pcd;
|
||||
cme = pce;
|
||||
cmf = pcf;
|
||||
|
||||
scrollX = 0.0;
|
||||
scrollY = 0.0;
|
||||
}
|
||||
|
||||
|
||||
if (!emitter.visible || aliveLength === 0)
|
||||
{
|
||||
continue;
|
||||
|
@ -474,11 +486,11 @@ var TextureTintPipeline = new Class({
|
|||
var sr = sin(particle.rotation);
|
||||
var cr = cos(particle.rotation);
|
||||
var sra = cr * particle.scaleX;
|
||||
var srb = -sr * particle.scaleX;
|
||||
var src = sr * particle.scaleY;
|
||||
var srb = sr * particle.scaleX;
|
||||
var src = -sr * particle.scaleY;
|
||||
var srd = cr * particle.scaleY;
|
||||
var sre = particle.x - scrollX * particle.scrollFactorX;
|
||||
var srf = particle.y - scrollY * particle.scrollFactorY;
|
||||
var sre = particle.x - scrollX;
|
||||
var srf = particle.y - scrollY;
|
||||
var mva = sra * cma + srb * cmc;
|
||||
var mvb = sra * cmb + srb * cmd;
|
||||
var mvc = src * cma + srd * cmc;
|
||||
|
@ -600,8 +612,6 @@ var TextureTintPipeline = new Class({
|
|||
var cameraScrollY = camera.scrollY * blitter.scrollFactorY;
|
||||
var batchCount = Math.ceil(length / this.maxQuads);
|
||||
var batchOffset = 0;
|
||||
var blitterX = blitter.x - cameraScrollX;
|
||||
var blitterY = blitter.y - cameraScrollY;
|
||||
|
||||
if (parentMatrix)
|
||||
{
|
||||
|
@ -611,12 +621,16 @@ var TextureTintPipeline = new Class({
|
|||
var pmd = parentMatrix[3];
|
||||
var pme = parentMatrix[4];
|
||||
var pmf = parentMatrix[5];
|
||||
var pca = a * pma + b * pmc;
|
||||
var pcb = a * pmb + b * pmd;
|
||||
var pcc = c * pma + d * pmc;
|
||||
var pcd = c * pmb + d * pmd;
|
||||
var pce = e * pma + f * pmc + pme;
|
||||
var pcf = e * pmb + f * pmd + pmf;
|
||||
var cse = -cameraScrollX;
|
||||
var csf = -cameraScrollY;
|
||||
var pse = cse * cma + csf * cmc + cme;
|
||||
var psf = cse * cmb + csf * cmd + cmf;
|
||||
var pca = pma * cma + pmb * cmc;
|
||||
var pcb = pma * cmb + pmb * cmd;
|
||||
var pcc = pmc * cma + pmd * cmc;
|
||||
var pcd = pmc * cmb + pmd * cmd;
|
||||
var pce = pme * cma + pmf * cmc + pse;
|
||||
var pcf = pme * cmb + pmf * cmd + psf;
|
||||
|
||||
a = pca;
|
||||
b = pcb;
|
||||
|
@ -624,8 +638,14 @@ var TextureTintPipeline = new Class({
|
|||
d = pcd;
|
||||
e = pce;
|
||||
f = pcf;
|
||||
|
||||
cameraScrollX = 0.0;
|
||||
cameraScrollY = 0.0;
|
||||
}
|
||||
|
||||
var blitterX = blitter.x - cameraScrollX;
|
||||
var blitterY = blitter.y - cameraScrollY;
|
||||
|
||||
for (var batchIndex = 0; batchIndex < batchCount; ++batchIndex)
|
||||
{
|
||||
var batchSize = Math.min(length, this.maxQuads);
|
||||
|
@ -757,11 +777,11 @@ var TextureTintPipeline = new Class({
|
|||
var y = -sprite.displayOriginY + frame.y + ((frame.height) * (flipY ? 1.0 : 0.0));
|
||||
var xw = (roundPixels ? (x|0) : x) + width;
|
||||
var yh = (roundPixels ? (y|0) : y) + height;
|
||||
var translateX = sprite.x - camera.scrollX * sprite.scrollFactorX;
|
||||
var translateY = sprite.y - camera.scrollY * sprite.scrollFactorY;
|
||||
var translateX = sprite.x;
|
||||
var translateY = sprite.y;
|
||||
var scaleX = sprite.scaleX;
|
||||
var scaleY = sprite.scaleY;
|
||||
var rotation = -sprite.rotation;
|
||||
var rotation = sprite.rotation;
|
||||
var alphaTL = sprite._alphaTL;
|
||||
var alphaTR = sprite._alphaTR;
|
||||
var alphaBL = sprite._alphaBL;
|
||||
|
@ -773,11 +793,11 @@ var TextureTintPipeline = new Class({
|
|||
var sr = Math.sin(rotation);
|
||||
var cr = Math.cos(rotation);
|
||||
var sra = cr * scaleX;
|
||||
var srb = -sr * scaleX;
|
||||
var src = sr * scaleY;
|
||||
var srb = sr * scaleX;
|
||||
var src = -sr * scaleY;
|
||||
var srd = cr * scaleY;
|
||||
var sre = translateX;
|
||||
var srf = translateY;
|
||||
var sre = sprite.x;
|
||||
var srf = sprite.y;
|
||||
var cma = cameraMatrix[0];
|
||||
var cmb = cameraMatrix[1];
|
||||
var cmc = cameraMatrix[2];
|
||||
|
@ -794,12 +814,17 @@ var TextureTintPipeline = new Class({
|
|||
var pmd = parentMatrix[3];
|
||||
var pme = parentMatrix[4];
|
||||
var pmf = parentMatrix[5];
|
||||
var pca = cma * pma + cmb * pmc;
|
||||
var pcb = cma * pmb + cmb * pmd;
|
||||
var pcc = cmc * pma + cmd * pmc;
|
||||
var pcd = cmc * pmb + cmd * pmd;
|
||||
var pce = cme * pma + cmf * pmc + pme;
|
||||
var pcf = cme * pmb + cmf * pmd + pmf;
|
||||
var cse = -camera.scrollX * sprite.scrollFactorX;
|
||||
var csf = -camera.scrollY * sprite.scrollFactorY;
|
||||
var pse = cse * cma + csf * cmc + cme;
|
||||
var psf = cse * cmb + csf * cmd + cmf;
|
||||
var pca = pma * cma + pmb * cmc;
|
||||
var pcb = pma * cmb + pmb * cmd;
|
||||
var pcc = pmc * cma + pmd * cmc;
|
||||
var pcd = pmc * cmb + pmd * cmd;
|
||||
var pce = pme * cma + pmf * cmc + pse;
|
||||
var pcf = pme * cmb + pmf * cmd + psf;
|
||||
|
||||
mva = sra * pca + srb * pcc;
|
||||
mvb = sra * pcb + srb * pcd;
|
||||
mvc = src * pca + srd * pcc;
|
||||
|
@ -809,6 +834,9 @@ var TextureTintPipeline = new Class({
|
|||
}
|
||||
else
|
||||
{
|
||||
sre -= camera.scrollX * sprite.scrollFactorX;
|
||||
srf -= camera.scrollY * sprite.scrollFactorY;
|
||||
|
||||
mva = sra * cma + srb * cmc;
|
||||
mvb = sra * cmb + srb * cmd;
|
||||
mvc = src * cma + srd * cmc;
|
||||
|
@ -921,16 +949,16 @@ var TextureTintPipeline = new Class({
|
|||
var cameraMatrix = camera.matrix.matrix;
|
||||
var frame = mesh.frame;
|
||||
var texture = mesh.texture.source[frame.sourceIndex].glTexture;
|
||||
var translateX = mesh.x - camera.scrollX * mesh.scrollFactorX;
|
||||
var translateY = mesh.y - camera.scrollY * mesh.scrollFactorY;
|
||||
var translateX = mesh.x;
|
||||
var translateY = mesh.y;
|
||||
var scaleX = mesh.scaleX;
|
||||
var scaleY = mesh.scaleY;
|
||||
var rotation = -mesh.rotation;
|
||||
var rotation = mesh.rotation;
|
||||
var sr = Math.sin(rotation);
|
||||
var cr = Math.cos(rotation);
|
||||
var sra = cr * scaleX;
|
||||
var srb = -sr * scaleX;
|
||||
var src = sr * scaleY;
|
||||
var srb = sr * scaleX;
|
||||
var src = -sr * scaleY;
|
||||
var srd = cr * scaleY;
|
||||
var sre = translateX;
|
||||
var srf = translateY;
|
||||
|
@ -951,12 +979,17 @@ var TextureTintPipeline = new Class({
|
|||
var pmd = parentMatrix[3];
|
||||
var pme = parentMatrix[4];
|
||||
var pmf = parentMatrix[5];
|
||||
var pca = cma * pma + cmb * pmc;
|
||||
var pcb = cma * pmb + cmb * pmd;
|
||||
var pcc = cmc * pma + cmd * pmc;
|
||||
var pcd = cmc * pmb + cmd * pmd;
|
||||
var pce = cme * pma + cmf * pmc + pme;
|
||||
var pcf = cme * pmb + cmf * pmd + pmf;
|
||||
var cse = -camera.scrollX * mesh.scrollFactorX;
|
||||
var csf = -camera.scrollY * mesh.scrollFactorY;
|
||||
var pse = cse * cma + csf * cmc + cme;
|
||||
var psf = cse * cmb + csf * cmd + cmf;
|
||||
var pca = pma * cma + pmb * cmc;
|
||||
var pcb = pma * cmb + pmb * cmd;
|
||||
var pcc = pmc * cma + pmd * cmc;
|
||||
var pcd = pmc * cmb + pmd * cmd;
|
||||
var pce = pme * cma + pmf * cmc + pse;
|
||||
var pcf = pme * cmb + pmf * cmd + psf;
|
||||
|
||||
mva = sra * pca + srb * pcc;
|
||||
mvb = sra * pcb + srb * pcd;
|
||||
mvc = src * pca + srd * pcc;
|
||||
|
@ -966,6 +999,9 @@ var TextureTintPipeline = new Class({
|
|||
}
|
||||
else
|
||||
{
|
||||
sre -= camera.scrollX * mesh.scrollFactorX;
|
||||
srf -= camera.scrollY * mesh.scrollFactorY;
|
||||
|
||||
mva = sra * cma + srb * cmc;
|
||||
mvb = sra * cmb + srb * cmd;
|
||||
mvc = src * cma + srd * cmc;
|
||||
|
@ -1090,17 +1126,17 @@ var TextureTintPipeline = new Class({
|
|||
var vmax = 0;
|
||||
var lastGlyph = null;
|
||||
var lastCharCode = 0;
|
||||
var translateX = (srcX - cameraScrollX) + frame.x;
|
||||
var translateY = (srcY - cameraScrollY) + frame.y;
|
||||
var rotation = -bitmapText.rotation;
|
||||
var translateX = srcX + frame.x;
|
||||
var translateY = srcY + frame.y;
|
||||
var rotation = bitmapText.rotation;
|
||||
var scaleX = bitmapText.scaleX;
|
||||
var scaleY = bitmapText.scaleY;
|
||||
var letterSpacing = bitmapText.letterSpacing;
|
||||
var sr = Math.sin(rotation);
|
||||
var cr = Math.cos(rotation);
|
||||
var sra = cr * scaleX;
|
||||
var srb = -sr * scaleX;
|
||||
var src = sr * scaleY;
|
||||
var srb = sr * scaleX;
|
||||
var src = -sr * scaleY;
|
||||
var srd = cr * scaleY;
|
||||
var sre = translateX;
|
||||
var srf = translateY;
|
||||
|
@ -1121,12 +1157,17 @@ var TextureTintPipeline = new Class({
|
|||
var pmd = parentMatrix[3];
|
||||
var pme = parentMatrix[4];
|
||||
var pmf = parentMatrix[5];
|
||||
var pca = cma * pma + cmb * pmc;
|
||||
var pcb = cma * pmb + cmb * pmd;
|
||||
var pcc = cmc * pma + cmd * pmc;
|
||||
var pcd = cmc * pmb + cmd * pmd;
|
||||
var pce = cme * pma + cmf * pmc + pme;
|
||||
var pcf = cme * pmb + cmf * pmd + pmf;
|
||||
var cse = -cameraScrollX;
|
||||
var csf = -cameraScrollY;
|
||||
var pse = cse * cma + csf * cmc + cme;
|
||||
var psf = cse * cmb + csf * cmd + cmf;
|
||||
var pca = pma * cma + pmb * cmc;
|
||||
var pcb = pma * cmb + pmb * cmd;
|
||||
var pcc = pmc * cma + pmd * cmc;
|
||||
var pcd = pmc * cmb + pmd * cmd;
|
||||
var pce = pme * cma + pmf * cmc + pse;
|
||||
var pcf = pme * cmb + pmf * cmd + psf;
|
||||
|
||||
mva = sra * pca + srb * pcc;
|
||||
mvb = sra * pcb + srb * pcd;
|
||||
mvc = src * pca + srd * pcc;
|
||||
|
@ -1136,6 +1177,9 @@ var TextureTintPipeline = new Class({
|
|||
}
|
||||
else
|
||||
{
|
||||
sre -= cameraScrollX;
|
||||
srf -= cameraScrollY;
|
||||
|
||||
mva = sra * cma + srb * cmc;
|
||||
mvb = sra * cmb + srb * cmd;
|
||||
mvc = src * cma + srd * cmc;
|
||||
|
@ -1359,15 +1403,15 @@ var TextureTintPipeline = new Class({
|
|||
var lastCharCode = 0;
|
||||
var translateX = srcX + frame.x;
|
||||
var translateY = srcY + frame.y;
|
||||
var rotation = -bitmapText.rotation;
|
||||
var rotation = bitmapText.rotation;
|
||||
var scaleX = bitmapText.scaleX;
|
||||
var scaleY = bitmapText.scaleY;
|
||||
var letterSpacing = bitmapText.letterSpacing;
|
||||
var sr = Math.sin(rotation);
|
||||
var cr = Math.cos(rotation);
|
||||
var sra = cr * scaleX;
|
||||
var srb = -sr * scaleX;
|
||||
var src = sr * scaleY;
|
||||
var srb = sr * scaleX;
|
||||
var src = -sr * scaleY;
|
||||
var srd = cr * scaleY;
|
||||
var sre = translateX;
|
||||
var srf = translateY;
|
||||
|
@ -1390,12 +1434,17 @@ var TextureTintPipeline = new Class({
|
|||
var pmd = parentMatrix[3];
|
||||
var pme = parentMatrix[4];
|
||||
var pmf = parentMatrix[5];
|
||||
var pca = cma * pma + cmb * pmc;
|
||||
var pcb = cma * pmb + cmb * pmd;
|
||||
var pcc = cmc * pma + cmd * pmc;
|
||||
var pcd = cmc * pmb + cmd * pmd;
|
||||
var pce = cme * pma + cmf * pmc + pme;
|
||||
var pcf = cme * pmb + cmf * pmd + pmf;
|
||||
var cse = -cameraScrollX;
|
||||
var csf = -cameraScrollY;
|
||||
var pse = cse * cma + csf * cmc + cme;
|
||||
var psf = cse * cmb + csf * cmd + cmf;
|
||||
var pca = pma * cma + pmb * cmc;
|
||||
var pcb = pma * cmb + pmb * cmd;
|
||||
var pcc = pmc * cma + pmd * cmc;
|
||||
var pcd = pmc * cmb + pmd * cmd;
|
||||
var pce = pme * cma + pmf * cmc + pse;
|
||||
var pcf = pme * cmb + pmf * cmd + psf;
|
||||
|
||||
mva = sra * pca + srb * pcc;
|
||||
mvb = sra * pcb + srb * pcd;
|
||||
mvc = src * pca + srd * pcc;
|
||||
|
@ -1405,6 +1454,9 @@ var TextureTintPipeline = new Class({
|
|||
}
|
||||
else
|
||||
{
|
||||
sre -= cameraScrollX;
|
||||
srf -= cameraScrollY;
|
||||
|
||||
mva = sra * cma + srb * cmc;
|
||||
mvb = sra * cmb + srb * cmd;
|
||||
mvc = src * cma + srd * cmc;
|
||||
|
@ -1523,14 +1575,12 @@ var TextureTintPipeline = new Class({
|
|||
y -= bitmapText.displayOriginY;
|
||||
x *= scale;
|
||||
y *= scale;
|
||||
x -= cameraScrollX;
|
||||
y -= cameraScrollY;
|
||||
|
||||
sr = Math.sin(-rotation);
|
||||
cr = Math.cos(-rotation);
|
||||
sr = Math.sin(rotation);
|
||||
cr = Math.cos(rotation);
|
||||
uta = cr * scale;
|
||||
utb = -sr * scale;
|
||||
utc = sr * scale;
|
||||
utb = sr * scale;
|
||||
utc = -sr * scale;
|
||||
utd = cr * scale;
|
||||
ute = x;
|
||||
utf = y;
|
||||
|
@ -1816,7 +1866,6 @@ var TextureTintPipeline = new Class({
|
|||
}
|
||||
|
||||
flipY = flipY ^ (texture.isRenderTexture ? 1 : 0);
|
||||
rotation = -rotation;
|
||||
|
||||
var roundPixels = this.renderer.config.roundPixels;
|
||||
var vertexViewF32 = this.vertexViewF32;
|
||||
|
@ -1828,13 +1877,13 @@ var TextureTintPipeline = new Class({
|
|||
var y = -displayOriginY + ((srcHeight) * (flipY ? 1.0 : 0.0));
|
||||
var xw = x + width;
|
||||
var yh = y + height;
|
||||
var translateX = srcX - camera.scrollX * scrollFactorX;
|
||||
var translateY = srcY - camera.scrollY * scrollFactorY;
|
||||
var translateX = srcX;
|
||||
var translateY = srcY;
|
||||
var sr = Math.sin(rotation);
|
||||
var cr = Math.cos(rotation);
|
||||
var sra = cr * scaleX;
|
||||
var srb = -sr * scaleX;
|
||||
var src = sr * scaleY;
|
||||
var srb = sr * scaleX;
|
||||
var src = -sr * scaleY;
|
||||
var srd = cr * scaleY;
|
||||
var sre = translateX;
|
||||
var srf = translateY;
|
||||
|
@ -1854,12 +1903,17 @@ var TextureTintPipeline = new Class({
|
|||
var pmd = parentMatrix[3];
|
||||
var pme = parentMatrix[4];
|
||||
var pmf = parentMatrix[5];
|
||||
var pca = cma * pma + cmb * pmc;
|
||||
var pcb = cma * pmb + cmb * pmd;
|
||||
var pcc = cmc * pma + cmd * pmc;
|
||||
var pcd = cmc * pmb + cmd * pmd;
|
||||
var pce = cme * pma + cmf * pmc + pme;
|
||||
var pcf = cme * pmb + cmf * pmd + pmf;
|
||||
var cse = -camera.scrollX * scrollFactorX;
|
||||
var csf = -camera.scrollY * scrollFactorY;
|
||||
var pse = cse * cma + csf * cmc + cme;
|
||||
var psf = cse * cmb + csf * cmd + cmf;
|
||||
var pca = pma * cma + pmb * cmc;
|
||||
var pcb = pma * cmb + pmb * cmd;
|
||||
var pcc = pmc * cma + pmd * cmc;
|
||||
var pcd = pmc * cmb + pmd * cmd;
|
||||
var pce = pme * cma + pmf * cmc + pse;
|
||||
var pcf = pme * cmb + pmf * cmd + psf;
|
||||
|
||||
mva = sra * pca + srb * pcc;
|
||||
mvb = sra * pcb + srb * pcd;
|
||||
mvc = src * pca + srd * pcc;
|
||||
|
@ -1869,6 +1923,9 @@ var TextureTintPipeline = new Class({
|
|||
}
|
||||
else
|
||||
{
|
||||
sre -= camera.scrollX * scrollFactorX;
|
||||
srf -= camera.scrollY * scrollFactorY;
|
||||
|
||||
mva = sra * cma + srb * cmc;
|
||||
mvb = sra * cmb + srb * cmd;
|
||||
mvc = src * cma + srd * cmc;
|
||||
|
|
Loading…
Reference in a new issue