@@ -14,7 +14,17 @@ var WebGLPipeline = require('../WebGLPipeline');
1414
1515/**
1616 * @classdesc
17- * [pending] - especially explain the config properties please
17+ * TextureTintPipeline implements the rendering infrastructure
18+ * for displaying textured objects
19+ * The config properties are:
20+ * - game: Current game instance.
21+ * - renderer: Current WebGL renderer.
22+ * - topology: This indicates how the primitives are rendered. The default value is GL_TRIANGLES.
23+ * Here is the full list of rendering primitives (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants).
24+ * - vertShader: Source for vertex shader as a string.
25+ * - fragShader: Source for fragment shader as a string.
26+ * - vertexCapacity: The amount of vertices that shall be allocated
27+ * - vertexSize: The size of a single vertex in bytes.
1828 *
1929 * @class TextureTintPipeline
2030 * @extends Phaser.Renderer.WebGL.WebGLPipeline
@@ -76,7 +86,7 @@ var TextureTintPipeline = new Class({
7686 } ) ;
7787
7888 /**
79- * [pending]
89+ * Float32 view of the array buffer containing the pipeline's vertices.
8090 *
8191 * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#vertexViewF32
8292 * @type {Float32Array }
@@ -85,7 +95,7 @@ var TextureTintPipeline = new Class({
8595 this . vertexViewF32 = new Float32Array ( this . vertexData ) ;
8696
8797 /**
88- * [pending]
98+ * Uint32 view of the array buffer containing the pipeline's vertices.
8999 *
90100 * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#vertexViewU32
91101 * @type {Uint32Array }
@@ -94,7 +104,7 @@ var TextureTintPipeline = new Class({
94104 this . vertexViewU32 = new Uint32Array ( this . vertexData ) ;
95105
96106 /**
97- * [pending]
107+ * Size of the batch.
98108 *
99109 * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#maxQuads
100110 * @type {integer }
@@ -104,7 +114,7 @@ var TextureTintPipeline = new Class({
104114 this . maxQuads = 2000 ;
105115
106116 /**
107- * [pending]
117+ * Collection of batch information
108118 *
109119 * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batches
110120 * @type {array }
@@ -116,13 +126,14 @@ var TextureTintPipeline = new Class({
116126 } ,
117127
118128 /**
119- * [pending]
129+ * Assigns a texture to the current batch. If a texture is already set it creates
130+ * a new batch object.
120131 *
121132 * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#setTexture2D
122133 * @since 3.1.0
123134 *
124- * @param {WebGLTexture } texture - [pending]
125- * @param {integer } textureUnit - [pending]
135+ * @param {WebGLTexture } texture - WebGLTexture that will be assigned to the current batch.
136+ * @param {integer } textureUnit - Texture unit to which the texture needs to be bound.
126137 *
127138 * @return {Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline } [description]
128139 */
@@ -167,7 +178,10 @@ var TextureTintPipeline = new Class({
167178 } ,
168179
169180 /**
170- * [pending]
181+ * Creates a new batch object and pushes it to a batch array.
182+ * The batch object contains information relevant to the current
183+ * vertex batch like the offset in the vertex buffer, vertex count and
184+ * the textures used by that batch.
171185 *
172186 * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#pushBatch
173187 * @since 3.1.0
@@ -184,7 +198,7 @@ var TextureTintPipeline = new Class({
184198 } ,
185199
186200 /**
187- * [pending]
201+ * Binds, uploads resources and processes all batches generating draw calls.
188202 *
189203 * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#flush
190204 * @since 3.1.0
@@ -284,7 +298,8 @@ var TextureTintPipeline = new Class({
284298 } ,
285299
286300 /**
287- * [pending]
301+ * Called every time the pipeline needs to be used.
302+ * It binds all necessary resources.
288303 *
289304 * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#onBind
290305 * @since 3.0.0
@@ -325,7 +340,8 @@ var TextureTintPipeline = new Class({
325340 } ,
326341
327342 /**
328- * [pending]
343+ * Renders immediately a static tilemap. This function won't use
344+ * the batching functionality of the pipieline.
329345 *
330346 * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#drawStaticTilemapLayer
331347 * @since 3.0.0
@@ -361,7 +377,7 @@ var TextureTintPipeline = new Class({
361377 } ,
362378
363379 /**
364- * [pending]
380+ * Renders contents of a ParticleEmitterManager. It'll batch all particles if possible.
365381 *
366382 * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#drawEmitterManager
367383 * @since 3.0.0
@@ -577,7 +593,7 @@ var TextureTintPipeline = new Class({
577593 } ,
578594
579595 /**
580- * [pending]
596+ * Batches blitter game object
581597 *
582598 * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#drawBlitter
583599 * @since 3.0.0
@@ -737,7 +753,7 @@ var TextureTintPipeline = new Class({
737753 } ,
738754
739755 /**
740- * [pending]
756+ * Batches Sprite game object
741757 *
742758 * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchSprite
743759 * @since 3.0.0
@@ -910,7 +926,7 @@ var TextureTintPipeline = new Class({
910926 } ,
911927
912928 /**
913- * [pending]
929+ * Batches Mesh game object
914930 *
915931 * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchMesh
916932 * @since 3.0.0
@@ -1041,7 +1057,7 @@ var TextureTintPipeline = new Class({
10411057 } ,
10421058
10431059 /**
1044- * [pending]
1060+ * Batches BitmapText game object
10451061 *
10461062 * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchBitmapText
10471063 * @since 3.0.0
@@ -1318,7 +1334,7 @@ var TextureTintPipeline = new Class({
13181334 } ,
13191335
13201336 /**
1321- * [pending]
1337+ * Batches DynamicBitmapText game object
13221338 *
13231339 * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchDynamicBitmapText
13241340 * @since 3.0.0
@@ -1668,7 +1684,7 @@ var TextureTintPipeline = new Class({
16681684 } ,
16691685
16701686 /**
1671- * [pending]
1687+ * Batches Text game object
16721688 *
16731689 * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchText
16741690 * @since 3.0.0
@@ -1704,7 +1720,7 @@ var TextureTintPipeline = new Class({
17041720 } ,
17051721
17061722 /**
1707- * [pending]
1723+ * Batches DynamicTilemapLayer game object
17081724 *
17091725 * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchDynamicTilemapLayer
17101726 * @since 3.0.0
@@ -1762,7 +1778,7 @@ var TextureTintPipeline = new Class({
17621778 } ,
17631779
17641780 /**
1765- * [pending]
1781+ * Batches TileSprite game object
17661782 *
17671783 * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchTileSprite
17681784 * @since 3.0.0
@@ -1799,40 +1815,40 @@ var TextureTintPipeline = new Class({
17991815 } ,
18001816
18011817 /**
1802- * [pending]
1818+ * Generic function for batching a textured quad
18031819 *
18041820 * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchTexture
18051821 * @since 3.0.0
18061822 *
1807- * @param {Phaser.GameObjects.GameObject } gameObject - [pending]
1808- * @param {WebGLTexture } texture - [pending]
1809- * @param {integer } textureWidth - [pending]
1810- * @param {integer } textureHeight - [pending]
1811- * @param {float } srcX - [pending]
1812- * @param {float } srcY - [pending]
1813- * @param {float } srcWidth - [pending]
1814- * @param {float } srcHeight - [pending]
1815- * @param {float } scaleX - [pending]
1816- * @param {float } scaleY - [pending]
1817- * @param {float } rotation - [pending]
1818- * @param {boolean } flipX - [pending]
1819- * @param {boolean } flipY - [pending]
1820- * @param {float } scrollFactorX - [pending]
1821- * @param {float } scrollFactorY - [pending]
1822- * @param {float } displayOriginX - [pending]
1823- * @param {float } displayOriginY - [pending]
1824- * @param {float } frameX - [pending]
1825- * @param {float } frameY - [pending]
1826- * @param {float } frameWidth - [pending]
1827- * @param {float } frameHeight - [pending]
1828- * @param {integer } tintTL - [pending]
1829- * @param {integer } tintTR - [pending]
1830- * @param {integer } tintBL - [pending]
1831- * @param {integer } tintBR - [pending]
1832- * @param {float } uOffset - [pending]
1833- * @param {float } vOffset - [pending]
1834- * @param {Phaser.Cameras.Scene2D.Camera } camera - [pending]
1835- * @param {Phaser.GameObjects.Components.TransformMatrix } parentTransformMatrix - [pending]
1823+ * @param {Phaser.GameObjects.GameObject } gameObject - Source GameObject
1824+ * @param {WebGLTexture } texture - Raw WebGLTexture associated with the quad
1825+ * @param {integer } textureWidth - Real texture width
1826+ * @param {integer } textureHeight - Real texture height
1827+ * @param {float } srcX - X coordinate of the quad
1828+ * @param {float } srcY - Y coordinate of the quad
1829+ * @param {float } srcWidth - Width of the quad
1830+ * @param {float } srcHeight - Height of the quad
1831+ * @param {float } scaleX - X component of scale
1832+ * @param {float } scaleY - Y component of scale
1833+ * @param {float } rotation - Rotation of the quad
1834+ * @param {boolean } flipX - Indicates if the quad is horizontally flipped
1835+ * @param {boolean } flipY - Indicates if the quad is vertically flipped
1836+ * @param {float } scrollFactorX - By which factor is the quad affected by the camera horizontal scroll
1837+ * @param {float } scrollFactorY - By which factor is the quad effected by the camera vertical scroll
1838+ * @param {float } displayOriginX - Horizontal origin in pixels
1839+ * @param {float } displayOriginY - Vertical origin in pixels
1840+ * @param {float } frameX - X coordinate of the texture frame
1841+ * @param {float } frameY - Y coordinate of the texture frame
1842+ * @param {float } frameWidth - Width of the texture frame
1843+ * @param {float } frameHeight - Height of the texture frame
1844+ * @param {integer } tintTL - Tint for top left
1845+ * @param {integer } tintTR - Tint for top right
1846+ * @param {integer } tintBL - Tint for bottom left
1847+ * @param {integer } tintBR - Tint for bottom right
1848+ * @param {float } uOffset - Horizontal offset on texture coordinate
1849+ * @param {float } vOffset - Vertical offset on texture coordinate
1850+ * @param {Phaser.Cameras.Scene2D.Camera } camera - Current used camera
1851+ * @param {Phaser.GameObjects.Components.TransformMatrix } parentTransformMatrix - Parent container
18361852 */
18371853 batchTexture : function (
18381854 gameObject ,
0 commit comments