Skip to content

Commit 4b62c1a

Browse files
author
Thayer J Andrews
committed
CCEffectNode - Fix CCClippingNodes as children of CCEffectNode
Even if it had a stencil buffer, CCEffectNode was only clearing the color buffer.
1 parent f9b7c6b commit 4b62c1a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cocos2d/CCEffectNode.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ -(id)initWithWidth:(int)width height:(int)height pixelFormat:(CCTexturePixelForm
6161
{
6262
_effectRenderer = [[CCEffectRenderer alloc] init];
6363
_allocatedSize = CGSizeMake(0.0f, 0.0f);
64+
self.clearFlags = GL_COLOR_BUFFER_BIT;
6465
}
6566
return self;
6667
}
@@ -208,7 +209,7 @@ -(void)draw:(CCRenderer *)renderer transform:(const GLKMatrix4 *)transform
208209
// remainder of the effects.
209210
[self begin];
210211

211-
[_renderer enqueueClear:GL_COLOR_BUFFER_BIT color:_clearColor depth:self.clearDepth stencil:self.clearStencil globalSortOrder:NSIntegerMin];
212+
[_renderer enqueueClear:self.clearFlags color:_clearColor depth:self.clearDepth stencil:self.clearStencil globalSortOrder:NSIntegerMin];
212213

213214
//! make sure all children are drawn
214215
[self sortAllChildren];

0 commit comments

Comments
 (0)