@@ -8,40 +8,46 @@ var GameObject = require('../GameObject');
88var Utils = require ( '../../renderer/webgl/Utils' ) ;
99
1010/**
11- * Renders this Game Object with the Canvas Renderer to the given Camera.
11+ * Renders this Game Object with the WebGL Renderer to the given Camera.
1212 * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.
1313 * This method should not be called directly. It is a utility function of the Render module.
1414 *
15- * @method Phaser.GameObjects.RenderTexture#renderWebgl
15+ * @method Phaser.GameObjects.RenderTexture#renderWebGL
1616 * @since 3.2.0
1717 * @private
1818 *
1919 * @param {Phaser.Renderer.WebGL.WebGLRenderer } renderer - A reference to the current active Canvas renderer.
20- * @param {Phaser.GameObjects.RenderTexture } renderTexture - The Game Object being rendered in this call.
20+ * @param {Phaser.GameObjects.RenderTexture } src - The Game Object being rendered in this call.
2121 * @param {number } interpolationPercentage - Reserved for future use and custom pipelines.
2222 * @param {Phaser.Cameras.Scene2D.Camera } camera - The Camera that is rendering the Game Object.
2323 * @param {Phaser.GameObjects.Components.TransformMatrix } parentMatrix - This transform matrix is defined if the game object is nested
2424 */
25- var RenderTextureWebGLRenderer = function ( renderer , renderTexture , interpolationPercentage , camera , parentMatrix )
25+ var RenderTextureWebGLRenderer = function ( renderer , src , interpolationPercentage , camera , parentMatrix )
2626{
27- if ( GameObject . RENDER_MASK !== renderTexture . renderFlags || ( renderTexture . cameraFilter > 0 && ( renderTexture . cameraFilter & camera . _id ) ) )
27+ if ( GameObject . RENDER_MASK !== src . renderFlags || ( src . cameraFilter > 0 && ( src . cameraFilter & camera . _id ) ) )
2828 {
2929 return ;
3030 }
3131
32+ var getTint = Utils . getTintAppendFloatAlpha ;
33+
3234 this . pipeline . batchTexture (
33- renderTexture ,
34- renderTexture . texture ,
35- renderTexture . texture . width , renderTexture . texture . height ,
36- renderTexture . x , renderTexture . y ,
37- renderTexture . width , renderTexture . height ,
38- renderTexture . scaleX , renderTexture . scaleY ,
39- renderTexture . rotation ,
40- renderTexture . flipX , ! renderTexture . flipY ,
41- renderTexture . scrollFactorX , renderTexture . scrollFactorY ,
42- renderTexture . displayOriginX , renderTexture . displayOriginY ,
43- 0 , 0 , renderTexture . texture . width , renderTexture . texture . height ,
44- Utils . getTintAppendFloatAlpha ( renderTexture . tintTopLeft , renderTexture . alphaTopLeft ) , Utils . getTintAppendFloatAlpha ( renderTexture . tintTopRight , renderTexture . alphaTopRight ) , Utils . getTintAppendFloatAlpha ( renderTexture . tintBottomLeft , renderTexture . alphaBottomLeft ) , Utils . getTintAppendFloatAlpha ( renderTexture . tintBottomRight , renderTexture . alphaBottomRight ) ,
35+ src ,
36+ src . texture ,
37+ src . texture . width , src . texture . height ,
38+ src . x , src . y ,
39+ src . width , src . height ,
40+ src . scaleX , src . scaleY ,
41+ src . rotation ,
42+ src . flipX , ! src . flipY ,
43+ src . scrollFactorX , src . scrollFactorY ,
44+ src . displayOriginX , src . displayOriginY ,
45+ 0 , 0 , src . texture . width , src . texture . height ,
46+ getTint ( src . _tintTL , camera . alpha * src . _alphaTL ) ,
47+ getTint ( src . _tintTR , camera . alpha * src . _alphaTR ) ,
48+ getTint ( src . _tintBL , camera . alpha * src . _alphaBL ) ,
49+ getTint ( src . _tintBR , camera . alpha * src . _alphaBR ) ,
50+ ( src . _isTinted && src . tintFill ) ,
4551 0 , 0 ,
4652 camera ,
4753 parentMatrix
0 commit comments