|
27 | 27 | cc.Node.WebGLRenderCmd.call(this, renderableObject);
|
28 | 28 | this._needDraw = true;
|
29 | 29 |
|
30 |
| - this._clearColor = cc.color(0, 0, 0, 0); |
31 | 30 | this._fBO = null;
|
32 | 31 | this._oldFBO = null;
|
33 | 32 | this._textureCopy = null;
|
|
52 | 51 | // backup and set
|
53 | 52 | if (locClearFlags & gl.COLOR_BUFFER_BIT) {
|
54 | 53 | oldClearColor = gl.getParameter(gl.COLOR_CLEAR_VALUE);
|
55 |
| - gl.clearColor(this._clearColor.r / 255, this._clearColor.g / 255, this._clearColor.b / 255, this._clearColor.a / 255); |
| 54 | + gl.clearColor(node._clearColor.r / 255, node._clearColor.g / 255, node._clearColor.b / 255, node._clearColor.a / 255); |
56 | 55 | }
|
57 | 56 |
|
58 | 57 | if (locClearFlags & gl.DEPTH_BUFFER_BIT) {
|
|
84 | 83 | var locChildren = node._children;
|
85 | 84 | for (var i = 0; i < locChildren.length; i++) {
|
86 | 85 | var getChild = locChildren[i];
|
87 |
| - if (getChild != node.sprite) |
88 |
| - getChild._renderCmd.visit(this); |
| 86 | + if (getChild != node.sprite){ |
| 87 | + getChild._renderCmd.visit(node.sprite._renderCmd); //TODO it's very Strange |
| 88 | + } |
89 | 89 | }
|
90 | 90 | node.end();
|
91 | 91 | }
|
|
114 | 114 | gl.deleteRenderbuffer(this._depthRenderBuffer);
|
115 | 115 | };
|
116 | 116 |
|
117 |
| - proto.updateClearColor = function(clearColor){}; |
| 117 | + proto.updateClearColor = function(clearColor){ }; |
118 | 118 |
|
119 | 119 | proto.initWithWidthAndHeight = function(width, height, format, depthStencilFormat){
|
120 | 120 | var node = this._node;
|
|
339 | 339 | node.end();
|
340 | 340 | };
|
341 | 341 |
|
342 |
| - proto.visit = function(ctx){ |
| 342 | + proto.visit = function(parentCmd){ |
343 | 343 | var node = this._node;
|
| 344 | + if (!node._visible) |
| 345 | + return; |
344 | 346 | cc.kmGLPushMatrix();
|
345 | 347 |
|
| 348 | + //TODO using GridNode |
346 | 349 | /* var locGrid = this.grid;
|
347 | 350 | if (locGrid && locGrid.isActive()) {
|
348 | 351 | locGrid.beforeDraw();
|
349 | 352 | this.transformAncestors();
|
350 | 353 | }*/
|
351 | 354 |
|
352 |
| - node.transform(ctx); |
| 355 | + this._syncStatus(parentCmd); |
353 | 356 | //this.toRenderer();
|
354 |
| - |
355 |
| - node.sprite.visit(); |
356 |
| - //this.draw(ctx); |
357 |
| - |
358 | 357 | cc.renderer.pushRenderCommand(this);
|
| 358 | + node.sprite.visit(this); |
359 | 359 |
|
360 | 360 | //TODO GridNode
|
361 | 361 | /* if (locGrid && locGrid.isActive())
|
|
0 commit comments