Skip to content

Commit e3f0cc2

Browse files
committed
Merge branch 'develop' of https://github.com/cocos2d/cocos2d-iphone into develop
2 parents 4b1d95d + 7b1311e commit e3f0cc2

38 files changed

+198
-154
lines changed

Resources/Images/ShinyBallColor.png

54.9 KB
Loading

Resources/Images/ShinyBallNormals.png

42.3 KB
Loading

Resources/Images/ShinyTorusColor.png

65.3 KB
Loading
83.9 KB
Loading

cocos2d-ui-tests/tests/CCEffectsTest.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ -(void)setupRefractionEffectTest
5757

5858
[self.contentNode addChild:renderTexture];
5959

60-
NSString *sphereTextureFile = @"Images/sphere-256.png";
60+
NSString *sphereTextureFile = @"Images/ShinyBallColor.png";
6161
CCTexture *sphereTexture = [CCTexture textureWithFile:sphereTextureFile];
62-
CCSpriteFrame *sphereNormalMap = [CCSpriteFrame frameWithImageNamed:@"Images/sphere-normal-256.png"];
62+
CCSpriteFrame *sphereNormalMap = [CCSpriteFrame frameWithImageNamed:@"Images/ShinyBallNormals.png"];
6363
CCEffectRefraction *sphereRefraction = [[CCEffectRefraction alloc] initWithRefraction:0.1f environment:renderTexture.sprite normalMap:nil];
6464

6565
p1 = CGPointMake(0.1f, 0.8f);
@@ -76,9 +76,9 @@ -(void)setupRefractionEffectTest
7676
]]];
7777
[self.contentNode addChild:sprite1];
7878

79-
NSString *torusTextureFile = @"Images/torus-256.png";
79+
NSString *torusTextureFile = @"Images/ShinyTorusColor.png";
8080
CCTexture *torusTexture = [CCTexture textureWithFile:torusTextureFile];
81-
CCSpriteFrame *torusNormalMap = [CCSpriteFrame frameWithImageNamed:@"Images/torus-normal-256.png"];
81+
CCSpriteFrame *torusNormalMap = [CCSpriteFrame frameWithImageNamed:@"Images/ShinyTorusNormals.png"];
8282
CCEffectRefraction *torusRefraction = [[CCEffectRefraction alloc] initWithRefraction:0.1f environment:renderTexture.sprite normalMap:torusNormalMap];
8383

8484
p1 = CGPointMake(0.65f, 0.2f);

cocos2d-ui-tests/tests/SpritePerformanceTest.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ @implementation SpritePerformanceTest
66

77
#define SPRITE_COUNT 3000
88
#define TILE_COUNT 37
9+
#define SCALE 1.0
910

1011
- (void)setupSpritesUnbatchedUnatlassedTest
1112
{
@@ -18,6 +19,7 @@ - (void)setupSpritesUnbatchedUnatlassedTest
1819
CCSprite *sprite = [CCSprite spriteWithImageNamed:[NSString stringWithFormat:@"Tiles/%02d.png", num]];
1920
sprite.position = ccp(CCRANDOM_0_1()*size.width, CCRANDOM_0_1()*size.height);
2021
sprite.rotation = CCRANDOM_0_1()*360;
22+
sprite.scale = SCALE;
2123
[self.contentNode addChild:sprite];
2224
}
2325
}
@@ -33,6 +35,7 @@ - (void)setupSpritesUnbatchedTest
3335
CCSprite *sprite = [CCSprite spriteWithImageNamed:[NSString stringWithFormat:@"TilesAtlassed/%02d.png", num]];
3436
sprite.position = ccp(CCRANDOM_0_1()*size.width, CCRANDOM_0_1()*size.height);
3537
sprite.rotation = CCRANDOM_0_1()*360;
38+
sprite.scale = SCALE;
3639
[self.contentNode addChild:sprite];
3740
}
3841
}
@@ -48,6 +51,7 @@ - (void)setupSpritesUnbatchedUnatlassed2080Test
4851
CCSprite *sprite = [CCSprite spriteWithImageNamed:[NSString stringWithFormat:@"Tiles/%02d.png", num]];
4952
sprite.position = ccp(CCRANDOM_0_1()*size.width, CCRANDOM_0_1()*size.height);
5053
sprite.rotation = CCRANDOM_0_1()*360;
54+
sprite.scale = SCALE;
5155

5256
if(i < 0.8*SPRITE_COUNT) sprite.position = ccp(-1000, -1000);
5357

@@ -68,6 +72,7 @@ - (void)setupSpritesSorted2080Test
6872
CCSprite *sprite = [CCSprite spriteWithImageNamed:[NSString stringWithFormat:@"Tiles/%02d.png", num]];
6973
sprite.position = ccp(CCRANDOM_0_1()*size.width, CCRANDOM_0_1()*size.height);
7074
sprite.rotation = CCRANDOM_0_1()*360;
75+
sprite.scale = SCALE;
7176

