[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: Issue 1314 in cocos2d-iphone: cocos2d-iphone-2.0-beta2, [CCNode visible] return -1; cocos2d-iphone Tue Feb 21 01:00:25 2012

Comment #5 on issue 1314 by [EMAIL PROTECTED]: cocos2d-iphone-2.0-beta2, [CCNode visible] return -1;

Uh, this is bad fix for bool again. It broke cocos2d code everywhere. Here is one random example I discovered:

CCSprite *spr = [CCSprite spriteWithFile:@"Icon.png"];
spr.position = GDMANAGER.ccp_center;
[self addChild:spr];

id act1 = [CCMoveBy actionWithDuration:2 position:ccp2(0, 100)];
id act2 = [CCCallBlock actionWithBlock:^{
        NSLog(@"1st block");
id act3 = [CCMoveBy actionWithDuration:2 position:ccp2(0, -100)];
id act4 = [CCCallBlock actionWithBlock:^{
        NSLog(@"2nd block");
id actF = [CCSequence actions:act1, act2, act3, act4, nil];
[[[CCDirector sharedDirector] actionManager] addAction:actF target:spr paused:NO];

Instead of calling each block only once, here is what happens:

2012-02-21 09:18:24.617 CocosTemplate[4457:fb03] 1st block
2012-02-21 09:18:26.633 CocosTemplate[4457:fb03] 1st block
2012-02-21 09:18:26.634 CocosTemplate[4457:fb03] 1st block
2012-02-21 09:18:26.635 CocosTemplate[4457:fb03] 2nd block

As I said, this is one random example, who knows on how many places this change breaks cocos2d code. So, I am against changing BOOL to bool as I don't see a point in defining those things as bit fields? Just use BOOL and in implementation initialize everything to YES that needs to be YES. Please check this related post:

You received this message because you are subscribed to the Google Groups 
"cocos2d-iphone-issues" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at