Skip to content

Commit ccb48f7

Browse files
committed
Merge branch 'metal-final' into private-merge
Conflicts: cocos2d-ios.xcodeproj/project.pbxproj cocos2d-osx.xcodeproj/project.pbxproj cocos2d-tests-ios.xcodeproj/project.pbxproj cocos2d/CCConfiguration.m cocos2d/CCDirector.h cocos2d/CCDirector.m cocos2d/CCDirector_Private.h cocos2d/CCLabelTTF.m cocos2d/CCNode.m cocos2d/CCRenderTexture.m cocos2d/CCRenderer.m cocos2d/CCShader.m cocos2d/CCTexture.m cocos2d/CCTextureCache.m cocos2d/Platforms/CCGL.h cocos2d/Platforms/iOS/CCDirectorIOS.m cocos2d/Platforms/iOS/CCGLView.m
2 parents 0ff5020 + f469096 commit ccb48f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+3131
-3043
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.1.1
1+
3.2.0

cocos2d-ios.xcodeproj/project.pbxproj

Lines changed: 231 additions & 1276 deletions
Large diffs are not rendered by default.

cocos2d-osx.xcodeproj/project.pbxproj

Lines changed: 179 additions & 216 deletions
Large diffs are not rendered by default.

cocos2d-tests-ios.xcodeproj/project.pbxproj

Lines changed: 33 additions & 302 deletions
Large diffs are not rendered by default.

cocos2d-ui-tests/osx/main.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@
1212

1313
int main(int argc, char *argv[])
1414
{
15-
[CCGLView load_];
1615
return NSApplicationMain(argc, (const char **) argv);
1716
}

cocos2d-ui-tests/tests/CCEffectPongTest.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#import "CCTextureCache.h"
1111
#import "CCNodeColor.h"
1212
#import "CCEffectNode.h"
13-
#import "CCEffectGaussianBlur.h"
13+
#import "CCEffectBlur.h"
1414

1515

1616
#define PADDLE_SCALE 0.5f
@@ -37,7 +37,7 @@ @implementation CCEffectPongTest {
3737
CGSize _designSize;
3838

3939
CCEffectNode* _ballEffectNode;
40-
CCEffectGaussianBlur* _ballEffect;
40+
CCEffectBlur* _ballEffect;
4141

4242
CCNodeColor* _ceiling;
4343
CCNodeColor* _floor;
@@ -157,7 +157,7 @@ - (void)setupBall
157157
_ballEffectNode.scale = 0.1f;
158158
[_ballEffectNode addChild:_ball];
159159

160-
_ballEffect = [CCEffectGaussianBlur effectWithPixelBlurRadius:2.0];
160+
_ballEffect = [CCEffectBlur effectWithBlurRadius:2.0];
161161
_ballEffectNode.effect = _ballEffect;
162162
}
163163

cocos2d-ui-tests/tests/CCEffectsTest.m

Lines changed: 62 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#import "CCTextureCache.h"
33
#import "CCNodeColor.h"
44
#import "CCEffectNode.h"
5-
#import "CCEffectGaussianBlur.h"
5+
#import "CCEffectBlur.h"
66

77

88
@interface CCEffectsTest : TestBase @end
@@ -41,7 +41,7 @@ -(void)setupGlassEffectTest
4141

4242

4343
CCSpriteFrame *normalMap = [CCSpriteFrame frameWithImageNamed:@"Images/ShinyBallNormals.png"];
44-
CCEffectGlass *glass = [[CCEffectGlass alloc] initWithRefraction:1.0f refractionEnvironment:refractEnvironment reflectionEnvironment:reflectEnvironment normalMap:nil];
44+
CCEffectGlass *glass = [[CCEffectGlass alloc] initWithShininess:1.0f refraction:1.0f refractionEnvironment:refractEnvironment reflectionEnvironment:reflectEnvironment];
4545
glass.fresnelBias = 0.1f;
4646
glass.fresnelPower = 2.0f;
4747
glass.refraction = 0.75f;
@@ -81,7 +81,7 @@ -(void)setupReflectEffectTest
8181
[self.contentNode addChild:environment];
8282

8383
CCSpriteFrame *normalMap = [CCSpriteFrame frameWithImageNamed:@"Images/ShinyBallNormals.png"];
84-
CCEffectReflection *reflection = [[CCEffectReflection alloc] initWithEnvironment:environment normalMap:nil];
84+
CCEffectReflection *reflection = [[CCEffectReflection alloc] initWithShininess:1.0f environment:environment];
8585
reflection.fresnelBias = 0.0f;
8686
reflection.fresnelPower = 0.0f;
8787

