From 4ba2b0eb7bbc273f9fd90b8e1ec95d1e8312314b Mon Sep 17 00:00:00 2001 From: Richard Davey Date: Wed, 28 Oct 2020 16:52:59 +0000 Subject: [PATCH] All swapped to using renderer matrices to make pipelines smaller --- .../bitmaptext/dynamic/DynamicBitmapTextWebGLRenderer.js | 2 +- src/gameobjects/blitter/BlitterWebGLRenderer.js | 2 +- src/gameobjects/lights/PointLight.js | 8 ++++---- src/gameobjects/particles/ParticleManagerWebGLRenderer.js | 8 ++++---- src/gameobjects/shape/arc/ArcWebGLRenderer.js | 2 +- src/gameobjects/shape/curve/CurveWebGLRenderer.js | 2 +- src/gameobjects/shape/ellipse/EllipseWebGLRenderer.js | 2 +- src/gameobjects/shape/grid/GridWebGLRenderer.js | 2 +- src/gameobjects/shape/isobox/IsoBoxWebGLRenderer.js | 2 +- .../shape/isotriangle/IsoTriangleWebGLRenderer.js | 2 +- src/gameobjects/shape/line/LineWebGLRenderer.js | 2 +- src/gameobjects/shape/polygon/PolygonWebGLRenderer.js | 2 +- src/gameobjects/shape/rectangle/RectangleWebGLRenderer.js | 2 +- src/gameobjects/shape/star/StarWebGLRenderer.js | 2 +- src/gameobjects/shape/triangle/TriangleWebGLRenderer.js | 2 +- 15 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextWebGLRenderer.js b/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextWebGLRenderer.js index 3c3408b1b..00c3fd61d 100644 --- a/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextWebGLRenderer.js +++ b/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextWebGLRenderer.js @@ -38,7 +38,7 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, camera, parentMatr var spriteMatrix = result.sprite; var calcMatrix = result.calc; - var fontMatrix = pipeline._tempMatrix4; + var fontMatrix = renderer._tempMatrix4; var crop = (src.cropWidth > 0 || src.cropHeight > 0); diff --git a/src/gameobjects/blitter/BlitterWebGLRenderer.js b/src/gameobjects/blitter/BlitterWebGLRenderer.js index 7bebcdb56..a8497e7d8 100644 --- a/src/gameobjects/blitter/BlitterWebGLRenderer.js +++ b/src/gameobjects/blitter/BlitterWebGLRenderer.js @@ -34,7 +34,7 @@ var BlitterWebGLRenderer = function (renderer, src, camera, parentMatrix) var cameraScrollX = camera.scrollX * src.scrollFactorX; var cameraScrollY = camera.scrollY * src.scrollFactorY; - var calcMatrix = pipeline._tempMatrix1; + var calcMatrix = renderer._tempMatrix1; calcMatrix.copyFrom(camera.matrix); diff --git a/src/gameobjects/lights/PointLight.js b/src/gameobjects/lights/PointLight.js index 9df83fab1..7054b1295 100644 --- a/src/gameobjects/lights/PointLight.js +++ b/src/gameobjects/lights/PointLight.js @@ -177,11 +177,11 @@ var PointLight = new Class({ renderWebGL: function (renderer, src, camera, parentTransformMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + renderer.pipelines.set(src.pipeline); - var camMatrix = pipeline._tempMatrix1; - var lightMatrix = pipeline._tempMatrix2; - var calcMatrix = pipeline._tempMatrix3; + var camMatrix = renderer._tempMatrix1; + var lightMatrix = renderer._tempMatrix2; + var calcMatrix = renderer._tempMatrix3; var width = src.width; var height = src.height; diff --git a/src/gameobjects/particles/ParticleManagerWebGLRenderer.js b/src/gameobjects/particles/ParticleManagerWebGLRenderer.js index 8f37b0401..5c89cfb3f 100644 --- a/src/gameobjects/particles/ParticleManagerWebGLRenderer.js +++ b/src/gameobjects/particles/ParticleManagerWebGLRenderer.js @@ -32,10 +32,10 @@ var ParticleManagerWebGLRenderer = function (renderer, emitterManager, camera, p var pipeline = renderer.pipelines.set(this.pipeline); - var camMatrix = pipeline._tempMatrix1; - var calcMatrix = pipeline._tempMatrix2; - var particleMatrix = pipeline._tempMatrix3; - var managerMatrix = pipeline._tempMatrix4; + var camMatrix = renderer._tempMatrix1; + var calcMatrix = renderer._tempMatrix2; + var particleMatrix = renderer._tempMatrix3; + var managerMatrix = renderer._tempMatrix4; if (parentMatrix) { diff --git a/src/gameobjects/shape/arc/ArcWebGLRenderer.js b/src/gameobjects/shape/arc/ArcWebGLRenderer.js index 3f317ada5..e03e9364c 100644 --- a/src/gameobjects/shape/arc/ArcWebGLRenderer.js +++ b/src/gameobjects/shape/arc/ArcWebGLRenderer.js @@ -28,7 +28,7 @@ var ArcWebGLRenderer = function (renderer, src, camera, parentMatrix) var result = GetCalcMatrix(src, camera, parentMatrix); - var calcMatrix = pipeline._tempMatrix3.copyFrom(result.calc); + var calcMatrix = renderer._tempMatrix1.copyFrom(result.calc); var dx = src._displayOriginX; var dy = src._displayOriginY; diff --git a/src/gameobjects/shape/curve/CurveWebGLRenderer.js b/src/gameobjects/shape/curve/CurveWebGLRenderer.js index f085d7612..069c70da9 100644 --- a/src/gameobjects/shape/curve/CurveWebGLRenderer.js +++ b/src/gameobjects/shape/curve/CurveWebGLRenderer.js @@ -28,7 +28,7 @@ var CurveWebGLRenderer = function (renderer, src, camera, parentMatrix) var result = GetCalcMatrix(src, camera, parentMatrix); - var calcMatrix = pipeline._tempMatrix3.copyFrom(result.calc); + var calcMatrix = renderer._tempMatrix3.copyFrom(result.calc); var dx = src._displayOriginX + src._curveBounds.x; var dy = src._displayOriginY + src._curveBounds.y; diff --git a/src/gameobjects/shape/ellipse/EllipseWebGLRenderer.js b/src/gameobjects/shape/ellipse/EllipseWebGLRenderer.js index cef73da39..82f1873d7 100644 --- a/src/gameobjects/shape/ellipse/EllipseWebGLRenderer.js +++ b/src/gameobjects/shape/ellipse/EllipseWebGLRenderer.js @@ -28,7 +28,7 @@ var EllipseWebGLRenderer = function (renderer, src, camera, parentMatrix) var result = GetCalcMatrix(src, camera, parentMatrix); - var calcMatrix = pipeline._tempMatrix3.copyFrom(result.calc); + var calcMatrix = renderer._tempMatrix3.copyFrom(result.calc); var dx = src._displayOriginX; var dy = src._displayOriginY; diff --git a/src/gameobjects/shape/grid/GridWebGLRenderer.js b/src/gameobjects/shape/grid/GridWebGLRenderer.js index e566cc386..de9d28d7f 100644 --- a/src/gameobjects/shape/grid/GridWebGLRenderer.js +++ b/src/gameobjects/shape/grid/GridWebGLRenderer.js @@ -27,7 +27,7 @@ var GridWebGLRenderer = function (renderer, src, camera, parentMatrix) var result = GetCalcMatrix(src, camera, parentMatrix); - var calcMatrix = pipeline._tempMatrix3.copyFrom(result.calc); + var calcMatrix = renderer._tempMatrix3.copyFrom(result.calc); calcMatrix.translate(-src._displayOriginX, -src._displayOriginY); diff --git a/src/gameobjects/shape/isobox/IsoBoxWebGLRenderer.js b/src/gameobjects/shape/isobox/IsoBoxWebGLRenderer.js index a1891f998..bbfd9098f 100644 --- a/src/gameobjects/shape/isobox/IsoBoxWebGLRenderer.js +++ b/src/gameobjects/shape/isobox/IsoBoxWebGLRenderer.js @@ -27,7 +27,7 @@ var IsoBoxWebGLRenderer = function (renderer, src, camera, parentMatrix) var result = GetCalcMatrix(src, camera, parentMatrix); - var calcMatrix = pipeline._tempMatrix3.copyFrom(result.calc); + var calcMatrix = renderer._tempMatrix3.copyFrom(result.calc); var size = src.width; var height = src.height; diff --git a/src/gameobjects/shape/isotriangle/IsoTriangleWebGLRenderer.js b/src/gameobjects/shape/isotriangle/IsoTriangleWebGLRenderer.js index f475b060c..4836bdc99 100644 --- a/src/gameobjects/shape/isotriangle/IsoTriangleWebGLRenderer.js +++ b/src/gameobjects/shape/isotriangle/IsoTriangleWebGLRenderer.js @@ -27,7 +27,7 @@ var IsoTriangleWebGLRenderer = function (renderer, src, camera, parentMatrix) var result = GetCalcMatrix(src, camera, parentMatrix); - var calcMatrix = pipeline._tempMatrix3.copyFrom(result.calc); + var calcMatrix = renderer._tempMatrix3.copyFrom(result.calc); var size = src.width; var height = src.height; diff --git a/src/gameobjects/shape/line/LineWebGLRenderer.js b/src/gameobjects/shape/line/LineWebGLRenderer.js index b5b350cf7..ce8d748d6 100644 --- a/src/gameobjects/shape/line/LineWebGLRenderer.js +++ b/src/gameobjects/shape/line/LineWebGLRenderer.js @@ -27,7 +27,7 @@ var LineWebGLRenderer = function (renderer, src, camera, parentMatrix) var result = GetCalcMatrix(src, camera, parentMatrix); - pipeline._tempMatrix3.copyFrom(result.calc); + renderer._tempMatrix3.copyFrom(result.calc); var dx = src._displayOriginX; var dy = src._displayOriginY; diff --git a/src/gameobjects/shape/polygon/PolygonWebGLRenderer.js b/src/gameobjects/shape/polygon/PolygonWebGLRenderer.js index f4503897c..538f58448 100644 --- a/src/gameobjects/shape/polygon/PolygonWebGLRenderer.js +++ b/src/gameobjects/shape/polygon/PolygonWebGLRenderer.js @@ -28,7 +28,7 @@ var PolygonWebGLRenderer = function (renderer, src, camera, parentMatrix) var result = GetCalcMatrix(src, camera, parentMatrix); - var calcMatrix = pipeline._tempMatrix3.copyFrom(result.calc); + var calcMatrix = renderer._tempMatrix3.copyFrom(result.calc); var dx = src._displayOriginX; var dy = src._displayOriginY; diff --git a/src/gameobjects/shape/rectangle/RectangleWebGLRenderer.js b/src/gameobjects/shape/rectangle/RectangleWebGLRenderer.js index 4664eed57..f987773d6 100644 --- a/src/gameobjects/shape/rectangle/RectangleWebGLRenderer.js +++ b/src/gameobjects/shape/rectangle/RectangleWebGLRenderer.js @@ -28,7 +28,7 @@ var RectangleWebGLRenderer = function (renderer, src, camera, parentMatrix) var result = GetCalcMatrix(src, camera, parentMatrix); - pipeline._tempMatrix3.copyFrom(result.calc); + renderer._tempMatrix3.copyFrom(result.calc); var dx = src._displayOriginX; var dy = src._displayOriginY; diff --git a/src/gameobjects/shape/star/StarWebGLRenderer.js b/src/gameobjects/shape/star/StarWebGLRenderer.js index e8aa708f9..014ff8b8f 100644 --- a/src/gameobjects/shape/star/StarWebGLRenderer.js +++ b/src/gameobjects/shape/star/StarWebGLRenderer.js @@ -28,7 +28,7 @@ var StarWebGLRenderer = function (renderer, src, camera, parentMatrix) var result = GetCalcMatrix(src, camera, parentMatrix); - var calcMatrix = pipeline._tempMatrix3.copyFrom(result.calc); + var calcMatrix = renderer._tempMatrix3.copyFrom(result.calc); var dx = src._displayOriginX; var dy = src._displayOriginY; diff --git a/src/gameobjects/shape/triangle/TriangleWebGLRenderer.js b/src/gameobjects/shape/triangle/TriangleWebGLRenderer.js index 88317db16..a0b820256 100644 --- a/src/gameobjects/shape/triangle/TriangleWebGLRenderer.js +++ b/src/gameobjects/shape/triangle/TriangleWebGLRenderer.js @@ -28,7 +28,7 @@ var TriangleWebGLRenderer = function (renderer, src, camera, parentMatrix) var result = GetCalcMatrix(src, camera, parentMatrix); - pipeline._tempMatrix3.copyFrom(result.calc); + renderer._tempMatrix3.copyFrom(result.calc); var dx = src._displayOriginX; var dy = src._displayOriginY;