From 15ef0b9105fe2b5a53be278fe524c198285a2864 Mon Sep 17 00:00:00 2001 From: natural-law Date: Thu, 28 Apr 2011 10:16:58 +0800 Subject: [PATCH] issue #428, fix the bug created by issue 428. Have some loop in wrong arrays. --- cocos2dx/base_nodes/CCNode.cpp | 2 +- cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cocos2dx/base_nodes/CCNode.cpp b/cocos2dx/base_nodes/CCNode.cpp index 86a30ca723..7550ec8b95 100644 --- a/cocos2dx/base_nodes/CCNode.cpp +++ b/cocos2dx/base_nodes/CCNode.cpp @@ -107,7 +107,7 @@ void CCNode::arrayMakeObjectsPerformSelector(CCArray* pArray, callbackFunc func) if(pArray && pArray->count() > 0) { CCObject* child; - CCARRAY_FOREACH(m_pChildren, child) + CCARRAY_FOREACH(pArray, child) { CCNode* pNode = (CCNode*) child; if(pNode && func) diff --git a/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp b/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp index 816905f50a..f1702587f7 100644 --- a/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp +++ b/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp @@ -288,7 +288,7 @@ namespace cocos2d if (m_pobDescendants && m_pobDescendants->count() > 0) { CCObject* pObject = NULL; - CCARRAY_FOREACH(m_pChildren, pObject) + CCARRAY_FOREACH(m_pobDescendants, pObject) { CCSprite* pChild = (CCSprite*) pObject; if (pChild) @@ -353,7 +353,7 @@ namespace cocos2d if (pChildren && pChildren->count() > 0) { CCObject* pObject = NULL; - CCARRAY_FOREACH(m_pChildren, pObject) + CCARRAY_FOREACH(pChildren, pObject) { CCSprite* pChild = (CCSprite*) pObject; if (pChild && (pChild->getZOrder() < 0)) @@ -373,7 +373,7 @@ namespace cocos2d if (pChildren && pChildren->count() > 0) { CCObject* pObject = NULL; - CCARRAY_FOREACH(m_pChildren, pObject) + CCARRAY_FOREACH(pChildren, pObject) { CCSprite* pChild = (CCSprite*) pObject; if (pChild && (pChild->getZOrder() >= 0)) @@ -496,7 +496,7 @@ namespace cocos2d if (m_pobDescendants && m_pobDescendants->count() > 0) { CCObject* pObject = NULL; - CCARRAY_FOREACH(m_pChildren, pObject) + CCARRAY_FOREACH(m_pobDescendants, pObject) { CCSprite* pChild = (CCSprite*) pObject; if (pChild) @@ -516,7 +516,7 @@ namespace cocos2d if (pChildren && pChildren->count() > 0) { CCObject* pObject = NULL; - CCARRAY_FOREACH(m_pChildren, pObject) + CCARRAY_FOREACH(pChildren, pObject) { CCSprite* pChild = (CCSprite*) pObject; if (pChild) @@ -556,7 +556,7 @@ namespace cocos2d if (pChildren && pChildren->count() > 0) { CCObject* pObject = NULL; - CCARRAY_FOREACH(m_pChildren, pObject) + CCARRAY_FOREACH(pChildren, pObject) { CCSprite* pChild = (CCSprite*) pObject; if (pChild) @@ -639,7 +639,7 @@ namespace cocos2d if (m_pobDescendants && m_pobDescendants->count() > 0) { CCObject* pObject = NULL; - CCARRAY_FOREACH(m_pChildren, pObject) + CCARRAY_FOREACH(m_pobDescendants, pObject) { CCSprite* pChild = (CCSprite*) pObject; if (pChild && (pChild->getAtlasIndex() >= z))