Skip to content

Commit 521138e

Browse files
committed
setBlendMode now returns a boolean
1 parent fc5eb25 commit 521138e

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

src/renderer/webgl/WebGLRenderer.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -880,22 +880,24 @@ var WebGLRenderer = new Class({
880880
},
881881

882882
/**
883-
* [description]
883+
* Sets the blend mode to the value given.
884+
*
885+
* If the current blend mode is different from the one given, the pipeline is flushed and the new
886+
* blend mode is enabled.
884887
*
885888
* @method Phaser.Renderer.WebGL.WebGLRenderer#setBlendMode
886889
* @since 3.0.0
887890
*
888-
* @param {integer} blendModeId - [description]
891+
* @param {integer} blendModeId - The blend mode to be set. Can be a `BlendModes` const or an integer value.
889892
*
890-
* @return {Phaser.Renderer.WebGL.WebGLRenderer} [description]
893+
* @return {boolean} `true` if the blend mode was changed as a result of this call, forcing a flush, otherwise `false`.
891894
*/
892895
setBlendMode: function (blendModeId)
893896
{
894897
var gl = this.gl;
895898
var blendMode = this.blendModes[blendModeId];
896899

897-
if (blendModeId !== CONST.BlendModes.SKIP_CHECK &&
898-
this.currentBlendMode !== blendModeId)
900+
if (blendModeId !== CONST.BlendModes.SKIP_CHECK && this.currentBlendMode !== blendModeId)
899901
{
900902
this.flush();
901903

@@ -912,9 +914,11 @@ var WebGLRenderer = new Class({
912914
}
913915

914916
this.currentBlendMode = blendModeId;
917+
918+
return true;
915919
}
916920

917-
return this;
921+
return false;
918922
},
919923

920924
/**

0 commit comments

Comments
 (0)