Permalink
Browse files

Merge branch 'develop' into reorderSprite

  • Loading branch information...
2 parents 1faec20 + b02562e commit a97ec2f89bb00afc79a76207a9f920b8a9c48c9f @ricardoquesada ricardoquesada committed Mar 30, 2011
View
@@ -1,4 +1,4 @@
-version 1.0-rc - 28-Mar-2011
+version 1.0-rc - 29-Mar-2011
. [NEW] Actions: Added the possibility to create a CCSpawn and CCSequence with an NSArray
. [NEW] CCArray: Added exchangeObject & exchangeObjectAtIndex (issue #1085)
. [NEW] Templates: Added Xcode4 templates for cocos2d, cocos2d+box2d, cocos2d+chipmunk both for iOS and Mac OS X
@@ -14,7 +14,8 @@ version 1.0-rc - 28-Mar-2011
. [FIX] Documentation: onExit doxystring improved (issue #1135)
. [FIX] MenuItemToggle: Don't scale up if it is pressed several times (issue #948)
. [FIX] ProgressTimer: fixed underflow in setPercentage() (issue #1123)
-. [FIX] RenderTexture: Enable default GL states (but not disable them) (mitigated issue #1145)
+. [FIX] RenderTexture: Only enable default GL states, without disabling them (mitigated issue #1145)
+. [FIX] StreakMotion: fixed flicker introduced in v0.99.x (issue #1075)
. [FIX] Templates: Don't generate analyze warnings in Xcode4 (issue #1142)
. [FIX] Xcode: TexturePVR compiles when using cocos2d as an external library (issue #1132)
. [FIX] Xcode: Added SKIP_INSTALL=YES in libraries for Xcode4 (issue #1137)
View
0 RELEASE_NOTES 100755 → 100644
No changes.
View
0 Resources/Default.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 Resources/Icon.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 Resources/Info.plist 100755 → 100644
No changes.
View
0 Resources/InfoWithStatusBar.plist 100755 → 100644
No changes.
View
0 Resources/iTunesArtwork 100755 → 100644
No changes.
@@ -1624,6 +1624,8 @@
E08AA22C12C27DEA000341BD /* MainMenu-NoWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = E08AA22A12C27DEA000341BD /* MainMenu-NoWindow.xib */; };
E08AA22D12C27DEA000341BD /* MainMenu-NoWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = E08AA22A12C27DEA000341BD /* MainMenu-NoWindow.xib */; };
E08AA22F12C27E2F000341BD /* MainMenu-NoWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = E08AA22A12C27DEA000341BD /* MainMenu-NoWindow.xib */; };
+ E098B329134004F400FD53A3 /* test_image-bad_encoding.pvr in Resources */ = {isa = PBXBuildFile; fileRef = E098B328134004F400FD53A3 /* test_image-bad_encoding.pvr */; };
+ E098B32B1340068600FD53A3 /* MarkerFelt.ttc in Resources */ = {isa = PBXBuildFile; fileRef = E098B32A1340068600FD53A3 /* MarkerFelt.ttc */; };
E0AC05D81228021600EFA814 /* A Damn Mess.ttf in Resources */ = {isa = PBXBuildFile; fileRef = E076E7A21225EDD000DE0DA2 /* A Damn Mess.ttf */; };
E0AC05D91228021600EFA814 /* Abberancy.ttf in Resources */ = {isa = PBXBuildFile; fileRef = E076E7A31225EDD000DE0DA2 /* Abberancy.ttf */; };
E0AC05DA1228021600EFA814 /* Abduction.ttf in Resources */ = {isa = PBXBuildFile; fileRef = E076E7A41225EDD000DE0DA2 /* Abduction.ttf */; };
@@ -3957,6 +3959,8 @@
E08AA19A12C262B3000341BD /* MacWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MacWindow.m; sourceTree = "<group>"; };
E08AA22B12C27DEA000341BD /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = "Resources-Mac/English.lproj/MainMenu-NoWindow.xib"; sourceTree = "<group>"; };
E08AA23512C27E7D000341BD /* cocos2d_mac-no-window-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "cocos2d_mac-no-window-Info.plist"; path = "Resources-Mac/cocos2d_mac-no-window-Info.plist"; sourceTree = "<group>"; };
+ E098B328134004F400FD53A3 /* test_image-bad_encoding.pvr */ = {isa = PBXFileReference; lastKnownFileType = file; path = "test_image-bad_encoding.pvr"; sourceTree = "<group>"; };
+ E098B32A1340068600FD53A3 /* MarkerFelt.ttc */ = {isa = PBXFileReference; lastKnownFileType = file; path = MarkerFelt.ttc; sourceTree = "<group>"; };
E0AC06A51228021600EFA814 /* ActionTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ActionTest.app; sourceTree = BUILT_PRODUCTS_DIR; };
E0AC06A81228027D00EFA814 /* ActionsTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ActionsTest.h; path = tests/ActionsTest.h; sourceTree = "<group>"; };
E0AC06A91228027D00EFA814 /* ActionsTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ActionsTest.m; path = tests/ActionsTest.m; sourceTree = "<group>"; };
@@ -4650,6 +4654,7 @@
E076E7A11225EDD000DE0DA2 /* Fonts */ = {
isa = PBXGroup;
children = (
+ E098B32A1340068600FD53A3 /* MarkerFelt.ttc */,
E0796B5612DF8A8C002442F5 /* futura-48.fnt */,
E0796B5712DF8A8C002442F5 /* futura-48.png */,
E0C60677128ECC110099367C /* konqa32-hd.fnt */,
@@ -4686,8 +4691,6 @@
E076E7B71225EDD000DE0DA2 /* Images */ = {
isa = PBXGroup;
children = (
- E0D44F381291BFFB0094708A /* test_image_rgba4444.pvr.ccz */,
- E0D44F391291BFFB0094708A /* test_image_rgba4444.pvr.gz */,
E0D2D55F128CB06A00F78C63 /* piece.png */,
E076E7B81225EDD000DE0DA2 /* atlastest.png */,
E076E7B91225EDD000DE0DA2 /* b1.png */,
@@ -4761,34 +4764,7 @@
E076E8421225EDD000DE0DA2 /* stars2.png */,
E076E8431225EDD000DE0DA2 /* stars2_mini.png */,
E076E8441225EDD000DE0DA2 /* streak.png */,
- E076E8451225EDD000DE0DA2 /* test-rgba1.png */,
- E076E8461225EDD000DE0DA2 /* test_blend.bmp */,
- E076E8471225EDD000DE0DA2 /* test_blend.png */,
- E076E8481225EDD000DE0DA2 /* test_image.bmp */,
- E076E8491225EDD000DE0DA2 /* test_image.gif */,
- E076E84A1225EDD000DE0DA2 /* test_image.jpeg */,
- E076E84B1225EDD000DE0DA2 /* test_image.png */,
- E076E84C1225EDD000DE0DA2 /* test_image.pvr */,
- E076E84D1225EDD000DE0DA2 /* test_image.pvrraw */,
- E076E84E1225EDD000DE0DA2 /* test_image.tiff */,
- E076E84F1225EDD000DE0DA2 /* test_image_a8.pvr */,
- E076E8501225EDD000DE0DA2 /* test_image_ai88.pvr */,
- E076E8511225EDD000DE0DA2 /* test_image_bgra8888.pvr */,
- E076E8521225EDD000DE0DA2 /* test_image_i8.pvr */,
- E076E8531225EDD000DE0DA2 /* test_image_pvrtc2bpp.pvr */,
- E076E8541225EDD000DE0DA2 /* test_image_pvrtc4bpp.pvr */,
- E076E8551225EDD000DE0DA2 /* test_image_rgb565.pvr */,
- E076E8561225EDD000DE0DA2 /* test_image_rgba4444.pvr */,
- E076E8571225EDD000DE0DA2 /* test_image_rgba4444_mipmap.pvr */,
- E076E8581225EDD000DE0DA2 /* test_image_rgba5551.pvr */,
- E076E8591225EDD000DE0DA2 /* test_image_rgba8888.pvr */,
- E076E85A1225EDD000DE0DA2 /* texture1024x1024.png */,
- E076E85B1225EDD000DE0DA2 /* texture1024x1024_rgba4444.pvr */,
- E076E85C1225EDD000DE0DA2 /* texture2048x2048.png */,
- E076E85D1225EDD000DE0DA2 /* texture2048x2048_rgba4444.pvr */,
- E076E85E1225EDD000DE0DA2 /* texture4096x4096.png */,
- E076E85F1225EDD000DE0DA2 /* texture512x512.png */,
- E076E8601225EDD000DE0DA2 /* texture512x512_rgba4444.pvr */,
+ E098B3271340049A00FD53A3 /* PVR Test Images */,
);
name = Images;
path = Resources/Images;
@@ -4916,6 +4892,44 @@
name = external;
sourceTree = "<group>";
};
+ E098B3271340049A00FD53A3 /* PVR Test Images */ = {
+ isa = PBXGroup;
+ children = (
+ E098B328134004F400FD53A3 /* test_image-bad_encoding.pvr */,
+ E0D44F381291BFFB0094708A /* test_image_rgba4444.pvr.ccz */,
+ E0D44F391291BFFB0094708A /* test_image_rgba4444.pvr.gz */,
+ E076E8451225EDD000DE0DA2 /* test-rgba1.png */,
+ E076E8461225EDD000DE0DA2 /* test_blend.bmp */,
+ E076E8471225EDD000DE0DA2 /* test_blend.png */,
+ E076E8481225EDD000DE0DA2 /* test_image.bmp */,
+ E076E8491225EDD000DE0DA2 /* test_image.gif */,
+ E076E84A1225EDD000DE0DA2 /* test_image.jpeg */,
+ E076E84B1225EDD000DE0DA2 /* test_image.png */,
+ E076E84C1225EDD000DE0DA2 /* test_image.pvr */,
+ E076E84D1225EDD000DE0DA2 /* test_image.pvrraw */,
+ E076E84E1225EDD000DE0DA2 /* test_image.tiff */,
+ E076E84F1225EDD000DE0DA2 /* test_image_a8.pvr */,
+ E076E8501225EDD000DE0DA2 /* test_image_ai88.pvr */,
+ E076E8511225EDD000DE0DA2 /* test_image_bgra8888.pvr */,
+ E076E8521225EDD000DE0DA2 /* test_image_i8.pvr */,
+ E076E8531225EDD000DE0DA2 /* test_image_pvrtc2bpp.pvr */,
+ E076E8541225EDD000DE0DA2 /* test_image_pvrtc4bpp.pvr */,
+ E076E8551225EDD000DE0DA2 /* test_image_rgb565.pvr */,
+ E076E8561225EDD000DE0DA2 /* test_image_rgba4444.pvr */,
+ E076E8571225EDD000DE0DA2 /* test_image_rgba4444_mipmap.pvr */,
+ E076E8581225EDD000DE0DA2 /* test_image_rgba5551.pvr */,
+ E076E8591225EDD000DE0DA2 /* test_image_rgba8888.pvr */,
+ E076E85A1225EDD000DE0DA2 /* texture1024x1024.png */,
+ E076E85B1225EDD000DE0DA2 /* texture1024x1024_rgba4444.pvr */,
+ E076E85C1225EDD000DE0DA2 /* texture2048x2048.png */,
+ E076E85D1225EDD000DE0DA2 /* texture2048x2048_rgba4444.pvr */,
+ E076E85E1225EDD000DE0DA2 /* texture4096x4096.png */,
+ E076E85F1225EDD000DE0DA2 /* texture512x512.png */,
+ E076E8601225EDD000DE0DA2 /* texture512x512_rgba4444.pvr */,
+ );
+ name = "PVR Test Images";
+ sourceTree = "<group>";
+ };
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
@@ -6588,6 +6602,7 @@
E0D44F3B1291BFFB0094708A /* test_image_rgba4444.pvr.gz in Resources */,
E02A8538129F11BF00341C97 /* icon.icns in Resources */,
E08AA22D12C27DEA000341BD /* MainMenu-NoWindow.xib in Resources */,
+ E098B329134004F400FD53A3 /* test_image-bad_encoding.pvr in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -7397,6 +7412,7 @@
E02A853E129F11BF00341C97 /* icon.icns in Resources */,
E0796B5812DF8A8C002442F5 /* futura-48.fnt in Resources */,
E0796B5912DF8A8C002442F5 /* futura-48.png in Resources */,
+ E098B32B1340068600FD53A3 /* MarkerFelt.ttc in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -8880,6 +8896,7 @@
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_SHADOW = NO;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.6;
ONLY_ACTIVE_ARCH = YES;
@@ -8897,6 +8914,7 @@
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_SHADOW = NO;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.6;
PREBINDING = NO;
View
@@ -54,8 +54,8 @@ -(id)initWithFade:(float)fade minSeg:(float)seg image:(NSString*)path width:(flo
ribbon_ = [CCRibbon ribbonWithWidth:width_ image:path length:length color:color fade:fade];
[self addChild:ribbon_];
- // update ribbon position
- [self scheduleUpdate];
+ // update ribbon position. Use schedule:interval and not scheduleUpdated. issue #1075
+ [self schedule:@selector(update:) interval:0];
}
return self;
}
View
@@ -358,6 +358,7 @@ -(void)updateBar
CGPoint tMax = ccp(sprite_.texture.maxS,sprite_.texture.maxT);
unsigned char vIndexes[2] = {0,0};
+ unsigned char index = 0;
// We know vertex data is always equal to the 4 corners
// If we don't have vertex data then we create it here and populate
@@ -381,21 +382,21 @@ -(void)updateBar
vertexData_[vIndexes[1] = 2].texCoords = (ccTex2F){tMax.x, 0};
}
- unsigned char index = vIndexes[0];
+ index = vIndexes[0];
vertexData_[index].vertices = [self vertexFromTexCoord:ccp(vertexData_[index].texCoords.u, vertexData_[index].texCoords.v)];
index = vIndexes[1];
vertexData_[index].vertices = [self vertexFromTexCoord:ccp(vertexData_[index].texCoords.u, vertexData_[index].texCoords.v)];
if (sprite_.flipY || sprite_.flipX) {
if (sprite_.flipX) {
- unsigned char index = vIndexes[0];
+ index = vIndexes[0];
vertexData_[index].texCoords.u = tMax.x - vertexData_[index].texCoords.u;
index = vIndexes[1];
vertexData_[index].texCoords.u = tMax.x - vertexData_[index].texCoords.u;
}
if(sprite_.flipY){
- unsigned char index = vIndexes[0];
+ index = vIndexes[0];
vertexData_[index].texCoords.v = tMax.y - vertexData_[index].texCoords.v;
index = vIndexes[1];
vertexData_[index].texCoords.v = tMax.y - vertexData_[index].texCoords.v;
@@ -419,20 +420,20 @@ -(void)updateBar
vertexData_[vIndexes[1] = 3].texCoords = (ccTex2F){tMax.x, tMax.y*alpha};
}
- unsigned char index = vIndexes[0];
+ index = vIndexes[0];
vertexData_[index].vertices = [self vertexFromTexCoord:ccp(vertexData_[index].texCoords.u, vertexData_[index].texCoords.v)];
index = vIndexes[1];
vertexData_[index].vertices = [self vertexFromTexCoord:ccp(vertexData_[index].texCoords.u, vertexData_[index].texCoords.v)];
if (sprite_.flipY || sprite_.flipX) {
if (sprite_.flipX) {
- unsigned char index = vIndexes[0];
+ index = vIndexes[0];
vertexData_[index].texCoords.u = tMax.x - vertexData_[index].texCoords.u;
index = vIndexes[1];
vertexData_[index].texCoords.u = tMax.x - vertexData_[index].texCoords.u;
}
if(sprite_.flipY){
- unsigned char index = vIndexes[0];
+ index = vIndexes[0];
vertexData_[index].texCoords.v = tMax.y - vertexData_[index].texCoords.v;
index = vIndexes[1];
vertexData_[index].texCoords.v = tMax.y - vertexData_[index].texCoords.v;
@@ -59,9 +59,6 @@ enum
CCSprite* sprite_;
GLenum pixelFormat_;
- GLfloat clearColor_[4];
- BOOL restoreColor_;
-
}
/** The CCSprite being used.
View
@@ -30,11 +30,6 @@
#import "Support/ccUtils.h"
#import "Support/CCFileUtils.h"
-@interface CCRenderTexture ()
-- (void) saveGLColor;
-- (void) restoreGLColor;
-@end
-
@implementation CCRenderTexture
@synthesize sprite=sprite_;
@@ -115,44 +110,25 @@ -(void)dealloc
-(void)begin
{
- // don't clear the frame buffer
- [self beginWithClear:-1 g:-1 b:-1 a:-1];
-}
-
--(void)beginWithClear:(float)r g:(float)g b:(float)b a:(float)a
-{
- if( a != -1 ) {
- [self saveGLColor];
- restoreColor_ = YES;
- } else
- restoreColor_ = NO;
-
-
// Save the current matrix
glPushMatrix();
CGSize texSize = [texture_ contentSizeInPixels];
-
-
+
+
// Calculate the adjustment ratios based on the old and new projections
CGSize size = [[CCDirector sharedDirector] displaySizeInPixels];
float widthRatio = size.width / texSize.width;
float heightRatio = size.height / texSize.height;
-
-
+
+
// Adjust the orthographic propjection and viewport
ccglOrtho((float)-1.0 / widthRatio, (float)1.0 / widthRatio, (float)-1.0 / heightRatio, (float)1.0 / heightRatio, -1,1);
glViewport(0, 0, texSize.width, texSize.height);
-
-
+
+
glGetIntegerv(CC_GL_FRAMEBUFFER_BINDING, &oldFBO_);
ccglBindFramebuffer(CC_GL_FRAMEBUFFER, fbo_);//Will direct drawing to the frame buffer created above
-
-
- if( a != -1 ) {
- glClearColor(r, g, b, a);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- }
// Issue #1145
// There is no need to enable the default GL states here
@@ -166,16 +142,28 @@ -(void)beginWithClear:(float)r g:(float)g b:(float)b a:(float)a
CC_ENABLE_DEFAULT_GL_STATES();
}
+-(void)beginWithClear:(float)r g:(float)g b:(float)b a:(float)a
+{
+ [self begin];
+
+ // save clear color
+ GLfloat clearColor[4];
+ glGetFloatv(GL_COLOR_CLEAR_VALUE,clearColor);
+
+ glClearColor(r, g, b, a);
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ // restore clear color
+ glClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
+}
+
-(void)end
{
ccglBindFramebuffer(CC_GL_FRAMEBUFFER, oldFBO_);
// Restore the original matrix and viewport
glPopMatrix();
CGSize size = [[CCDirector sharedDirector] displaySizeInPixels];
glViewport(0, 0, size.width, size.height);
-
- if( restoreColor_ )
- [self restoreGLColor];
}
-(void)clear:(float)r g:(float)g b:(float)b a:(float)a
@@ -184,16 +172,6 @@ -(void)clear:(float)r g:(float)g b:(float)b a:(float)a
[self end];
}
--(void) saveGLColor
-{
- glGetFloatv(GL_COLOR_CLEAR_VALUE,clearColor_);
-}
-
-- (void) restoreGLColor
-{
- glClearColor(clearColor_[0], clearColor_[1], clearColor_[2], clearColor_[3]);
-}
-
#pragma mark RenderTexture - Save Image
#ifdef __IPHONE_OS_VERSION_MAX_ALLOWED
@@ -570,8 +570,8 @@ -(void) insertChild:(CCSprite*)sprite inAtlasAtIndex:(NSUInteger)index
// add children recursively
CCARRAY_FOREACH(sprite.children, child){
- NSUInteger index = [self atlasIndexForChild:child atZ: child.zOrder];
- [self insertChild:child inAtlasAtIndex:index];
+ NSUInteger idx = [self atlasIndexForChild:child atZ: child.zOrder];
+ [self insertChild:child inAtlasAtIndex:idx];
}
}
View
@@ -545,7 +545,6 @@ -(void) removeTileAt:(CGPoint)pos
[textureAtlas_ removeQuadAtIndex:atlasIndex];
// update possible children
- CCSprite *sprite;
CCARRAY_FOREACH(children_, sprite) {
NSUInteger ai = [sprite atlasIndex];
if( ai >= atlasIndex) {
View
@@ -122,7 +122,6 @@ -(id) parseLayer:(CCTMXLayerInfo*)layerInfo map:(CCTMXMapInfo*)mapInfo
-(CCTMXTilesetInfo*) tilesetForLayer:(CCTMXLayerInfo*)layerInfo map:(CCTMXMapInfo*)mapInfo
{
- CCTMXTilesetInfo *tileset = nil;
CFByteOrder o = CFByteOrderGetCurrent();
CGSize size = layerInfo.layerSize;
@@ -154,7 +153,7 @@ -(CCTMXTilesetInfo*) tilesetForLayer:(CCTMXLayerInfo*)layerInfo map:(CCTMXMapInf
// If all the tiles are 0, return empty tileset
CCLOG(@"cocos2d: Warning: TMX Layer '%@' has no tiles", layerInfo.name);
- return tileset;
+ return nil;
}
View
@@ -80,6 +80,9 @@ -(id) initWithTexture:(CCTexture2D*)tex capacity:(NSUInteger)n
// retained in property
self.texture = tex;
+ // Re-initialization is not allowed
+ NSAssert(quads_==nil && indices_==nil, @"CCTextureAtlas re-initialization is not allowed");
+
quads_ = calloc( sizeof(quads_[0]) * capacity_, 1 );
indices_ = calloc( sizeof(indices_[0]) * capacity_ * 6, 1 );
Oops, something went wrong.

0 comments on commit a97ec2f

Please sign in to comment.