removes 'private' section from SpriteBatchNode

This commit is contained in:
Ricardo Quesada 2013-09-02 16:56:14 -07:00
parent 088a11ad0d
commit ee638b9c8b
2 changed files with 3 additions and 5 deletions

View File

@ -350,10 +350,10 @@ void SpriteBatchNode::updateAtlasIndex(Sprite* sprite, int* curIndex)
if (needNewIndex) if (needNewIndex)
{//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); sprite->setOrderOfArrival(0);
if (oldIndex!=*curIndex) { if (oldIndex != *curIndex) {
swap(oldIndex, *curIndex); swap(oldIndex, *curIndex);
} }
(*curIndex)++; (*curIndex)++;
@ -374,7 +374,7 @@ void SpriteBatchNode::swap(int oldIndex, int newIndex)
auto newIt = std::next( _descendants.begin(), newIndex ); auto newIt = std::next( _descendants.begin(), newIndex );
(*newIt)->setAtlasIndex(oldIndex); (*newIt)->setAtlasIndex(oldIndex);
(*oldIt)->setAtlasIndex(newIndex); // (*oldIt)->setAtlasIndex(newIndex);
std::swap( *oldIt, *newIt ); std::swap( *oldIt, *newIt );
} }

View File

@ -160,12 +160,10 @@ protected:
*/ */
SpriteBatchNode * addSpriteWithoutQuad(Sprite *child, int z, int aTag); SpriteBatchNode * addSpriteWithoutQuad(Sprite *child, int z, int aTag);
private:
void updateAtlasIndex(Sprite* sprite, int* curIndex); void updateAtlasIndex(Sprite* sprite, int* curIndex);
void swap(int oldIndex, int newIndex); void swap(int oldIndex, int newIndex);
void updateBlendFunc(); void updateBlendFunc();
protected:
TextureAtlas *_textureAtlas; TextureAtlas *_textureAtlas;
BlendFunc _blendFunc; BlendFunc _blendFunc;