@@ -148,7 +148,7 @@ -(void)setupRefractionEffectTest
148148
NSString *sphereTextureFile = @"Images/ShinyBallColor.png";
149149
CCTexture *sphereTexture = [CCTexture textureWithFile:sphereTextureFile];
150150
CCSpriteFrame *sphereNormalMap = [CCSpriteFrame frameWithImageNamed:@"Images/ShinyBallNormals.png"];
151-
CCEffectRefraction *sphereRefraction = [[CCEffectRefraction alloc] initWithRefraction:0.1f environment:renderTexture.sprite normalMap:nil];
151+
CCEffectRefraction *sphereRefraction = [[CCEffectRefraction alloc] initWithRefraction:0.1f environment:renderTexture.sprite];
152152
sphereRefraction.refraction = 0.75f;
153153

154154
p1 = CGPointMake(0.1f, 0.8f);
@@ -283,7 +283,7 @@ -(void)setupBlurEffectNodeTest
283283
effectNode.positionType = CCPositionTypeNormalized;
284284
effectNode.position = ccp(0.1, 0.5);
285285
[effectNode addChild:sampleSprite];
286-
CCEffectGaussianBlur* effect = [CCEffectGaussianBlur effectWithPixelBlurRadius:1.0];
286+
CCEffectBlur* effect = [CCEffectBlur effectWithBlurRadius:1.0];
287287
effectNode.effect = effect;
288288

289289
[self.contentNode addChild:effectNode];
@@ -297,7 +297,7 @@ -(void)setupBlurEffectNodeTest
297297
effectNode2.positionType = CCPositionTypeNormalized;
298298
effectNode2.position = ccp(0.21, 0.5);
299299
[effectNode2 addChild:sampleSprite2];
300-
CCEffectGaussianBlur* effect2 = [CCEffectGaussianBlur effectWithPixelBlurRadius:7.0];
300+
CCEffectBlur* effect2 = [CCEffectBlur effectWithBlurRadius:7.0];
301301
effectNode2.effect = effect2;
302302

303303
[self.contentNode addChild:effectNode2];
@@ -313,7 +313,7 @@ -(void)setupBlurEffectNodeTest
313313
effectNode3.position = ccp(0.5, 0.5);
314314
effectNode3.anchorPoint = ccp(0.5, 0.5);
315315
[effectNode3 addChild:sampleSprite3];
316-
CCEffectGaussianBlur* effect3 = [CCEffectGaussianBlur effectWithPixelBlurRadius:1.0];
316+
CCEffectBlur* effect3 = [CCEffectBlur effectWithBlurRadius:1.0];
317317
effectNode3.effect = effect3;
318318

319319
[self.contentNode addChild:effectNode3];
@@ -327,15 +327,15 @@ -(void)setupBlurEffectNodeTest
327327
effectNode4.positionType = CCPositionTypeNormalized;
328328
effectNode4.position = ccp(0.6, 0.5);
329329
[effectNode4 addChild:sampleSprite4];
330-
CCEffectGaussianBlur* effect4 = [CCEffectGaussianBlur effectWithPixelBlurRadius:7.0];
330+
CCEffectBlur* effect4 = [CCEffectBlur effectWithBlurRadius:7.0];
331331
effectNode4.effect = effect4;
332332

333333
[self.contentNode addChild:effectNode4];
334334
}
335335