7277
if(i < 0.8*SPRITE_COUNT) sprite.position = ccp(-1000, -1000);
7378

@@ -92,6 +97,7 @@ - (void)setupSpritesUnbatched2080Test
9297
CCSprite *sprite = [CCSprite spriteWithImageNamed:[NSString stringWithFormat:@"TilesAtlassed/%02d.png", num]];
9398
sprite.position = ccp(CCRANDOM_0_1()*size.width, CCRANDOM_0_1()*size.height);
9499
sprite.rotation = CCRANDOM_0_1()*360;
100+
sprite.scale = SCALE;
95101

96102
if(i < 0.8*SPRITE_COUNT) sprite.position = ccp(-1000, -1000);
97103

cocos2d-ui/CCBReader/CCAnimationManager.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ -(void) onEnter {
8585

8686
- (void)addNode:(CCNode*)node andSequences:(NSDictionary*)seq
8787
{
88-
#ifdef DEBUG
88+
#if DEBUG
8989
//Sanity check sequences;
9090

9191
for (NSMutableDictionary* seqNodeProps in seq.allValues) {

cocos2d-ui/CCButton.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,8 @@ - (void) stateChanged
321321
}
322322

323323
[_label stopAllActions];
324+
[_background stopAllActions];
325+
324326
if (_zoomWhenHighlighted)
325327
{
326328
_label.scaleX = _originalScaleX;

cocos2d/CCConfiguration.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ typedef NS_ENUM(NSUInteger, CCDevice) {
7575

7676
GLint _maxTextureSize;
7777
BOOL _supportsPVRTC;
78-
BOOL _supportsNPOT;
7978
BOOL _supportsBGRA8888;
8079
BOOL _supportsDiscardFramebuffer;
8180
BOOL _supportsShareableVAO;
@@ -92,12 +91,6 @@ typedef NS_ENUM(NSUInteger, CCDevice) {
9291
*/
9392
@property (nonatomic, readonly) GLint maxTextureUnits;
9493

95-
/** Whether or not the GPU supports NPOT (Non Power Of Two) textures.
96-
OpenGL ES 2.0 already supports NPOT (iOS).
97-
98-
*/
99-
@property (nonatomic, readonly) BOOL supportsNPOT;
100-
10194
/** Whether or not PVR Texture Compressed is supported */
10295
@property (nonatomic, readonly) BOOL supportsPVRTC;
10396

cocos2d/CCConfiguration.m

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ @implementation CCConfiguration
4444

4545
@synthesize maxTextureSize = _maxTextureSize, maxTextureUnits=_maxTextureUnits;
4646
@synthesize supportsPVRTC = _supportsPVRTC;
47-
@synthesize supportsNPOT = _supportsNPOT;
4847
@synthesize supportsBGRA8888 = _supportsBGRA8888;
4948
@synthesize supportsDiscardFramebuffer = _supportsDiscardFramebuffer;
5049
@synthesize supportsShareableVAO = _supportsShareableVAO;
@@ -182,12 +181,6 @@ -(void) getOpenGLvariables
182181
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &_maxTextureSize);
183182
glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &_maxTextureUnits );
184183

185-
#ifdef __CC_PLATFORM_IOS
186-
_supportsNPOT = YES;
187-
#elif defined(__CC_PLATFORM_MAC)
188-
_supportsNPOT = [self checkForGLExtension:@"GL_ARB_texture_non_power_of_two"];
189-
#endif
190-
191184
_supportsPVRTC = [self checkForGLExtension:@"GL_IMG_texture_compression_pvrtc"];
192185

193186
// It seems that somewhere between firmware iOS 3.0 and 4.2 Apple renamed
@@ -222,14 +215,6 @@ -(GLint) maxTextureUnits
222215
return _maxTextureUnits;
223216
}
224217

225-
-(BOOL) supportsNPOT
226-
{
227-
if( ! _openGLInitialized )
228-
[self getOpenGLvariables];
229-
230-
return _supportsNPOT;
231-
}
232-
233218
-(BOOL) supportsPVRTC
234219
{
235220
if( ! _openGLInitialized )
@@ -308,7 +293,6 @@ -(void) dumpInfo
308293
printf("cocos2d: GL_MAX_SAMPLES: %d\n", _maxSamplesAllowed);
309294
printf("cocos2d: GL supports PVRTC: %s\n", (_supportsPVRTC ? "YES" : "NO") );
310295
printf("cocos2d: GL supports BGRA8888 textures: %s\n", (_supportsBGRA8888 ? "YES" : "NO") );
311-
printf("cocos2d: GL supports NPOT textures: %s\n", (_supportsNPOT ? "YES" : "NO") );
312296
printf("cocos2d: GL supports discard_framebuffer: %s\n", (_supportsDiscardFramebuffer ? "YES" : "NO") );
313297
printf("cocos2d: GL supports shareable VAO: %s\n", (_supportsShareableVAO ? "YES" : "NO") );
314298

0 commit comments

Comments
 (0)