remove Node::_setLocalZOrder()

This commit is contained in:
minggo 2014-09-03 17:26:50 +08:00
parent 290238f6e1
commit 5cca8cc87d
4 changed files with 7 additions and 17 deletions

View File

@ -280,14 +280,6 @@ void Node::setSkewY(float skewY)
_transformUpdated = _transformDirty = _inverseDirty = true;
}
/// 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::setLocalZOrder(int z)
{
if (_localZOrder == z)
@ -1170,7 +1162,7 @@ void Node::insertChild(Node* child, int z)
_transformUpdated = true;
_reorderChildDirty = true;
_children.pushBack(child);
child->_setLocalZOrder(z);
child->_localZOrder = z;
}
void Node::reorderChild(Node *child, int zOrder)
@ -1178,7 +1170,7 @@ void Node::reorderChild(Node *child, int zOrder)
CCASSERT( child != nullptr, "Child must be non-nil");
_reorderChildDirty = true;
child->setOrderOfArrival(s_globalOrderOfArrival++);
child->_setLocalZOrder(zOrder);
child->_localZOrder = zOrder;
}
void Node::sortAllChildren()

View File

@ -150,9 +150,7 @@ 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.
*/
virtual void _setLocalZOrder(int z);
/**
* Gets the local Z order of this node.
*

View File

@ -218,7 +218,7 @@ int ParticleBatchNode::addChildHelper(ParticleSystem* child, int z, int aTag, co
else
child->setName(name);
child->_setLocalZOrder(z);
child->setLocalZOrder(z);
child->setParent(this);
@ -285,7 +285,7 @@ void ParticleBatchNode::reorderChild(Node * aChild, int zOrder)
}
}
child->_setLocalZOrder(zOrder);
child->setLocalZOrder(zOrder);
}
void ParticleBatchNode::getCurrentIndex(int* oldIndex, int* newIndex, Node* child, int z)

View File

@ -249,7 +249,7 @@ void ProtectedNode::insertProtectedChild(cocos2d::Node *child, int z)
{
_reorderProtectedChildDirty = true;
_protectedChildren.pushBack(child);
child->_setLocalZOrder(z);
child->setLocalZOrder(z);
}
void ProtectedNode::sortAllProtectedChildren()
@ -265,7 +265,7 @@ void ProtectedNode::reorderProtectedChild(cocos2d::Node *child, int localZOrder)
CCASSERT( child != nullptr, "Child must be non-nil");
_reorderProtectedChildDirty = true;
child->setOrderOfArrival(s_globalOrderOfArrival++);
child->_setLocalZOrder(localZOrder);
child->setLocalZOrder(localZOrder);
}
void ProtectedNode::visit(Renderer* renderer, const Mat4 &parentTransform, uint32_t parentFlags)