336-
-(void)setupGlowEffectNodeTest
336+
-(void)setupBloomEffectTest
337337
{
338-
self.subTitle = @"Glow Effect Node Test";
338+
self.subTitle = @"Bloom Effect Test";
339339

340340
CCSprite *sampleSprite_base = [CCSprite spriteWithImageNamed:@"Images/sample_hollow_circle.png"];
341341
sampleSprite_base.anchorPoint = ccp(0.0, 0.0);
@@ -358,7 +358,7 @@ -(void)setupGlowEffectNodeTest
358358
glowEffectNode.positionType = CCPositionTypeNormalized;
359359
glowEffectNode.position = ccp(0.1, 0.5);
360360
[glowEffectNode addChild:sampleSprite];
361-
CCEffectBloom* glowEffect = [CCEffectBloom effectWithPixelBlurRadius:8 intensity:1.0f luminanceThreshold:0.0f];
361+
CCEffectBloom* glowEffect = [CCEffectBloom effectWithBlurRadius:8 intensity:1.0f luminanceThreshold:0.0f];
362362
glowEffectNode.effect = glowEffect;
363363

364364
[self.contentNode addChild:glowEffectNode];
@@ -385,10 +385,26 @@ -(void)setupGlowEffectNodeTest
385385
glowEffectNode2.positionType = CCPositionTypeNormalized;
386386
glowEffectNode2.position = ccp(0.4, 0.5);
387387
[glowEffectNode2 addChild:sampleSprite2];
388-
CCEffectBloom* glowEffect2 = [CCEffectBloom effectWithPixelBlurRadius:2 intensity:0.0f luminanceThreshold:0.0f];
388+
CCEffectBloom* glowEffect2 = [CCEffectBloom effectWithBlurRadius:2 intensity:0.0f luminanceThreshold:0.0f];
389389
glowEffectNode2.effect = glowEffect2;
390390

391391
[self.contentNode addChild:glowEffectNode2];
392+
393+
// Create a sprite to blur
394+
const int steps = 5;
395+
for (int i = 0; i < steps; i++)
396+
{
397+
CCSprite *sampleSprite3 = [CCSprite spriteWithImageNamed:@"Images/grossini_dance_08.png"];
398+
sampleSprite3.anchorPoint = ccp(0.5, 0.5);
399+
sampleSprite3.position = ccp(0.1f + i * (0.8f / (steps - 1)), 0.2f);
400+
sampleSprite3.positionType = CCPositionTypeNormalized;
401+
402+
// Blend glow maps test
403+
CCEffectBloom* glowEffect3 = [CCEffectBloom effectWithBlurRadius:8 intensity:1.0f luminanceThreshold:1.0f - ((float)i/(float)(steps-1))];
404+
sampleSprite3.effect = glowEffect3;
405+
406+
[self.contentNode addChild:sampleSprite3];
407+
}
392408
}
393409

394410
-(void)setupBrightnessAndContrastEffectNodeTest
@@ -454,15 +470,15 @@ -(void)setupSaturationEffectNodeTest
454470
];
455471

456472
// Effect nodes that use the effects in different combinations.
457-
[self.contentNode addChild:[self effectNodeWithEffects:@[effects[0]] appliedToSpriteWithImage:@"Images/grossini.png" atPosition:ccp(0.1, 0.5)]];
458-
[self.contentNode addChild:[self effectNodeWithEffects:@[effects[1]] appliedToSpriteWithImage:@"Images/grossini.png" atPosition:ccp(0.2, 0.5)]];
459-
[self.contentNode addChild:[self effectNodeWithEffects:@[effects[2]] appliedToSpriteWithImage:@"Images/grossini.png" atPosition:ccp(0.3, 0.5)]];
460-
[self.contentNode addChild:[self effectNodeWithEffects:@[effects[3]] appliedToSpriteWithImage:@"Images/grossini.png" atPosition:ccp(0.4, 0.5)]];
461-
[self.contentNode addChild:[self effectNodeWithEffects:@[effects[4]] appliedToSpriteWithImage:@"Images/grossini.png" atPosition:ccp(0.5, 0.5)]];
462-
[self.contentNode addChild:[self effectNodeWithEffects:@[effects[5]] appliedToSpriteWithImage:@"Images/grossini.png" atPosition:ccp(0.6, 0.5)]];
463-
[self.contentNode addChild:[self effectNodeWithEffects:@[effects[6]] appliedToSpriteWithImage:@"Images/grossini.png" atPosition:ccp(0.7, 0.5)]];
464-
[self.contentNode addChild:[self effectNodeWithEffects:@[effects[7]] appliedToSpriteWithImage:@"Images/grossini.png" atPosition:ccp(0.8, 0.5)]];
465-
[self.contentNode addChild:[self effectNodeWithEffects:@[effects[8]] appliedToSpriteWithImage:@"Images/grossini.png" atPosition:ccp(0.9, 0.5)]];
473+
[self.contentNode addChild:[self spriteWithEffects:@[effects[0]] image:@"Images/grossini.png" atPosition:ccp(0.1, 0.5)]];
474+
[self.contentNode addChild:[self spriteWithEffects:@[effects[1]] image:@"Images/grossini.png" atPosition:ccp(0.2, 0.5)]];
475+
[self.contentNode addChild:[self spriteWithEffects:@[effects[2]] image:@"Images/grossini.png" atPosition:ccp(0.3, 0.5)]];
476+
[self.contentNode addChild:[self spriteWithEffects:@[effects[3]] image:@"Images/grossini.png" atPosition:ccp(0.4, 0.5)]];
477+
[self.contentNode addChild:[self spriteWithEffects:@[effects[4]] image:@"Images/grossini.png" atPosition:ccp(0.5, 0.5)]];
478+
[self.contentNode addChild:[self spriteWithEffects:@[effects[5]] image:@"Images/grossini.png" atPosition:ccp(0.6, 0.5)]];
479+
[self.contentNode addChild:[self spriteWithEffects:@[effects[6]] image:@"Images/grossini.png" atPosition:ccp(0.7, 0.5)]];
480+
[self.contentNode addChild:[self spriteWithEffects:@[effects[7]] image:@"Images/grossini.png" atPosition:ccp(0.8, 0.5)]];
481+
[self.contentNode addChild:[self spriteWithEffects:@[effects[8]] image:@"Images/grossini.png" atPosition:ccp(0.9, 0.5)]];
466482
}
467483

