Skip to content
Browse files

Issue 1159: Test doesn't use textures. It works OK with quads too.

  • Loading branch information...
1 parent 1a24f22 commit 8bacde4c2e54f02ab8d67b5052e4a961b77d440b @ricardoquesada ricardoquesada committed
View
43 .gitignore
@@ -1,13 +1,7 @@
-# XCode noise
+# git ignore template from: http://cocoaheads.tumblr.com/post/1350304132/gitignore-template-for-xcode3-4
+# cocos2d specific
PLBlocks.framework/*
-*.pbxuser
-*.mode1v3
*.pyc
-*~.nib/
-*.perspective
-*.perspectivev3
-xcuserdata/
-build/
# old school
.svn
@@ -16,3 +10,36 @@ build/
.DS_store
.DS_Store
profile
+
+# Mac OS X Finder
+.DS_Store
+# Sparkle distribution Private Key (Don’t check me in!)
+dsa_priv.pem
+# XCode (and ancestors) per-user config (very noisy, and not relevant)
+*.mode1
+*.mode1v3
+*.mode2v3
+*.perspective
+*.perspectivev3
+*.pbxuser
+# Xcode 4
+xcuserdata/
+project.xcworkspace/
+# Generated files
+VersionX-revision.h
+# build products
+build/
+*.[oa]
+# Other source repository archive directories (protects when importing)
+.hg
+.svn
+CVS
+# automatic backup files
+*~.nib
+*.swp
+*~
+*(Autosaved).rtfd/
+Backup[ ]of[ ]*.pages/
+Backup[ ]of[ ]*.key/
+Backup[ ]of[ ]*.numbers/
+
View
BIN Resources/Images/bugs/1159-background.png
Deleted file not rendered
View
BIN Resources/Images/bugs/1159-sprite_a.png
Deleted file not rendered
View
BIN Resources/Images/bugs/1159-sprite_b.png
Deleted file not rendered
View
2 tests/bugs/Bug-1159.h
@@ -20,6 +20,4 @@
}
+(id)scene;
--(void)doPageFlip;
-
@end
View
26 tests/bugs/Bug-1159.m
@@ -25,12 +25,15 @@ -(id)init
{
if ((self = [super init]))
{
- CCSprite *background = [CCSprite spriteWithFile:@"bugs/1159-background.png"];
- background.position = ccp(512.0, 384.0);
+ CGSize s = [[CCDirector sharedDirector] winSize];
+
+ CCLayerColor *background = [CCLayerColor layerWithColor:ccc4(255, 0, 255, 255)];
[self addChild:background];
- CCSprite *sprite_a = [CCSprite spriteWithFile:@"bugs/1159-sprite_a.png"];
- sprite_a.position = ccp(0.0, 384.0);
+ CCLayerColor *sprite_a = [CCLayerColor layerWithColor:ccc4(255, 0, 0, 255) width:700 height:700];
+ sprite_a.anchorPoint = ccp(0.5f, 0.5f);
+ [sprite_a setIsRelativeAnchorPoint:YES];
+ sprite_a.position = ccp(0.0, s.height/2);
[self addChild:sprite_a];
[sprite_a runAction:[CCRepeatForever actionWithAction:[CCSequence actions:
@@ -38,15 +41,17 @@ -(id)init
[CCMoveTo actionWithDuration:1.0 position:ccp(0.0, 384.0)],
nil]]];
- CCSprite *sprite_b = [CCSprite spriteWithFile:@"bugs/1159-sprite_b.png"];
- sprite_b.position = ccp(512.0, 384.0);
+ CCLayerColor *sprite_b = [CCLayerColor layerWithColor:ccc4(0, 0, 255, 255) width:400 height:400];
+ sprite_b.anchorPoint = ccp(0.5f, 0.5f);
+ [sprite_b setIsRelativeAnchorPoint:YES];
+ sprite_b.position = ccp(s.width/2, s.height/2);
[self addChild:sprite_b];
CCMenuItemLabel *label = [CCMenuItemLabel itemWithLabel:[CCLabelTTF labelWithString:@"Flip Me"
fontName:@"Helvetica"
fontSize:24]
block:^(id sender){
- [self doPageFlip];
+ [[CCDirector sharedDirector] replaceScene:[CCTransitionPageTurn transitionWithDuration:1.0 scene:[Bug1159 scene]]];
}
];
CCMenu *menu = [CCMenu menuWithItems:label, nil];
@@ -56,11 +61,6 @@ -(id)init
return self;
}
--(void)doPageFlip
-{
- [[CCDirector sharedDirector] replaceScene:[CCTransitionPageTurn transitionWithDuration:1.0 scene:[Bug1159 scene]]];
-}
-
@end
// CLASS IMPLEMENTATIONS
@@ -86,7 +86,7 @@ - (void) applicationDidFinishLaunching:(UIApplication*)application
// Create an EAGLView with a RGB8 color buffer, and a depth buffer of 24-bits
EAGLView *glView = [EAGLView viewWithFrame:[window bounds]
- pixelFormat:kEAGLColorFormatRGB565
+ pixelFormat:kEAGLColorFormatRGBA8
depthFormat:GL_DEPTH_COMPONENT24_OES];
// attach the openglView to the director

0 comments on commit 8bacde4

Please sign in to comment.
Something went wrong with that request. Please try again.