Skip to content

Commit

Permalink
Patch for issue 1216, useSelfRender should be called on all descendan…
Browse files Browse the repository at this point in the history
…ts of a batchnode, not only the children.

modified
CCSpriteBatchNode, removeAllChildren:
  • Loading branch information
araker committed Sep 12, 2011
1 parent c81c84f commit 862ec6c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cocos2d/CCSpriteBatchNode.m
Expand Up @@ -215,10 +215,11 @@ -(void)removeChildAtIndex:(NSUInteger)index cleanup:(BOOL)doCleanup
-(void)removeAllChildrenWithCleanup:(BOOL)doCleanup
{
// Invalidate atlas index. issue #569
[children_ makeObjectsPerformSelector:@selector(useSelfRender)];

// useSelfRender should be performed on all descendants. issue #1216
[descendants_ makeObjectsPerformSelector:@selector(useSelfRender)];

[super removeAllChildrenWithCleanup:doCleanup];

[descendants_ removeAllObjects];
[textureAtlas_ removeAllQuads];
}
Expand Down

0 comments on commit 862ec6c

Please sign in to comment.