468484
-(void)setupHueEffectTest
@@ -508,35 +524,41 @@ -(void)setupStackTest
508524
[self.contentNode addChild:refractEnvironment];
509525

510526
NSArray *effects = @[
511-
[CCEffectGaussianBlur effectWithPixelBlurRadius:7.0],
512-
[CCEffectBloom effectWithPixelBlurRadius:8 intensity:1.0f luminanceThreshold:0.0f],
527+
[CCEffectBlur effectWithBlurRadius:7.0],
528+
[CCEffectBloom effectWithBlurRadius:8 intensity:1.0f luminanceThreshold:0.0f],
513529
[CCEffectBrightness effectWithBrightness:0.25f],
514530
[CCEffectContrast effectWithContrast:1.0f],
515531
[CCEffectPixellate effectWithBlockSize:8.0f],
516532
[CCEffectSaturation effectWithSaturation:-1.0f],
517533
[CCEffectHue effectWithHue:90.0f],
518-
[CCEffectGlass effectWithRefraction:0.5f refractionEnvironment:refractEnvironment reflectionEnvironment:reflectEnvironment normalMap:nil],
519-
[CCEffectRefraction effectWithRefraction:0.5f environment:refractEnvironment normalMap:nil],
520-
[CCEffectReflection effectWithFresnelBias:0.2f fresnelPower:2.0f environment:reflectEnvironment normalMap:nil],
534+
[CCEffectGlass effectWithShininess:1.0f refraction:0.75f refractionEnvironment:refractEnvironment reflectionEnvironment:reflectEnvironment],
535+
[CCEffectRefraction effectWithRefraction:0.75f environment:refractEnvironment],
536+
[CCEffectReflection effectWithShininess:1.0f fresnelBias:0.1f fresnelPower:2.0f environment:reflectEnvironment],
521537
];
522538

523539

524-
CCSprite *sprite = [CCSprite spriteWithImageNamed:@"Images/ShinyBallColor.png"];
540+
// CCSprite *sprite = [CCSprite spriteWithImageNamed:@"Images/ShinyBallColor.png"];
541+
CCSprite *sprite = [[CCSprite alloc] init];
525542
sprite.positionType = CCPositionTypeNormalized;
526-
sprite.position = ccp(0.1f, 0.9f);
543+
sprite.position = ccp(0.5f, 0.5f);
527544
sprite.scale = 0.5f;
528545

529-
sprite.effect = [[CCEffectStack alloc] initWithEffects:@[effects[4]]];
546+
sprite.effect = [CCEffectStack effects:effects[7], effects[4], nil];
547+
530548
sprite.normalMapSpriteFrame = [CCSpriteFrame frameWithImageNamed:@"Images/ShinyBallNormals.png"];
531549
sprite.colorRGBA = [CCColor colorWithRed:0.75f green:0.75f blue:0.75f alpha:0.75f];
550+
sprite.colorRGBA = [CCColor colorWithRed:0.0f green:0.0f blue:0.0f alpha:0.0f];
532551

533552
[self.contentNode addChild:sprite];
534553

