From ee638b9c8b1c92b945ffbee1c9137cc78b9ddc61 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Mon, 2 Sep 2013 16:56:14 -0700 Subject: [PATCH] removes 'private' section from SpriteBatchNode --- cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp | 6 +++--- cocos2dx/sprite_nodes/CCSpriteBatchNode.h | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp b/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp index e50721586d..51dec0fa63 100644 --- a/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp +++ b/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp @@ -350,10 +350,10 @@ void SpriteBatchNode::updateAtlasIndex(Sprite* sprite, int* curIndex) if (needNewIndex) {//all children have a zOrder < 0) - oldIndex=sprite->getAtlasIndex(); + oldIndex = sprite->getAtlasIndex(); sprite->setAtlasIndex(*curIndex); sprite->setOrderOfArrival(0); - if (oldIndex!=*curIndex) { + if (oldIndex != *curIndex) { swap(oldIndex, *curIndex); } (*curIndex)++; @@ -374,7 +374,7 @@ void SpriteBatchNode::swap(int oldIndex, int newIndex) auto newIt = std::next( _descendants.begin(), newIndex ); (*newIt)->setAtlasIndex(oldIndex); - (*oldIt)->setAtlasIndex(newIndex); +// (*oldIt)->setAtlasIndex(newIndex); std::swap( *oldIt, *newIt ); } diff --git a/cocos2dx/sprite_nodes/CCSpriteBatchNode.h b/cocos2dx/sprite_nodes/CCSpriteBatchNode.h index 7fd9289452..7559ffaba0 100644 --- a/cocos2dx/sprite_nodes/CCSpriteBatchNode.h +++ b/cocos2dx/sprite_nodes/CCSpriteBatchNode.h @@ -160,12 +160,10 @@ protected: */ SpriteBatchNode * addSpriteWithoutQuad(Sprite *child, int z, int aTag); -private: void updateAtlasIndex(Sprite* sprite, int* curIndex); void swap(int oldIndex, int newIndex); void updateBlendFunc(); -protected: TextureAtlas *_textureAtlas; BlendFunc _blendFunc;