Skip to content

Commit 4481795

Browse files
committed
Swapped to using getX / getY
1 parent 8873bdc commit 4481795

5 files changed

Lines changed: 50 additions & 49 deletions

File tree

src/gameobjects/bitmaptext/static/BitmapTextWebGLRenderer.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -189,17 +189,17 @@ var BitmapTextWebGLRenderer = function (renderer, src, interpolationPercentage,
189189
var xw = x + (glyphW * scale);
190190
var yh = y + (glyphH * scale);
191191

192-
var tx0 = x * calcMatrix.a + y * calcMatrix.c + calcMatrix.e;
193-
var ty0 = x * calcMatrix.b + y * calcMatrix.d + calcMatrix.f;
192+
var tx0 = calcMatrix.getX(x, y);
193+
var ty0 = calcMatrix.getY(x, y);
194194

195-
var tx1 = x * calcMatrix.a + yh * calcMatrix.c + calcMatrix.e;
196-
var ty1 = x * calcMatrix.b + yh * calcMatrix.d + calcMatrix.f;
195+
var tx1 = calcMatrix.getX(x, yh);
196+
var ty1 = calcMatrix.getY(x, yh);
197197

198-
var tx2 = xw * calcMatrix.a + yh * calcMatrix.c + calcMatrix.e;
199-
var ty2 = xw * calcMatrix.b + yh * calcMatrix.d + calcMatrix.f;
198+
var tx2 = calcMatrix.getX(xw, yh);
199+
var ty2 = calcMatrix.getY(xw, yh);
200200

201-
var tx3 = xw * calcMatrix.a + y * calcMatrix.c + calcMatrix.e;
202-
var ty3 = xw * calcMatrix.b + y * calcMatrix.d + calcMatrix.f;
201+
var tx3 = calcMatrix.getX(xw, y);
202+
var ty3 = calcMatrix.getY(xw, y);
203203

204204
if (roundPixels)
205205
{

src/gameobjects/blitter/BlitterWebGLRenderer.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ var BlitterWebGLRenderer = function (renderer, src, interpolationPercentage, cam
3737
var cameraScrollX = camera.scrollX * src.scrollFactorX;
3838
var cameraScrollY = camera.scrollY * src.scrollFactorY;
3939

40-
var matrix = pipeline._tempMatrix1;
40+
var calcMatrix = pipeline._tempMatrix1;
4141

42-
matrix.copyFrom(camera.matrix);
42+
calcMatrix.copyFrom(camera.matrix);
4343

4444
if (parentMatrix)
4545
{
46-
matrix.multiplyWithOffset(parentMatrix, -cameraScrollX, -cameraScrollY);
46+
calcMatrix.multiplyWithOffset(parentMatrix, -cameraScrollX, -cameraScrollY);
4747

4848
cameraScrollX = 0;
4949
cameraScrollY = 0;
@@ -88,10 +88,11 @@ var BlitterWebGLRenderer = function (renderer, src, interpolationPercentage, cam
8888
var xw = x + width;
8989
var yh = y + height;
9090

91-
var tx0 = x * matrix.a + y * matrix.c + matrix.e;
92-
var ty0 = x * matrix.b + y * matrix.d + matrix.f;
93-
var tx1 = xw * matrix.a + yh * matrix.c + matrix.e;
94-
var ty1 = xw * matrix.b + yh * matrix.d + matrix.f;
91+
var tx0 = calcMatrix.getX(x, y);
92+
var ty0 = calcMatrix.getY(x, y);
93+
94+
var tx1 = calcMatrix.getX(xw, yh);
95+
var ty1 = calcMatrix.getY(xw, yh);
9596

9697
var tint = Utils.getTintAppendFloatAlpha(0xffffff, bobAlpha);
9798

src/gameobjects/mesh/MeshWebGLRenderer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ var MeshWebGLRenderer = function (renderer, src, interpolationPercentage, camera
5959
var frame = src.frame;
6060
var texture = frame.glTexture;
6161

62-
pipeline.setTexture2D(texture, 0);
63-
6462
var vertices = src.vertices;
6563
var uvs = src.uv;
6664
var colors = src.colors;
@@ -74,6 +72,8 @@ var MeshWebGLRenderer = function (renderer, src, interpolationPercentage, camera
7472
pipeline.flush();
7573
}
7674

75+
pipeline.setTexture2D(texture, 0);
76+
7777
var vertexViewF32 = pipeline.vertexViewF32;
7878
var vertexViewU32 = pipeline.vertexViewU32;
7979

src/gameobjects/particles/ParticleManagerWebGLRenderer.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,17 +97,17 @@ var ParticleManagerWebGLRenderer = function (renderer, emitterManager, interpola
9797

9898
camMatrix.multiply(particleMatrix, calcMatrix);
9999

100-
var tx0 = x * calcMatrix.a + y * calcMatrix.c + calcMatrix.e;
101-
var ty0 = x * calcMatrix.b + y * calcMatrix.d + calcMatrix.f;
100+
var tx0 = calcMatrix.getX(x, y);
101+
var ty0 = calcMatrix.getY(x, y);
102102

103-
var tx1 = x * calcMatrix.a + yh * calcMatrix.c + calcMatrix.e;
104-
var ty1 = x * calcMatrix.b + yh * calcMatrix.d + calcMatrix.f;
103+
var tx1 = calcMatrix.getX(x, yh);
104+
var ty1 = calcMatrix.getY(x, yh);
105105

106-
var tx2 = xw * calcMatrix.a + yh * calcMatrix.c + calcMatrix.e;
107-
var ty2 = xw * calcMatrix.b + yh * calcMatrix.d + calcMatrix.f;
106+
var tx2 = calcMatrix.getX(xw, yh);
107+
var ty2 = calcMatrix.getY(xw, yh);
108108

109-
var tx3 = xw * calcMatrix.a + y * calcMatrix.c + calcMatrix.e;
110-
var ty3 = xw * calcMatrix.b + y * calcMatrix.d + calcMatrix.f;
109+
var tx3 = calcMatrix.getX(xw, y);
110+
var ty3 = calcMatrix.getY(xw, y);
111111

112112
if (roundPixels)
113113
{

src/renderer/webgl/pipelines/TextureTintPipeline.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -446,17 +446,17 @@ var TextureTintPipeline = new Class({
446446
camMatrix.multiply(spriteMatrix, calcMatrix);
447447
}
448448

449-
var tx0 = x * calcMatrix.a + y * calcMatrix.c + calcMatrix.e;
450-
var ty0 = x * calcMatrix.b + y * calcMatrix.d + calcMatrix.f;
449+
var tx0 = calcMatrix.getX(x, y);
450+
var ty0 = calcMatrix.getY(x, y);
451451

452-
var tx1 = x * calcMatrix.a + yh * calcMatrix.c + calcMatrix.e;
453-
var ty1 = x * calcMatrix.b + yh * calcMatrix.d + calcMatrix.f;
452+
var tx1 = calcMatrix.getX(x, yh);
453+
var ty1 = calcMatrix.getY(x, yh);
454454

455-
var tx2 = xw * calcMatrix.a + yh * calcMatrix.c + calcMatrix.e;
456-
var ty2 = xw * calcMatrix.b + yh * calcMatrix.d + calcMatrix.f;
455+
var tx2 = calcMatrix.getX(xw, yh);
456+
var ty2 = calcMatrix.getY(xw, yh);
457457

458-
var tx3 = xw * calcMatrix.a + y * calcMatrix.c + calcMatrix.e;
459-
var ty3 = xw * calcMatrix.b + y * calcMatrix.d + calcMatrix.f;
458+
var tx3 = calcMatrix.getX(xw, y);
459+
var ty3 = calcMatrix.getY(xw, y);
460460

461461
var tintTL = Utils.getTintAppendFloatAlpha(sprite._tintTL, camera.alpha * sprite._alphaTL);
462462
var tintTR = Utils.getTintAppendFloatAlpha(sprite._tintTR, camera.alpha * sprite._alphaTR);
@@ -780,17 +780,17 @@ var TextureTintPipeline = new Class({
780780
camMatrix.multiply(spriteMatrix, calcMatrix);
781781
}
782782

783-
var tx0 = x * calcMatrix.a + y * calcMatrix.c + calcMatrix.e;
784-
var ty0 = x * calcMatrix.b + y * calcMatrix.d + calcMatrix.f;
783+
var tx0 = calcMatrix.getX(x, y);
784+
var ty0 = calcMatrix.getY(x, y);
785785

786-
var tx1 = x * calcMatrix.a + yh * calcMatrix.c + calcMatrix.e;
787-
var ty1 = x * calcMatrix.b + yh * calcMatrix.d + calcMatrix.f;
786+
var tx1 = calcMatrix.getX(x, yh);
787+
var ty1 = calcMatrix.getY(x, yh);
788788

789-
var tx2 = xw * calcMatrix.a + yh * calcMatrix.c + calcMatrix.e;
790-
var ty2 = xw * calcMatrix.b + yh * calcMatrix.d + calcMatrix.f;
789+
var tx2 = calcMatrix.getX(xw, yh);
790+
var ty2 = calcMatrix.getY(xw, yh);
791791

792-
var tx3 = xw * calcMatrix.a + y * calcMatrix.c + calcMatrix.e;
793-
var ty3 = xw * calcMatrix.b + y * calcMatrix.d + calcMatrix.f;
792+
var tx3 = calcMatrix.getX(xw, y);
793+
var ty3 = calcMatrix.getY(xw, y);
794794

795795
if (camera.roundPixels)
796796
{
@@ -861,17 +861,17 @@ var TextureTintPipeline = new Class({
861861
calcMatrix = spriteMatrix;
862862
}
863863

864-
var tx0 = x * calcMatrix.a + y * calcMatrix.c + calcMatrix.e;
865-
var ty0 = x * calcMatrix.b + y * calcMatrix.d + calcMatrix.f;
864+
var tx0 = calcMatrix.getX(x, y);
865+
var ty0 = calcMatrix.getY(x, y);
866866

867-
var tx1 = x * calcMatrix.a + yh * calcMatrix.c + calcMatrix.e;
868-
var ty1 = x * calcMatrix.b + yh * calcMatrix.d + calcMatrix.f;
867+
var tx1 = calcMatrix.getX(x, yh);
868+
var ty1 = calcMatrix.getY(x, yh);
869869

870-
var tx2 = xw * calcMatrix.a + yh * calcMatrix.c + calcMatrix.e;
871-
var ty2 = xw * calcMatrix.b + yh * calcMatrix.d + calcMatrix.f;
870+
var tx2 = calcMatrix.getX(xw, yh);
871+
var ty2 = calcMatrix.getY(xw, yh);
872872

873-
var tx3 = xw * calcMatrix.a + y * calcMatrix.c + calcMatrix.e;
874-
var ty3 = xw * calcMatrix.b + y * calcMatrix.d + calcMatrix.f;
873+
var tx3 = calcMatrix.getX(xw, y);
874+
var ty3 = calcMatrix.getY(xw, y);
875875

876876
if (this.renderer.config.roundPixels)
877877
{

0 commit comments

Comments
 (0)