Skip to content

Commit 4c26640

Browse files
committed
CCBReader support for Effects.
1 parent 5c55006 commit 4c26640

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

cocos2d-ui/CCBReader/CCBReader.m

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,8 +939,11 @@ - (void) readPropertyForNode:(CCNode*) node parent:(CCNode*)parent isExtraProp:(
939939
{
940940
CCEffect * effect = [self readEffects];
941941

942+
if(effect)
943+
{
942944
//Hmmm..... Force it to write to @"effect" property.
943945
[node setValue:effect forKey:@"effect"];
946+
}
944947

945948
}
946949
else
@@ -957,6 +960,11 @@ -(CCEffect*)readEffects
957960

958961
int numberOfEffects = readIntWithSign(self, NO);
959962

963+
if(numberOfEffects == 0)
964+
{
965+
return nil;
966+
}
967+
960968
NSMutableArray * effectsStack = [NSMutableArray array];
961969

962970
for (int i = 0; i < numberOfEffects; i++) {
@@ -988,7 +996,7 @@ -(CCEffect*)readEffects
988996

989997
}
990998

991-
return [[CCEffectStack alloc] initWithEffects:effectsStack];
999+
return [[CCEffectStack alloc] initWithArray:effectsStack];
9921000

9931001
}
9941002

0 commit comments

Comments
 (0)