Fix SpriteBatchNode sort error.

This commit is contained in:
Jacky 2015-06-30 14:12:18 +08:00
parent 9f32db9154
commit 25bac2f6a9
1 changed files with 0 additions and 4 deletions

View File

@ -280,7 +280,6 @@ void SpriteBatchNode::updateAtlasIndex(Sprite* sprite, ssize_t* curIndex)
{ {
oldIndex = sprite->getAtlasIndex(); oldIndex = sprite->getAtlasIndex();
sprite->setAtlasIndex(*curIndex); sprite->setAtlasIndex(*curIndex);
sprite->setOrderOfArrival(0);
if (oldIndex != *curIndex){ if (oldIndex != *curIndex){
swap(oldIndex, *curIndex); swap(oldIndex, *curIndex);
} }
@ -295,7 +294,6 @@ void SpriteBatchNode::updateAtlasIndex(Sprite* sprite, ssize_t* curIndex)
//all children are in front of the parent //all children are in front of the parent
oldIndex = sprite->getAtlasIndex(); oldIndex = sprite->getAtlasIndex();
sprite->setAtlasIndex(*curIndex); sprite->setAtlasIndex(*curIndex);
sprite->setOrderOfArrival(0);
if (oldIndex != *curIndex) if (oldIndex != *curIndex)
{ {
swap(oldIndex, *curIndex); swap(oldIndex, *curIndex);
@ -311,7 +309,6 @@ void SpriteBatchNode::updateAtlasIndex(Sprite* sprite, ssize_t* curIndex)
{ {
oldIndex = sprite->getAtlasIndex(); oldIndex = sprite->getAtlasIndex();
sprite->setAtlasIndex(*curIndex); sprite->setAtlasIndex(*curIndex);
sprite->setOrderOfArrival(0);
if (oldIndex != *curIndex) { if (oldIndex != *curIndex) {
this->swap(oldIndex, *curIndex); this->swap(oldIndex, *curIndex);
} }
@ -326,7 +323,6 @@ void SpriteBatchNode::updateAtlasIndex(Sprite* sprite, ssize_t* curIndex)
{//all children have a zOrder < 0) {//all children have a zOrder < 0)
oldIndex = sprite->getAtlasIndex(); oldIndex = sprite->getAtlasIndex();
sprite->setAtlasIndex(*curIndex); sprite->setAtlasIndex(*curIndex);
sprite->setOrderOfArrival(0);
if (oldIndex != *curIndex) { if (oldIndex != *curIndex) {
swap(oldIndex, *curIndex); swap(oldIndex, *curIndex);
} }