Skip to content

Commit 429427c

Browse files
authored
Merge pull request phaserjs#4030 from Mattykins/master
Changed setFloatXv methods to accept a Float32Array rather than insta…
2 parents 5fe6dbb + 7005092 commit 429427c

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/renderer/webgl/WebGLPipeline.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ var WebGLPipeline = new Class({
551551
* @since 3.13.0
552552
*
553553
* @param {string} name - The name of the uniform to look-up and modify.
554-
* @param {array} arr - The new value to be used for the uniform variable.
554+
* @param {Float32Array} arr - The new value to be used for the uniform variable.
555555
*
556556
* @return {this} This WebGLPipeline instance.
557557
*/
@@ -569,7 +569,7 @@ var WebGLPipeline = new Class({
569569
* @since 3.13.0
570570
*
571571
* @param {string} name - The name of the uniform to look-up and modify.
572-
* @param {array} arr - The new value to be used for the uniform variable.
572+
* @param {Float32Array} arr - The new value to be used for the uniform variable.
573573
*
574574
* @return {this} This WebGLPipeline instance.
575575
*/
@@ -587,7 +587,7 @@ var WebGLPipeline = new Class({
587587
* @since 3.13.0
588588
*
589589
* @param {string} name - The name of the uniform to look-up and modify.
590-
* @param {array} arr - The new value to be used for the uniform variable.
590+
* @param {Float32Array} arr - The new value to be used for the uniform variable.
591591
*
592592
* @return {this} This WebGLPipeline instance.
593593
*/
@@ -605,7 +605,7 @@ var WebGLPipeline = new Class({
605605
* @since 3.13.0
606606
*
607607
* @param {string} name - The name of the uniform to look-up and modify.
608-
* @param {array} arr - The new value to be used for the uniform variable.
608+
* @param {Float32Array} arr - The new value to be used for the uniform variable.
609609
*
610610
* @return {this} This WebGLPipeline instance.
611611
*/

src/renderer/webgl/WebGLRenderer.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1959,15 +1959,15 @@ var WebGLRenderer = new Class({
19591959
*
19601960
* @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up.
19611961
* @param {string} name - The name of the uniform to look-up and modify.
1962-
* @param {array} arr - The new value to be used for the uniform variable.
1962+
* @param {Float32Array} arr - The new value to be used for the uniform variable.
19631963
*
19641964
* @return {this} This WebGL Renderer instance.
19651965
*/
19661966
setFloat1v: function (program, name, arr)
19671967
{
19681968
this.setProgram(program);
19691969

1970-
this.gl.uniform1fv(this.gl.getUniformLocation(program, name), new Float32Array(arr));
1970+
this.gl.uniform1fv(this.gl.getUniformLocation(program, name), arr);
19711971

19721972
return this;
19731973
},
@@ -1980,15 +1980,15 @@ var WebGLRenderer = new Class({
19801980
*
19811981
* @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up.
19821982
* @param {string} name - The name of the uniform to look-up and modify.
1983-
* @param {array} arr - The new value to be used for the uniform variable.
1983+
* @param {Float32Array} arr - The new value to be used for the uniform variable.
19841984
*
19851985
* @return {this} This WebGL Renderer instance.
19861986
*/
19871987
setFloat2v: function (program, name, arr)
19881988
{
19891989
this.setProgram(program);
19901990

1991-
this.gl.uniform2fv(this.gl.getUniformLocation(program, name), new Float32Array(arr));
1991+
this.gl.uniform2fv(this.gl.getUniformLocation(program, name), arr);
19921992

19931993
return this;
19941994
},
@@ -2001,15 +2001,15 @@ var WebGLRenderer = new Class({
20012001
*
20022002
* @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up.
20032003
* @param {string} name - The name of the uniform to look-up and modify.
2004-
* @param {array} arr - The new value to be used for the uniform variable.
2004+
* @param {Float32Array} arr - The new value to be used for the uniform variable.
20052005
*
20062006
* @return {this} This WebGL Renderer instance.
20072007
*/
20082008
setFloat3v: function (program, name, arr)
20092009
{
20102010
this.setProgram(program);
20112011

2012-
this.gl.uniform3fv(this.gl.getUniformLocation(program, name), new Float32Array(arr));
2012+
this.gl.uniform3fv(this.gl.getUniformLocation(program, name), arr);
20132013

20142014
return this;
20152015
},
@@ -2022,7 +2022,7 @@ var WebGLRenderer = new Class({
20222022
*
20232023
* @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up.
20242024
* @param {string} name - The name of the uniform to look-up and modify.
2025-
* @param {array} arr - The new value to be used for the uniform variable.
2025+
* @param {Float32Array} arr - The new value to be used for the uniform variable.
20262026
*
20272027
* @return {this} This WebGL Renderer instance.
20282028
*/
@@ -2031,7 +2031,7 @@ var WebGLRenderer = new Class({
20312031
{
20322032
this.setProgram(program);
20332033

2034-
this.gl.uniform4fv(this.gl.getUniformLocation(program, name), new Float32Array(arr));
2034+
this.gl.uniform4fv(this.gl.getUniformLocation(program, name), arr);
20352035

20362036
return this;
20372037
},

0 commit comments

Comments
 (0)