554+
CGPoint p1 = CGPointMake(0.1f, 0.1f);
555+
CGPoint p2 = CGPointMake(0.9f, 0.9f);
556+
535557
[sprite runAction:[CCActionRepeatForever actionWithAction:[CCActionSequence actions:
536-
[CCActionMoveTo actionWithDuration:8.0 position:ccp(0.9f, 0.9f)],
537-
[CCActionMoveTo actionWithDuration:8.0 position:ccp(0.9f, 0.1f)],
538-
[CCActionMoveTo actionWithDuration:8.0 position:ccp(0.1f, 0.1f)],
539-
[CCActionMoveTo actionWithDuration:8.0 position:ccp(0.1f, 0.9f)],
558+
[CCActionMoveTo actionWithDuration:2.0 position:ccp(p1.x, p2.y)],
559+
[CCActionMoveTo actionWithDuration:4.0 position:ccp(p2.x, p2.y)],
560+
[CCActionMoveTo actionWithDuration:2.0 position:ccp(p2.x, p1.y)],
561+
[CCActionMoveTo actionWithDuration:4.0 position:ccp(p1.x, p1.y)],
540562
nil
541563
]]];
542564
}
@@ -556,16 +578,16 @@ -(void)setupPerformanceTest
556578
refractEnvironment.scale = 0.5;
557579

558580
NSArray *allEffects = @[
559-
[CCEffectGaussianBlur effectWithPixelBlurRadius:7.0],
560-
[CCEffectBloom effectWithPixelBlurRadius:8 intensity:1.0f luminanceThreshold:0.0f],
581+
[CCEffectBlur effectWithBlurRadius:7.0],
582+
[CCEffectBloom effectWithBlurRadius:8 intensity:1.0f luminanceThreshold:0.0f],
561583
[CCEffectBrightness effectWithBrightness:0.25f],
562584
[CCEffectContrast effectWithContrast:1.0f],
563585
[CCEffectPixellate effectWithBlockSize:4.0f],
564586
[CCEffectSaturation effectWithSaturation:-1.0f],
565587
[CCEffectHue effectWithHue:90.0f],
566-
[CCEffectGlass effectWithRefraction:0.5f refractionEnvironment:refractEnvironment reflectionEnvironment:reflectEnvironment normalMap:nil],
567-
[CCEffectRefraction effectWithRefraction:0.5f environment:refractEnvironment normalMap:nil],
568-
[CCEffectReflection effectWithFresnelBias:0.1f fresnelPower:4.0f environment:reflectEnvironment normalMap:nil],
588+
[CCEffectGlass effectWithShininess:1.0f refraction:0.5f refractionEnvironment:refractEnvironment reflectionEnvironment:reflectEnvironment],
589+
[CCEffectRefraction effectWithRefraction:0.5f environment:refractEnvironment],
590+
[CCEffectReflection effectWithShininess:1.0f fresnelBias:0.1f fresnelPower:4.0f environment:reflectEnvironment],
569591
];
570592
CCEffect *selectedEffect = allEffects[8];
571593

@@ -655,7 +677,7 @@ - (CCNode *)effectNodeWithEffects:(NSArray *)effects appliedToSpriteWithImage:(N
655677
}
656678
else if (effects.count > 1)
657679
{
658-
CCEffectStack *stack = [[CCEffectStack alloc] initWithEffects:effects];
680+
CCEffectStack *stack = [CCEffectStack effectWithArray:effects];
659681
effectNode.effect = stack;
660682
}
661683

@@ -676,7 +698,7 @@ - (CCSprite *)spriteWithEffects:(NSArray *)effects image:(NSString *)spriteImage
676698
}
677699
else if (effects.count > 1)
678700
{
679-
CCEffectStack *stack = [[CCEffectStack alloc] initWithEffects:effects];
701+
CCEffectStack *stack = [CCEffectStack effectWithArray:effects];
680702
sprite.effect = stack;
681703
}
682704

cocos2d-ui/CCBReader/CCAnimationManager.m

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ - (void)setAnimatedProperty:(NSString*)name forNode:(CCNode*)node toValue:(id)va
254254
} else if ([name isEqualToString:@"skew"]) {
255255
node.skewX = [[value objectAtIndex:0] floatValue];
256256
node.skewY = [[value objectAtIndex:1] floatValue];
257+
} else if ([name isEqualToString:@"visible"]) {
258+
[(CCSprite*)node setVisible:[value boolValue]];
257259
} else if ([name isEqualToString:@"spriteFrame"]) {
258260
[(CCSprite*)node setSpriteFrame:value];
259261
} else {
@@ -463,11 +465,6 @@ - (void)runAnimationsForSequenceId:(int)seqId tweenDuration:(float) tweenDuratio
463465
_paused = YES;
464466
[self clearAllActions];
465467

466-
// Set the running scene
467-
_runningSequence = [self sequenceFromSequenceId:seqId];
468-
_runningSequence.time = 0.0f;
469-
_runningSequence.tween = tweenDuration;
470-
471468
[self addSequenceCallBacks:seqId tweenDuration:tweenDuration startTime:0];
472469

473470
// Contains all Sequence Propertys / Keyframe
@@ -493,7 +490,7 @@ - (void)runAnimationsForSequenceId:(int)seqId tweenDuration:(float) tweenDuratio
493490
}
494491

