Projects > cpp > Issues > Refactor #3480

We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.

Create Issue on Github

Removes unneeded codes of override function.

Refactor #3480 [Closed]
dumganhar 2013-12-23 11:41 . Updated almost 3 years ago

Node has virtual methods:

virtual void addChild(Node* child, int zorder, int tag);
virtual void addChild(Node* child, int zorder);
virtual void addChild(Node* child)

Sprite only override addChild(Node* child, int zorder, int tag),


Sprite should also override all these three methods.


By using using Node::addChild, at the header of Sprite. Another two override functions will be not needed.

TO SUPPORT `NEW ` , Bindings-generator also needs to be updated.

It should not bind override methods, since cpp has the feature of polymorphism.
In this way, it will reduce some memory cost in JS/LUA vm.

The changes of Bindings-generator is here:
The patch for Cocos2d-x is here:

Our codes will be clearer after applying this patch. Cheers.

dumganhar 2013-12-23 11:41
  • Tracker changed from Bug to Refactor
dumganhar 2013-12-23 11:42
  • Description updated (diff)
dumganhar 2013-12-24 05:57
  • Status changed from New to Closed
  • % Done changed from 0 to 100

Applied in changeset commit:5746e673c48804a9544de30be5ed911b1473e067.

Atom PDF

Start date:2013-12-23
Due date:
% Done:


Target version:3.0-beta

Sign up for our newsletter to keep up with the latest developments, releases and updates for Cocos2d-x.