Skip to content

Commit 0c411e9

Browse files
committed
Removed currentUnit and batchSprite forceZero
1 parent 85f63c4 commit 0c411e9

1 file changed

Lines changed: 5 additions & 29 deletions

File tree

src/renderer/webgl/pipelines/TextureTintPipeline.js

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -293,16 +293,6 @@ var TextureTintPipeline = new Class({
293293
*/
294294
this.polygonCache = [];
295295

296-
/**
297-
* Holds the most recently assigned texture unit.
298-
* Treat this value as read-only.
299-
*
300-
* @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#currentUnit
301-
* @type {number}
302-
* @since 3.25.0
303-
*/
304-
this.currentUnit = 0;
305-
306296
this.mvpInit();
307297
},
308298

@@ -370,9 +360,6 @@ var TextureTintPipeline = new Class({
370360
* @since 3.1.0
371361
*
372362
* @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch. If not given uses blankTexture.
373-
* @param {integer} [unit=0] - Texture unit to which the texture needs to be bound.
374-
*
375-
* @return {Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline} This pipeline instance.
376363
*/
377364
setTexture2D: function (texture)
378365
{
@@ -423,12 +410,9 @@ var TextureTintPipeline = new Class({
423410
* @param {(Phaser.GameObjects.Image|Phaser.GameObjects.Sprite)} sprite - The texture based Game Object to add to the batch.
424411
* @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use for the rendering transform.
425412
* @param {Phaser.GameObjects.Components.TransformMatrix} [parentTransformMatrix] - The transform matrix of the parent container, if set.
426-
* @param {boolean} [forceZero=false] - Force this Sprite to use texture unit zero?
427413
*/
428-
batchSprite: function (sprite, camera, parentTransformMatrix, forceZero)
414+
batchSprite: function (sprite, camera, parentTransformMatrix)
429415
{
430-
if (forceZero === undefined) { forceZero = false; }
431-
432416
// Will cause a flush if this isn't the current pipeline, vertexbuffer or program
433417
this.renderer.setPipeline(this);
434418

@@ -438,7 +422,6 @@ var TextureTintPipeline = new Class({
438422

439423
var frame = sprite.frame;
440424
var texture = frame.glTexture;
441-
var textureSource = frame.source;
442425

443426
var u0 = frame.u0;
444427
var v0 = frame.v0;
@@ -570,16 +553,7 @@ var TextureTintPipeline = new Class({
570553
this.flush();
571554
}
572555

573-
var unit = 0;
574-
575-
if (forceZero)
576-
{
577-
this.renderer.setTextureZero(textureSource.glTexture);
578-
}
579-
else
580-
{
581-
unit = this.renderer.setTextureSource(textureSource);
582-
}
556+
var unit = this.setGameObject(sprite);
583557

584558
var tintEffect = (sprite._isTinted && sprite.tintFill);
585559

@@ -1119,7 +1093,9 @@ var TextureTintPipeline = new Class({
11191093
var u1 = frame.u1;
11201094
var v1 = frame.v1;
11211095

1122-
this.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, this.fillTint.TL, this.fillTint.TR, this.fillTint.BL, this.fillTint.BR, this.tintEffect);
1096+
var tint = this.fillTint;
1097+
1098+
this.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tint.TL, tint.TR, tint.BL, tint.BR, this.tintEffect);
11231099
},
11241100

11251101
/**

0 commit comments

Comments
 (0)