Skip to content

Commit cc3e15c

Browse files
committed
Issue cocos2d#2416: rename cc.Node's _StateCallbackType to _stateCallbackType
1 parent a84d3ea commit cc3e15c

File tree

6 files changed

+19
-23
lines changed

6 files changed

+19
-23
lines changed

cocos2d/clipping-nodes/CCClippingNode.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ cc.stencilBits = -1;
3434
/**
3535
* <p>
3636
* cc.ClippingNode is a subclass of cc.Node. <br/>
37-
* It draws its content (childs) clipped using a stencil. <br/>
37+
* It draws its content (children) clipped using a stencil. <br/>
3838
* The stencil is an other cc.Node that will not be drawn. <br/>
3939
* The clipping is done using the alpha part of the stencil (adjusted with an alphaThreshold).
4040
* </p>
@@ -210,7 +210,7 @@ cc.ClippingNode = cc.Node.extend(/** @lends cc.ClippingNode# */{
210210
if (cc.ClippingNode._layer + 1 == cc.stencilBits) {
211211
cc.ClippingNode._visit_once = true;
212212
if (cc.ClippingNode._visit_once) {
213-
cc.log("Nesting more than " + cc.stencilBits + "stencils is not supported. Everything will be drawn without stencil for this node and its childs.");
213+
cc.log("Nesting more than " + cc.stencilBits + "stencils is not supported. Everything will be drawn without stencil for this node and its children.");
214214
cc.ClippingNode._visit_once = false;
215215
}
216216
// draw everything, as if there where no stencil
@@ -232,7 +232,7 @@ cc.ClippingNode = cc.Node.extend(/** @lends cc.ClippingNode# */{
232232

233233
cc.renderer.pushRenderCommand(this._afterDrawStencilCmd);
234234

235-
// draw (according to the stencil test func) this node and its childs
235+
// draw (according to the stencil test func) this node and its children
236236
var locChildren = this._children;
237237
if (locChildren && locChildren.length > 0) {
238238
var childLen = locChildren.length;
@@ -366,7 +366,7 @@ cc.ClippingNode = cc.Node.extend(/** @lends cc.ClippingNode# */{
366366
var gl = ctx || cc._renderContext;
367367
// restore alpha test state
368368
//if (this.alphaThreshold < 1) {
369-
// XXX: we need to find a way to restore the shaders of the stencil node and its childs
369+
// XXX: we need to find a way to restore the shaders of the stencil node and its children
370370
//}
371371

372372
// restore the depth test state

cocos2d/core/base-nodes/CCNode.js

+9-13
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{
247247
return;
248248

249249
var i, len = array.length, node;
250-
var nodeCallbackType = cc.Node._StateCallbackType;
250+
var nodeCallbackType = cc.Node._stateCallbackType;
251251
switch (callbackType) {
252252
case nodeCallbackType.onEnter:
253253
for (i = 0; i < len; i++) {
@@ -1241,7 +1241,7 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{
12411241
cc.eventManager.removeListeners(this);
12421242

12431243
// timers
1244-
this._arrayMakeObjectsPerformSelector(this._children, cc.Node._StateCallbackType.cleanup);
1244+
this._arrayMakeObjectsPerformSelector(this._children, cc.Node._stateCallbackType.cleanup);
12451245
},
12461246

12471247
// composition: GET
@@ -1560,7 +1560,7 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{
15601560
onEnter: function () {
15611561
this._isTransitionFinished = false;
15621562
this._running = true;//should be running before resumeSchedule
1563-
this._arrayMakeObjectsPerformSelector(this._children, cc.Node._StateCallbackType.onEnter);
1563+
this._arrayMakeObjectsPerformSelector(this._children, cc.Node._stateCallbackType.onEnter);
15641564
this.resume();
15651565
},
15661566

@@ -1574,7 +1574,7 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{
15741574
*/
15751575
onEnterTransitionDidFinish: function () {
15761576
this._isTransitionFinished = true;
1577-
this._arrayMakeObjectsPerformSelector(this._children, cc.Node._StateCallbackType.onEnterTransitionDidFinish);
1577+
this._arrayMakeObjectsPerformSelector(this._children, cc.Node._stateCallbackType.onEnterTransitionDidFinish);
15781578
},
15791579

15801580
/**
@@ -1584,7 +1584,7 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{
15841584
* @function
15851585
*/
15861586
onExitTransitionDidStart: function () {
1587-
this._arrayMakeObjectsPerformSelector(this._children, cc.Node._StateCallbackType.onExitTransitionDidStart);
1587+
this._arrayMakeObjectsPerformSelector(this._children, cc.Node._stateCallbackType.onExitTransitionDidStart);
15881588
},
15891589

15901590
/**
@@ -1599,7 +1599,7 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{
15991599
onExit: function () {
16001600
this._running = false;
16011601
this.pause();
1602-
this._arrayMakeObjectsPerformSelector(this._children, cc.Node._StateCallbackType.onExit);
1602+
this._arrayMakeObjectsPerformSelector(this._children, cc.Node._stateCallbackType.onExit);
16031603
this.removeAllComponents();
16041604
},
16051605

@@ -2020,7 +2020,7 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{
20202020
*/
20212021
updateTransform: function () {
20222022
// Recursively iterate over children
2023-
this._arrayMakeObjectsPerformSelector(this._children, cc.Node._StateCallbackType.updateTransform);
2023+
this._arrayMakeObjectsPerformSelector(this._children, cc.Node._stateCallbackType.updateTransform);
20242024
},
20252025

20262026
/**
@@ -2213,7 +2213,7 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{
22132213
* It should be set in initialize phase.
22142214
* </p>
22152215
* @function
2216-
* @param {cc.GLProgram} newShaderProgram The shader program which fetchs from CCShaderCache.
2216+
* @param {cc.GLProgram} newShaderProgram The shader program which fetches from CCShaderCache.
22172217
* @example
22182218
* node.setGLProgram(cc.shaderCache.programForKey(cc.SHADER_POSITION_TEXTURECOLOR));
22192219
*/
@@ -2501,10 +2501,6 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{
25012501
else
25022502
parentColor = cc.color.WHITE;
25032503
this.updateDisplayedColor(parentColor);
2504-
2505-
/*if (color.a !== undefined && !color.a_undefined) { //setColor doesn't support changing opacity, please use setOpacity
2506-
this.setOpacity(color.a);
2507-
}*/
25082504
},
25092505

25102506
/**
@@ -2608,7 +2604,7 @@ cc.Node.create = function () {
26082604
return new cc.Node();
26092605
};
26102606

2611-
cc.Node._StateCallbackType = {onEnter: 1, onExit: 2, cleanup: 3, onEnterTransitionDidFinish: 4, updateTransform: 5, onExitTransitionDidStart: 6, sortAllChildren: 7};
2607+
cc.Node._stateCallbackType = {onEnter: 1, onExit: 2, cleanup: 3, onEnterTransitionDidFinish: 4, updateTransform: 5, onExitTransitionDidStart: 6, sortAllChildren: 7};
26122608

26132609
if (cc._renderType === cc._RENDER_TYPE_CANVAS) {
26142610
//redefine cc.Node

cocos2d/core/renderer/RendererWebGL.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ if(cc._renderType === cc._RENDER_TYPE_WEBGL){
424424
//cc.nodeDrawSetup(this);
425425
node._shaderProgram.use();
426426
node._shaderProgram._setUniformForMVPMatrixWithMat4(node._stackMatrix);
427-
node._arrayMakeObjectsPerformSelector(node._children, cc.Node._StateCallbackType.updateTransform);
427+
node._arrayMakeObjectsPerformSelector(node._children, cc.Node._stateCallbackType.updateTransform);
428428
cc.glBlendFunc(node._blendFunc.src, node._blendFunc.dst);
429429

430430
node.textureAtlas.drawQuads();

cocos2d/core/sprites/CCSpriteBatchNode.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ cc.SpriteBatchNode = cc.Node.extend(/** @lends cc.SpriteBatchNode# */{
10041004
//sorted now check all children
10051005
if (locChildren.length > 0) {
10061006
//first sort all children recursively based on zOrder
1007-
this._arrayMakeObjectsPerformSelector(locChildren, cc.Node._StateCallbackType.sortAllChildren);
1007+
this._arrayMakeObjectsPerformSelector(locChildren, cc.Node._stateCallbackType.sortAllChildren);
10081008
}
10091009
this._reorderChildDirty = false;
10101010
}
@@ -1033,7 +1033,7 @@ cc.SpriteBatchNode = cc.Node.extend(/** @lends cc.SpriteBatchNode# */{
10331033
//sorted now check all children
10341034
if (childrenArr.length > 0) {
10351035
//first sort all children recursively based on zOrder
1036-
this._arrayMakeObjectsPerformSelector(childrenArr, cc.Node._StateCallbackType.sortAllChildren);
1036+
this._arrayMakeObjectsPerformSelector(childrenArr, cc.Node._stateCallbackType.sortAllChildren);
10371037

10381038
var index = 0;
10391039
//fast dispatch, give every child a new atlasIndex based on their relative zOrder (keep parent -> child relations intact)
@@ -1059,7 +1059,7 @@ cc.SpriteBatchNode = cc.Node.extend(/** @lends cc.SpriteBatchNode# */{
10591059
//cc.nodeDrawSetup(this);
10601060
this._shaderProgram.use();
10611061
this._shaderProgram.setUniformForModelViewAndProjectionMatrixWithMat4();
1062-
this._arrayMakeObjectsPerformSelector(this._children, cc.Node._StateCallbackType.updateTransform);
1062+
this._arrayMakeObjectsPerformSelector(this._children, cc.Node._stateCallbackType.updateTransform);
10631063
cc.glBlendFunc(this._blendFunc.src, this._blendFunc.dst);
10641064

10651065
this.textureAtlas.drawQuads();

cocos2d/core/sprites/SpritesWebGL.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ cc._tmp.WebGLSprite = function () {
341341

342342
// recursively iterate over children
343343
if (_t._hasChildren)
344-
_t._arrayMakeObjectsPerformSelector(_t._children, cc.Node._StateCallbackType.updateTransform);
344+
_t._arrayMakeObjectsPerformSelector(_t._children, cc.Node._stateCallbackType.updateTransform);
345345

346346
if (cc.SPRITE_DEBUG_DRAW) {
347347
// draw bounding box

extensions/editbox/CCdomNode.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ cc.DOM.methods = /** @lends cc.DOM# */{
391391
this.unscheduleAllCallbacks();
392392

393393
// timers
394-
this._arrayMakeObjectsPerformSelector(this._children, cc.Node._StateCallbackType.cleanup);
394+
this._arrayMakeObjectsPerformSelector(this._children, cc.Node._stateCallbackType.cleanup);
395395
if (this.dom) {
396396
this.dom.remove();
397397
}

0 commit comments

Comments
 (0)