Skip to content

Commit 7765016

Browse files
committed
Pipeline constants so we can avoid using strings elsewhere
1 parent d3e82f2 commit 7765016

3 files changed

Lines changed: 76 additions & 3 deletions

File tree

src/renderer/webgl/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010

1111
module.exports = {
1212

13+
PipelineManager: require('./PipelineManager'),
14+
Pipelines: require('./pipelines'),
1315
Utils: require('./Utils'),
1416
WebGLPipeline: require('./WebGLPipeline'),
15-
WebGLRenderer: require('./WebGLRenderer'),
16-
Pipelines: require('./pipelines')
17+
WebGLRenderer: require('./WebGLRenderer')
1718

1819
};
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/**
2+
* @author Richard Davey <rich@photonstorm.com>
3+
* @copyright 2020 Photon Storm Ltd.
4+
* @license {@link https://opensource.org/licenses/MIT|MIT License}
5+
*/
6+
7+
var PIPELINE_CONST = {
8+
9+
/**
10+
* The Bitmap Mask Pipeline.
11+
*
12+
* @name Phaser.Renderer.WebGL.Pipelines.BITMAPMASK_PIPELINE
13+
* @type {string}
14+
* @const
15+
* @since 3.50.0
16+
*/
17+
BITMAPMASK_PIPELINE: 'BitmapMaskPipeline',
18+
19+
/**
20+
* The Light 2D Pipeline.
21+
*
22+
* @name Phaser.Renderer.WebGL.Pipelines.LIGHT_PIPELINE
23+
* @type {string}
24+
* @const
25+
* @since 3.50.0
26+
*/
27+
LIGHT_PIPELINE: 'Light2D',
28+
29+
/**
30+
* The Single Texture Pipeline.
31+
*
32+
* @name Phaser.Renderer.WebGL.Pipelines.SINGLE_PIPELINE
33+
* @type {string}
34+
* @const
35+
* @since 3.50.0
36+
*/
37+
SINGLE_PIPELINE: 'SinglePipeline',
38+
39+
/**
40+
* The Multi Texture Pipeline.
41+
*
42+
* @name Phaser.Renderer.WebGL.Pipelines.MULTI_PIPELINE
43+
* @type {string}
44+
* @const
45+
* @since 3.50.0
46+
*/
47+
MULTI_PIPELINE: 'MultiPipeline',
48+
49+
/**
50+
* The Rope Pipeline.
51+
*
52+
* @name Phaser.Renderer.WebGL.Pipelines.ROPE_PIPELINE
53+
* @type {string}
54+
* @const
55+
* @since 3.50.0
56+
*/
57+
ROPE_PIPELINE: 'RopePipeline'
58+
59+
};
60+
61+
module.exports = PIPELINE_CONST;

src/renderer/webgl/pipelines/index.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
* @license {@link https://opensource.org/licenses/MIT|MIT License}
55
*/
66

7+
var CONST = require('./const');
8+
var Extend = require('../utils/object/Extend');
9+
710
/**
811
* @namespace Phaser.Renderer.WebGL.Pipelines
912
*/
1013

11-
module.exports = {
14+
var Pipelines = {
1215

1316
BitmapMaskPipeline: require('./BitmapMaskPipeline'),
1417
LightPipeline: require('./LightPipeline'),
@@ -18,3 +21,11 @@ module.exports = {
1821
ModelViewProjection: require('./components/ModelViewProjection')
1922

2023
};
24+
25+
// Merge in the consts
26+
27+
Pipelines = Extend(false, Pipelines, CONST);
28+
29+
// Export it
30+
31+
module.exports = Pipelines;

0 commit comments

Comments
 (0)