Merge pull request #4389 from minggo/remove-unneeded-codes

override addChild in Sprite to fix error in binding generator
This commit is contained in:
James Chen 2013-11-26 18:14:20 -08:00
commit 6c097fa692
2 changed files with 14 additions and 4 deletions

View File

@ -659,6 +659,16 @@ void Sprite::draw(void)
// Node overrides
void Sprite::addChild(Node *child)
{
Node::addChild(child);
}
void Sprite::addChild(Node *child, int zOrder)
{
Node::addChild(child, zOrder);
}
void Sprite::addChild(Node *child, int zOrder, int tag)
{
CCASSERT(child != NULL, "Argument must be non-NULL");

View File

@ -78,9 +78,6 @@ struct transformValues_;
* The default anchorPoint in Sprite is (0.5, 0.5).
*/
class CC_DLL Sprite : public NodeRGBA, public TextureProtocol
#ifdef EMSCRIPTEN
, public GLBufferedNode
#endif // EMSCRIPTEN
{
public:
@ -412,7 +409,10 @@ public:
virtual void removeChild(Node* child, bool cleanup) override;
virtual void removeAllChildrenWithCleanup(bool cleanup) override;
virtual void reorderChild(Node *child, int zOrder) override;
using Node::addChild;
// Should also override addChild(Node*) and addChild(Node*, int), or binding generator will only
// bind addChild(Node*, int, int);
virtual void addChild(Node* child) override;
virtual void addChild(Node* child, int zOrder) override;
virtual void addChild(Node *child, int zOrder, int tag) override;
virtual void sortAllChildren() override;
virtual void setScale(float scale) override;