495492

496-
if(_lastSequence.sequenceId!=seqId) {
493+
if(_lastSequence.sequenceId!=seqId || _runningSequence.sequenceId!=seqId) {
497494
_loop = NO;
498495

499496
// Reset the nodes that may have been changed by other timelines
@@ -504,17 +501,30 @@ - (void)runAnimationsForSequenceId:(int)seqId tweenDuration:(float) tweenDuratio
504501

505502
id value = [nodeBaseValues objectForKey:propName];
506503

507-
if (value) {
504+
if (value!=nil) {
508505
[self setAnimatedProperty:propName forNode:node toValue:value tweenDuration:tweenDuration];
509506
}
510507
}
511508
}
509+
510+
// Reset nodes that have sequence node properties, build first keyframe action sequence.
511+
for (NSString* propName in seqNodeProps) {
512+
CCBSequenceProperty* seqProp = [seqNodeProps objectForKey:propName];
513+
[seqNodePropNames addObject:propName];
514+
515+
// Reset Node State to First KeyFrame
516+
[self setKeyFrameForNode:node sequenceProperty:seqProp tweenDuration:tweenDuration keyFrame:0];
517+
518+
}
512519
}
513520

514-
515521

516522
}
517523

524+
// Set the running scene
525+
_runningSequence = [self sequenceFromSequenceId:seqId];
526+
_runningSequence.time = 0.0f;
527+
518528
_paused = NO;
519529
}
520530

@@ -845,6 +855,13 @@ - (CCActionSequence*)createActionForNode:(CCNode*)node sequenceProperty:(CCBSequ
845855

846856
CCActionInterval* action = [self actionFromKeyframe0:startKF andKeyframe1:endKF propertyName:seqProp.name node:node];
847857

858+
// Create delay to fix instant easing on non instant actions
859+
if(startKF.easingType==kCCBKeyframeEasingInstant &&
860+
![seqProp.name isEqualToString:@"spriteFrame"] &&
861+
![seqProp.name isEqualToString:@"visible"]) {
862+
[actions addObject:[CCActionDelay actionWithDuration:action.duration]];
863+
}
864+
848865
if (action) {
849866
// Apply Easing
850867
action = [self easeAction:action easingType:startKF.easingType easingOpt:startKF.easingOpt];

cocos2d-ui/CCBReader/CCBReader.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ static inline void alignBits(CCBReader *self)
167167
}
168168

169169

170-
static inline unsigned int readVariableLengthIntFromArray(const uint8_t* buffer, uint32_t * value) {
170+
static inline ptrdiff_t readVariableLengthIntFromArray(const uint8_t* buffer, uint32_t * value) {
171171
const uint8_t* ptr = buffer;
172172
uint32_t b;
173173
uint32_t result;

cocos2d/CCClippingNode.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#import "CGPointExtension.h"
3434

3535
#import "CCNode_Private.h"
36-
//#import "CCDrawingPrimitives.h"
36+
#import "CCRenderDispatch.h"
3737

3838
static GLint _stencilBits = -1;
3939

@@ -76,7 +76,9 @@ - (id)initWithStencil:(CCNode *)stencil
7676
// get (only once) the number of bits of the stencil buffer
7777
static dispatch_once_t once;
7878
dispatch_once(&once, ^{
79-
glGetIntegerv(GL_STENCIL_BITS, &_stencilBits);
79+
CCRenderDispatch(NO, ^{
80+
glGetIntegerv(GL_STENCIL_BITS, &_stencilBits);
81+
});
8082
// warn if the stencil buffer is not enabled
8183
if (_stencilBits <= 0) {
8284
#if __CC_PLATFORM_IOS || __CC_PLATFORM_ANDROID

0 commit comments

Comments
 (0)