We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.
Removes unneeded codes of override function.
Removes unneeded codes of override function.
Refactor #3480 [Closed]
We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.
Node
has virtual methods:Sprite
only overrideaddChild(Node* child, int zorder, int tag)
,OLD:¶
Sprite
should also override all these three methods.NEW¶
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: https://github.com/cocos2d/bindings-generator/pull/62
The patch for Cocos2d-x is here: https://github.com/cocos2d/cocos2d-x/pull/4600
Our codes will be clearer after applying this patch. Cheers.