3232* @param {object } [uniforms] - Uniform mappings object. The uniforms are added on the default uniforms, or replace them if the keys are the same.
3333* @param {Array|string } [fragmentSrc] - The fragment shader code. Either an array, one element per line of code, or a string.
3434*/
35- Phaser . Filter = function ( game , uniforms , fragmentSrc ) {
36-
35+ Phaser . Filter = function ( game , uniforms , fragmentSrc )
36+ {
3737 /**
3838 * @property {Phaser.Game } game - A reference to the currently running game.
3939 */
@@ -90,7 +90,7 @@ Phaser.Filter = function (game, uniforms, fragmentSrc) {
9090 resolution : { type : '2f' , value : { x : 256 , y : 256 } } ,
9191 time : { type : '1f' , value : 0 } ,
9292 mouse : { type : '2f' , value : { x : 0.0 , y : 0.0 } } ,
93- date : { type : '4fv' , value : [ d . getFullYear ( ) , d . getMonth ( ) , d . getDate ( ) , d . getHours ( ) * 60 * 60 + d . getMinutes ( ) * 60 + d . getSeconds ( ) ] } ,
93+ date : { type : '4fv' , value : [ d . getFullYear ( ) , d . getMonth ( ) , d . getDate ( ) , d . getHours ( ) * 60 * 60 + d . getMinutes ( ) * 60 + d . getSeconds ( ) ] } ,
9494 sampleRate : { type : '1f' , value : 44100.0 } ,
9595 iChannel0 : { type : 'sampler2D' , value : null , textureData : { repeat : true } } ,
9696 iChannel1 : { type : 'sampler2D' , value : null , textureData : { repeat : true } } ,
@@ -125,10 +125,11 @@ Phaser.Filter.prototype = {
125125
126126 /**
127127 * This should be over-ridden. Will receive a variable number of arguments.
128- *
128+ *
129129 * @method Phaser.Filter#init
130130 */
131- init : function ( ) {
131+ init : function ( )
132+ {
132133
133134 // This should be over-ridden. Will receive a variable number of arguments.
134135
@@ -141,21 +142,20 @@ Phaser.Filter.prototype = {
141142 * @param {number } width - The width of the display.
142143 * @param {number } height - The height of the display.
143144 */
144- setResolution : function ( width , height ) {
145-
145+ setResolution : function ( width , height )
146+ {
146147 this . uniforms . resolution . value . x = width ;
147148 this . uniforms . resolution . value . y = height ;
148-
149149 } ,
150150
151151 /**
152152 * Updates the filter.
153- *
153+ *
154154 * @method Phaser.Filter#update
155155 * @param {Phaser.Pointer } [pointer] - A Pointer object to use for the filter. The coordinates are mapped to the mouse uniform.
156156 */
157- update : function ( pointer ) {
158-
157+ update : function ( pointer )
158+ {
159159 if ( pointer )
160160 {
161161 var x = pointer . x / this . game . width ;
@@ -170,11 +170,10 @@ Phaser.Filter.prototype = {
170170 }
171171
172172 this . uniforms . time . value = this . game . time . totalElapsedSeconds ( ) ;
173-
174173 } ,
175174
176175 /**
177- * Creates a new Phaser.Image object using a blank texture and assigns
176+ * Creates a new Phaser.Image object using a blank texture and assigns
178177 * this Filter to it. The image is then added to the world.
179178 *
180179 * If you don't provide width and height values then Filter.width and Filter.height are used.
@@ -191,8 +190,8 @@ Phaser.Filter.prototype = {
191190 * @param {number } [anchorY=0] - Set the y anchor point of the Image. A value between 0 and 1, where 0 is the top-left and 1 is bottom-right.
192191 * @return {Phaser.Image } The newly added Image object.
193192 */
194- addToWorld : function ( x , y , width , height , anchorX , anchorY ) {
195-
193+ addToWorld : function ( x , y , width , height , anchorX , anchorY )
194+ {
196195 if ( anchorX === undefined ) { anchorX = 0 ; }
197196 if ( anchorY === undefined ) { anchorY = 0 ; }
198197
@@ -232,30 +231,28 @@ Phaser.Filter.prototype = {
232231 *
233232 * @method Phaser.Filter#syncUniforms
234233 */
235- syncUniforms : function ( ) {
236-
234+ syncUniforms : function ( )
235+ {
237236 for ( var i = 0 ; i < this . shaders . length ; i ++ )
238237 {
239238 this . shaders [ i ] . dirty = true ;
240239 }
241-
242240 } ,
243241
244242 /**
245243 * Clear down this Filter and null out references to game.
246- *
244+ *
247245 * @method Phaser.Filter#destroy
248246 */
249- destroy : function ( ) {
250-
247+ destroy : function ( )
248+ {
251249 this . passes . length = 0 ;
252250 this . shaders . length = 0 ;
253251 this . fragmentSrc . length = 0 ;
254252
255253 this . game = null ;
256254 this . uniforms = null ;
257255 this . prevPoint = null ;
258-
259256 }
260257
261258} ;
0 commit comments