From 31c508ef6de537a55ae73cffc52077f5436dc584 Mon Sep 17 00:00:00 2001 From: minggo Date: Tue, 9 Sep 2014 10:55:27 +0800 Subject: [PATCH] deprecated Node::_setZOrder() --- cocos/2d/CCNode.cpp | 7 +++++++ cocos/2d/CCNode.h | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/cocos/2d/CCNode.cpp b/cocos/2d/CCNode.cpp index e668f456ad..1dbf638b41 100644 --- a/cocos/2d/CCNode.cpp +++ b/cocos/2d/CCNode.cpp @@ -295,6 +295,13 @@ void Node::setLocalZOrder(int z) _eventDispatcher->setDirtyForNode(this); } +/// zOrder setter : private method +/// used internally to alter the zOrder variable. DON'T call this method manually +void Node::_setLocalZOrder(int z) +{ + _localZOrder = z; +} + void Node::setGlobalZOrder(float globalZOrder) { if (_globalZOrder != globalZOrder) diff --git a/cocos/2d/CCNode.h b/cocos/2d/CCNode.h index 5ea115ea45..9560fec164 100644 --- a/cocos/2d/CCNode.h +++ b/cocos/2d/CCNode.h @@ -150,6 +150,10 @@ public: virtual void setLocalZOrder(int localZOrder); CC_DEPRECATED_ATTRIBUTE virtual void setZOrder(int localZOrder) { setLocalZOrder(localZOrder); } + + /* Helper function used by `setLocalZOrder`. Don't use it unless you know what you are doing. + - */ + CC_DEPRECATED_ATTRIBUTE virtual void _setLocalZOrder(int z); /** * Gets the local Z order of this node.