Skip to content

Commit dedc939

Browse files
committed
initPipeline now defaults to the Texture Tint Pipeline if nothing else is specified.
1 parent dff9bde commit dedc939

12 files changed

Lines changed: 14 additions & 11 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
## Updates
88

99
* The Graphics Canvas Renderer will now automatically call `beginPath` on the target context before processing the command stack. This has the effect of clearing off any sub-paths that may have persisted on the stack from previous Graphics objects or frames. This makes it more in-line with WebGL re: expectations when calling `Graphics.clear`.
10+
* `initPipeline` now defaults to the Texture Tint Pipeline if nothing else is specified. This allowed me to remove explicit strings from 11 different Game Objects, saving some bytes in the process.
1011

1112
## Bug Fixes
1213

src/gameobjects/bitmaptext/static/BitmapText.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ var BitmapText = new Class({
211211
this.setTexture(entry.texture, entry.frame);
212212
this.setPosition(x, y);
213213
this.setOrigin(0, 0);
214-
this.initPipeline('TextureTintPipeline');
214+
this.initPipeline();
215215

216216
this.setText(text);
217217
},

src/gameobjects/blitter/Blitter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ var Blitter = new Class({
8686

8787
this.setTexture(texture, frame);
8888
this.setPosition(x, y);
89-
this.initPipeline('TextureTintPipeline');
89+
this.initPipeline();
9090

9191
/**
9292
* The children of this Blitter.

src/gameobjects/components/Pipeline.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,14 @@ var Pipeline = {
4444
* @webglOnly
4545
* @since 3.0.0
4646
*
47-
* @param {string} pipelineName - The name of the pipeline to set on this Game Object.
47+
* @param {string} [pipelineName=TextureTintPipeline] - The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline.
4848
*
4949
* @return {boolean} `true` if the pipeline was set successfully, otherwise `false`.
5050
*/
5151
initPipeline: function (pipelineName)
5252
{
53+
if (pipelineName === undefined) { pipelineName = 'TextureTintPipeline'; }
54+
5355
var renderer = this.scene.sys.game.renderer;
5456

5557
if (renderer && renderer.gl && renderer.hasPipeline(pipelineName))

src/gameobjects/graphics/Graphics.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ var Graphics = new Class({
146146
GameObject.call(this, scene, 'Graphics');
147147

148148
this.setPosition(x, y);
149-
this.initPipeline('TextureTintPipeline');
149+
this.initPipeline();
150150

151151
/**
152152
* The horizontal display origin of the Graphics.

src/gameobjects/image/Image.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ var Image = new Class({
8989
this.setPosition(x, y);
9090
this.setSizeToFrame();
9191
this.setOriginFromFrame();
92-
this.initPipeline('TextureTintPipeline');
92+
this.initPipeline();
9393
}
9494

9595
});

src/gameobjects/mesh/Mesh.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ var Mesh = new Class({
158158
this.setPosition(x, y);
159159
this.setSizeToFrame();
160160
this.setOrigin();
161-
this.initPipeline('TextureTintPipeline');
161+
this.initPipeline();
162162
}
163163

164164
});

src/gameobjects/particles/ParticleEmitterManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ var ParticleEmitterManager = new Class({
112112

113113
this.setTexture(texture, frame);
114114

115-
this.initPipeline('TextureTintPipeline');
115+
this.initPipeline();
116116

117117
/**
118118
* A list of Emitters being managed by this Emitter Manager.

src/gameobjects/rendertexture/RenderTexture.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ var RenderTexture = new Class({
214214
this.setPosition(x, y);
215215
this.setSize(width, height);
216216
this.setOrigin(0, 0);
217-
this.initPipeline('TextureTintPipeline');
217+
this.initPipeline();
218218
},
219219

220220
/**

src/gameobjects/sprite/Sprite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ var Sprite = new Class({
101101
this.setPosition(x, y);
102102
this.setSizeToFrame();
103103
this.setOriginFromFrame();
104-
this.initPipeline('TextureTintPipeline');
104+
this.initPipeline();
105105
},
106106

107107
/**

0 commit comments

Comments
 (0)