Permalink
Browse files

Merge commit '14f3ff8472a31f681de78837831b32d1cca93221' into develop

  • Loading branch information...
2 parents 3292b8b + 14f3ff8 commit c6d3e7493cd13676db2816e87b4e7c1cfe5119ad @ricardoquesada ricardoquesada committed Jul 11, 2011
View
@@ -103,6 +103,8 @@ -(void) updateAtlasValues
#pragma mark CCAtlasNode - draw
- (void) draw
{
+ [super draw];
+
// Default GL states: GL_TEXTURE_2D, GL_VERTEX_ARRAY, GL_COLOR_ARRAY, GL_TEXTURE_COORD_ARRAY
// Needed states: GL_TEXTURE_2D, GL_VERTEX_ARRAY, GL_TEXTURE_COORD_ARRAY
// Unneeded states: GL_COLOR_ARRAY
View
@@ -153,6 +153,8 @@ -(NSString*) string
// XXX: overriding draw from AtlasNode
- (void) draw
{
+ [super draw];
+
// Default GL states: GL_TEXTURE_2D, GL_VERTEX_ARRAY, GL_COLOR_ARRAY, GL_TEXTURE_COORD_ARRAY
// Needed states: GL_TEXTURE_2D, GL_VERTEX_ARRAY, GL_TEXTURE_COORD_ARRAY
// Unneeded states: GL_COLOR_ARRAY
View
@@ -355,6 +355,8 @@ - (void) updateColor
- (void)draw
{
+ [super draw];
+
// Default GL states: GL_TEXTURE_2D, GL_VERTEX_ARRAY, GL_COLOR_ARRAY, GL_TEXTURE_COORD_ARRAY
// Needed states: GL_VERTEX_ARRAY, GL_COLOR_ARRAY
// Unneeded states: GL_TEXTURE_2D, GL_TEXTURE_COORD_ARRAY
View
@@ -401,7 +401,7 @@ -(void) alignItemsInColumns: (NSNumber *) columns vaList: (va_list) args
[item setPosition:ccp(x - winSize.width / 2,
y - itemSize.height / 2)];
- x += w + 10;
+ x += w;
++columnsOccupied;
if(columnsOccupied >= rowColumns) {
@@ -97,6 +97,8 @@ -(void) postStep
-(void) draw
{
+ [super draw];
+
if (particleIdx==0)
return;
@@ -258,6 +258,8 @@ -(void) postStep
// overriding draw method
-(void) draw
{
+ [super draw];
+
// Default GL states: GL_TEXTURE_2D, GL_VERTEX_ARRAY, GL_COLOR_ARRAY, GL_TEXTURE_COORD_ARRAY
// Needed states: GL_TEXTURE_2D, GL_VERTEX_ARRAY, GL_COLOR_ARRAY, GL_TEXTURE_COORD_ARRAY
// Unneeded states: -
@@ -459,6 +459,8 @@ -(CGPoint)boundaryTexCoord:(char)index
-(void)draw
{
+ [super draw];
+
if(!vertexData_)return;
if(!sprite_)return;
ccBlendFunc blendFunc = sprite_.blendFunc;
View
@@ -251,6 +251,8 @@ -(void)addPointAt:(CGPoint)location width:(float)w
-(void) draw
{
+ [super draw];
+
if ([segments_ count] > 0)
{
// Default GL states: GL_TEXTURE_2D, GL_VERTEX_ARRAY, GL_COLOR_ARRAY, GL_TEXTURE_COORD_ARRAY
View
@@ -595,6 +595,8 @@ -(void) getTransformValues:(struct transformValues_*) tv
-(void) draw
{
+ [super draw];
+
NSAssert(!usesBatchNode_, @"If CCSprite is being rendered by CCSpriteBatchNode, CCSprite#draw SHOULD NOT be called");
// Default GL states: GL_TEXTURE_2D, GL_VERTEX_ARRAY, GL_COLOR_ARRAY, GL_TEXTURE_COORD_ARRAY
@@ -258,6 +258,8 @@ -(void)removeAllChildrenWithCleanup:(BOOL)doCleanup
#pragma mark CCSpriteBatchNode - draw
-(void) draw
{
+ [super draw];
+
// Optimization: Fast Dispatch
if( textureAtlas_.totalQuads == 0 )
return;
View
@@ -93,6 +93,8 @@ -(void) sceneOrder
-(void) draw
{
+ [super draw];
+
if( inSceneOnTop_ ) {
[outScene_ visit];
[inScene_ visit];
@@ -139,7 +139,7 @@ int ccInflateGZipFile(const char *path, unsigned char **out)
}
/* 512k initial decompress buffer */
- unsigned int bufferSize = 512 * 1024;
+ int bufferSize = 512 * 1024;
unsigned int totalBufferSize = bufferSize;
*out = malloc( bufferSize );
View
@@ -51,7 +51,9 @@
@since v0.99.5
*/
+#ifndef CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL
#define CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL 0
+#endif
/** @def CC_FONT_LABEL_SUPPORT
@@ -63,7 +65,13 @@
Only valid for cocos2d-ios. Not supported on cocos2d-mac
*/
+#ifndef CC_FONT_LABEL_SUPPORT
+#ifdef __IPHONE_OS_VERSION_MAX_ALLOWED
#define CC_FONT_LABEL_SUPPORT 1
+#elif defined(__MAC_OS_X_VERSION_MAX_ALLOWED)
+#define CC_FONT_LABEL_SUPPORT 0
+#endif
+#endif
/** @def CC_DIRECTOR_FAST_FPS
If enabled, then the FPS will be drawn using CCLabelAtlas (fast rendering).
@@ -72,7 +80,9 @@
To enable set it to a value different than 0. Enabled by default.
*/
+#ifndef CC_DIRECTOR_FAST_FPS
#define CC_DIRECTOR_FAST_FPS 1
+#endif
/** @def CC_DIRECTOR_FPS_INTERVAL
Senconds between FPS updates.
@@ -81,7 +91,9 @@
Default value: 0.1f
*/
+#ifndef CC_DIRECTOR_FPS_INTERVAL
#define CC_DIRECTOR_FPS_INTERVAL (0.1f)
+#endif
/** @def CC_DIRECTOR_DISPATCH_FAST_EVENTS
If enabled, and only when it is used with CCFastDirector, the main loop will wait 0.04 seconds to
@@ -93,7 +105,9 @@
@warning This feature is experimental
*/
+#ifndef CC_DIRECTOR_DISPATCH_FAST_EVENTS
#define CC_DIRECTOR_DISPATCH_FAST_EVENTS 0
+#endif
/** @def CC_DIRECTOR_MAC_USE_DISPLAY_LINK_THREAD
If enabled, cocos2d-mac will run on the Display Link thread. If disabled cocos2d-mac will run in its own thread.
@@ -106,26 +120,30 @@
Only valid for cocos2d-mac. Not supported on cocos2d-ios.
*/
+#ifndef CC_DIRECTOR_MAC_USE_DISPLAY_LINK_THREAD
#define CC_DIRECTOR_MAC_USE_DISPLAY_LINK_THREAD 1
+#endif
/** @def CC_COCOSNODE_RENDER_SUBPIXEL
If enabled, the CCNode objects (CCSprite, CCLabel,etc) will be able to render in subpixels.
If disabled, integer pixels will be used.
To enable set it to 1. Enabled by default.
*/
+#ifndef CC_COCOSNODE_RENDER_SUBPIXEL
#define CC_COCOSNODE_RENDER_SUBPIXEL 1
+#endif
/** @def CC_SPRITEBATCHNODE_RENDER_SUBPIXEL
If enabled, the CCSprite objects rendered with CCSpriteBatchNode will be able to render in subpixels.
If disabled, integer pixels will be used.
To enable set it to 1. Enabled by default.
*/
+#ifndef CC_SPRITEBATCHNODE_RENDER_SUBPIXEL
#define CC_SPRITEBATCHNODE_RENDER_SUBPIXEL 1
+#endif
-
-#if defined(__ARM_NEON__) || TARGET_IPHONE_SIMULATOR || defined(__MAC_OS_X_VERSION_MAX_ALLOWED)
/** @def CC_USES_VBO
If enabled, batch nodes (texture atlas and particle system) will use VBO instead of vertex list (VBO is recommended by Apple)
@@ -135,10 +153,13 @@
@since v0.99.5
*/
+#ifndef CC_USES_VBO
+#if defined(__ARM_NEON__) || TARGET_IPHONE_SIMULATOR || defined(__MAC_OS_X_VERSION_MAX_ALLOWED)
#define CC_USES_VBO 1
#else
#define CC_USES_VBO 0
#endif
+#endif
/** @def CC_NODE_TRANSFORM_USING_AFFINE_MATRIX
If enabled, CCNode will transform the nodes using a cached Affine matrix.
@@ -152,7 +173,9 @@
To enable set it to a value different than 0. Enabled by default.
*/
+#ifndef CC_NODE_TRANSFORM_USING_AFFINE_MATRIX
#define CC_NODE_TRANSFORM_USING_AFFINE_MATRIX 1
+#endif
/** @def CC_OPTIMIZE_BLEND_FUNC_FOR_PREMULTIPLIED_ALPHA
If most of your imamges have pre-multiplied alpha, set it to 1 (if you are going to use .PNG/.JPG file images).
@@ -162,7 +185,9 @@
@since v0.99.5
*/
+#ifndef CC_OPTIMIZE_BLEND_FUNC_FOR_PREMULTIPLIED_ALPHA
#define CC_OPTIMIZE_BLEND_FUNC_FOR_PREMULTIPLIED_ALPHA 1
+#endif
/** @def CC_TEXTURE_ATLAS_USE_TRIANGLE_STRIP
Use GL_TRIANGLE_STRIP instead of GL_TRIANGLES when rendering the texture atlas.
@@ -171,8 +196,9 @@
To enable set it to a value different than 0. Disabled by default.
*/
+#ifndef CC_TEXTURE_ATLAS_USE_TRIANGLE_STRIP
#define CC_TEXTURE_ATLAS_USE_TRIANGLE_STRIP 0
-
+#endif
/** @def CC_TEXTURE_NPOT_SUPPORT
If enabled, NPOT textures will be used where available. Only 3rd gen (and newer) devices support NPOT textures.
@@ -189,7 +215,9 @@
@since v0.99.2
*/
+#ifndef CC_TEXTURE_NPOT_SUPPORT
#define CC_TEXTURE_NPOT_SUPPORT 0
+#endif
/** @def CC_RETINA_DISPLAY_SUPPORT
If enabled, cocos2d supports retina display.
@@ -199,7 +227,9 @@
@since v0.99.5
*/
+#ifndef CC_RETINA_DISPLAY_SUPPORT
#define CC_RETINA_DISPLAY_SUPPORT 1
+#endif
/** @def CC_RETINA_DISPLAY_FILENAME_SUFFIX
It's the suffix that will be appended to the files in order to load "retina display" images.
@@ -211,7 +241,9 @@
@since v0.99.5
*/
+#ifndef CC_RETINA_DISPLAY_FILENAME_SUFFIX
#define CC_RETINA_DISPLAY_FILENAME_SUFFIX @"-hd"
+#endif
/** @def CC_USE_LA88_LABELS_ON_NEON_ARCH
If enabled, it will use LA88 (16-bit textures) on Neon devices for CCLabelTTF objects.
@@ -224,7 +256,9 @@
@since v0.99.5
*/
+#ifndef CC_USE_LA88_LABELS_ON_NEON_ARCH
#define CC_USE_LA88_LABELS_ON_NEON_ARCH 0
+#endif
/** @def CC_SPRITE_DEBUG_DRAW
If enabled, all subclasses of CCSprite will draw a bounding box
@@ -235,31 +269,39 @@
1 -- draw bounding box
2 -- draw texture box
*/
+#ifndef CC_SPRITE_DEBUG_DRAW
#define CC_SPRITE_DEBUG_DRAW 0
+#endif
/** @def CC_SPRITEBATCHNODE_DEBUG_DRAW
If enabled, all subclasses of CCSprite that are rendered using an CCSpriteBatchNode draw a bounding box.
Useful for debugging purposes only. It is recommened to leave it disabled.
To enable set it to a value different than 0. Disabled by default.
*/
+#ifndef CC_SPRITEBATCHNODE_DEBUG_DRAW
#define CC_SPRITEBATCHNODE_DEBUG_DRAW 0
+#endif
/** @def CC_LABELBMFONT_DEBUG_DRAW
If enabled, all subclasses of CCLabelBMFont will draw a bounding box
Useful for debugging purposes only. It is recommened to leave it disabled.
To enable set it to a value different than 0. Disabled by default.
*/
+#ifndef CC_LABELBMFONT_DEBUG_DRAW
#define CC_LABELBMFONT_DEBUG_DRAW 0
+#endif
/** @def CC_LABELBMFONT_DEBUG_DRAW
If enabled, all subclasses of CCLabeltAtlas will draw a bounding box
Useful for debugging purposes only. It is recommened to leave it disabled.
To enable set it to a value different than 0. Disabled by default.
*/
+#ifndef CC_LABELATLAS_DEBUG_DRAW
#define CC_LABELATLAS_DEBUG_DRAW 0
+#endif
/** @def CC_ENABLE_PROFILERS
If enabled, will activate various profilers withing cocos2d. This statistical data will be output to the console
@@ -268,7 +310,9 @@
To enable set it to a value different than 0. Disabled by default.
*/
+#ifndef CC_ENABLE_PROFILERS
#define CC_ENABLE_PROFILERS 0
+#endif
//
// DON'T edit this macro.
@@ -460,7 +460,7 @@ - (NSRange)rangeOfAttributeRunsForRange:(NSRange)range {
NSRange subrange = NSMakeRange(first, [_attributes count] - first);
if (NSMaxRange(range) < [_buffer length]) {
ZAttributeRun *newRun = [[ZAttributeRun alloc] initWithIndex:NSMaxRange(range)
- attributes:(NSDictionary*)[[_attributes lastObject] attributes]];
+ attributes:(NSDictionary*)[(ZAttributeRun *)[_attributes lastObject] attributes]];
[_attributes addObject:newRun];
[newRun release];
}
@@ -484,7 +484,11 @@ - (NSRange)rangeOfAttributeRunsForRange:(NSRange)range {
if ([[_attributes objectAtIndex:firstAfter] index] > NSMaxRange(range)) {
// the first after is too far after, insert another run!
ZAttributeRun *newRun = [[ZAttributeRun alloc] initWithIndex:NSMaxRange(range)
+<<<<<<< HEAD
attributes:(NSDictionary*)[[_attributes objectAtIndex:firstAfter-1] attributes]];
+=======
+ attributes:[(ZAttributeRun *)[_attributes objectAtIndex:firstAfter-1] attributes]];
+>>>>>>> stable
[_attributes insertObject:newRun atIndex:firstAfter];
[newRun release];
}

0 comments on commit c6d3e74

Please sign in to comment.