Permalink
Browse files

Merge branch 'release-0.2.1'

  • Loading branch information...
2 parents e42002b + fefcac1 commit 48996164f1b948b3bd000392809eca4e4de5cf9e @psineur psineur committed Apr 22, 2012
Showing with 9,666 additions and 391 deletions.
  1. +3 −0 .gitmodules
  2. +7 −1 AUTHORS.cocos2d-extensions
  3. +11 −0 CHANGELOG
  4. +4 −2 Extensions/CCBigImage/CCBigImage.h
  5. +24 −15 Extensions/CCBigImage/CCBigImage.m
  6. +2 −2 Extensions/CCBigImage/CCTextureCache+CCBigImageExtensions.h
  7. +11 −7 Extensions/CCBigImage/CCTextureCache+CCBigImageExtensions.m
  8. +1 −13 Extensions/CCBigImage/README.md
  9. +8 −4 Extensions/CCLayerPanZoom/CCLayerPanZoom.h
  10. +26 −6 Extensions/CCLayerPanZoom/CCLayerPanZoom.m
  11. +13 −11 Extensions/CCMenuAdvanced/CCMenuAdvanced.h
  12. +15 −5 Extensions/CCMenuAdvanced/CCMenuAdvanced.m
  13. +6 −5 Extensions/CCMenuAdvanced/README.md
  14. +4 −2 Extensions/CCMenuItemSpriteIndependent/CCMenuItemSpriteIndependent.h
  15. +2 −2 Extensions/CCMenuItemSpriteIndependent/CCMenuItemSpriteIndependent.m
  16. +3 −3 Extensions/CCMenuItemSpriteIndependent/README.md
  17. +38 −30 Extensions/CCScrollLayer/CCScrollLayer.h
  18. +119 −91 Extensions/CCScrollLayer/CCScrollLayer.m
  19. +4 −2 Extensions/CCSendMessages/CCSendMessages.h
  20. +1 −1 Extensions/CCSendMessages/CCSendMessages.m
  21. +11 −3 Extensions/CCSlider/CCSlider.h
  22. +19 −4 Extensions/CCSlider/CCSlider.m
  23. +24 −11 Extensions/CCVideoPlayer/CCVideoPlayer.h
  24. +16 −4 Extensions/CCVideoPlayer/CCVideoPlayer.m
  25. +2 −2 Extensions/CCVideoPlayer/Mac/CCVideoPlayerImplMac.h
  26. +20 −6 Extensions/CCVideoPlayer/Mac/CCVideoPlayerImplMac.m
  27. +2 −2 Extensions/CCVideoPlayer/Mac/MyMovieView.h
  28. +2 −2 Extensions/CCVideoPlayer/Mac/MyMovieView.m
  29. +1 −0 Extensions/CCVideoPlayer/README.md
  30. +2 −2 Extensions/CCVideoPlayer/iOS/CCVideoPlayerImpliOS.h
  31. +11 −16 Extensions/CCVideoPlayer/iOS/CCVideoPlayerImpliOS.m
  32. +2 −2 Extensions/CCVideoPlayer/iOS/videoOverlayView.h
  33. +2 −2 Extensions/CCVideoPlayer/iOS/videoOverlayView.m
  34. +4 −2 Extensions/FilesDownloader/FilesDownloader.h
  35. +1 −1 Extensions/FilesDownloader/FilesDownloader.m
  36. +4 −2 Extensions/FilesDownloader/SingleFileDownloader.h
  37. +1 −1 Extensions/FilesDownloader/SingleFileDownloader.m
  38. +6 −1 Extensions/TMXGenerator/TMXGenerator.h
  39. +4 −1 Extensions/TMXGenerator/TMXGenerator.m
  40. +4 −3 LICENSE.cocos2d-extensions
  41. +5 −2 README.md
  42. +9 −2 Tests/CCBigImageTest/CCBigImageTestLayer.m
  43. +39 −4 Tests/CCMenuAdvancedTest/CCMenuAdvancedTest.m
  44. +40 −2 Tests/CCMenuItemIndependentTest/CCMenuItemSpriteIndependentTestLayer.m
  45. +1 −23 Tests/CCScrollLayerTest/CCScrollLayerTestLayer.m
  46. +49 −15 Tests/CCVideoPlayerTest/CCVideoTestLayer.m
  47. +8 −1 Tests/FilesDownloaderTest/FilesDownloaderTestLayer.m
  48. +27 −1 Tests/FilesDownloaderTest/iTraceurProgressBar.m
  49. BIN Tests/SharedResources/fps_images.png
  50. +6 −1 Tests/SharedSources/RootViewController.h
  51. +5 −1 Tests/SharedSources/RootViewController.m
  52. +27 −2 Tests/SharedSources/cocos2d_extensions_iosAppDelegate.h
  53. +163 −1 Tests/SharedSources/cocos2d_extensions_iosAppDelegate.m
  54. +32 −7 Tests/SharedSources/cocos2d_extensions_macAppDelegate.h
  55. +47 −11 Tests/SharedSources/cocos2d_extensions_macAppDelegate.m
  56. +5 −1 Tests/SharedSources/main.m
  57. +9 −1 Tests/TMXGeneratorTest/TMXGeneratorTestLayer.m
  58. +1 −1 cocos2d
  59. +48 −24 cocos2d-extensions-ios.xcodeproj/project.pbxproj
  60. +44 −22 cocos2d-extensions-mac.xcodeproj/project.pbxproj
  61. +1 −0 cocos2d_2.x
  62. +4,547 −0 cocos2d_2.x-extensions-ios.xcodeproj/project.pbxproj
  63. +7 −0 cocos2d_2.x-extensions-ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  64. +4,099 −0 cocos2d_2.x-extensions-mac.xcodeproj/project.pbxproj
  65. +7 −0 cocos2d_2.x-extensions-mac.xcodeproj/project.xcworkspace/contents.xcworkspacedata
View
@@ -1,3 +1,6 @@
[submodule "cocos2d"]
path = cocos2d
url = git@github.com:cocos2d/cocos2d-iphone
+[submodule "cocos2d_2.x"]
+ path = cocos2d_2.x
+ url = git://github.com/cocos2d/cocos2d-iphone.git
@@ -1,4 +1,4 @@
-cocos2d for iPhone extensions authors
+Cocos2D for iPhone Extensions authors
--------------------------------------
Repo Maintainer:
@@ -9,6 +9,9 @@ People/companies who were/are contributing code to cocos2d-iphone-extensions (al
* Alexey Lang (twitter: @alexeylang)
CCLayerPanZoom author.
Issue #56 (comments & refactoring for TMXGenerator) pair programming.
+
+ * Axel Roest (twitter: @axello)
+ CCVideoPlayer patch: new method +playMovieWithPath:
* Brian Feller (http://infinitesimplicity.com/)
CCScrollLayer#moveToPage: bounds checking
@@ -44,6 +47,9 @@ People/companies who were/are contributing code to cocos2d-iphone-extensions (al
* Patrick Wolowicz (twitter: @subzero_eu) (http://blog.subzero.eu/)
CCVideoPlayer patch: preload movie, prevent flickering & hide controls when compiled on older SDKs.
+ * Ricardo Quesada (twitter: ricardoquesada) (http://cocos2d-iphone.org)
+ Pull Request #99: Initial Cocos2D-iPhone 2.x support
+
* Sapsaldog (github: @sapsaldog) (http://sapsaldog.tistory.com/)
CCScrollLayer: ability to change pages indicator color (Issue #84, Pull Request #87).
View
@@ -1,4 +1,15 @@
+0.2.1 - 22-April-2012
+ * Both 1.x/2.x Cocos2D-iPhone Support (Issue #100, Pull Request #99)
+ * Added 2.x Xcode projects for Mac/iOS that uses 2.x Engine branch
+ * New submodule: Cocos2D-iPhone 2.0-rc1 ( cocos2d_2.x/ folder )
+ * Tested with Cocos2D-iPhone 1.0, 1.1-beta2b, 2.0-rc1
+ * CCScrollLayer: compatibility with cocos2d-iphone 1.1-beta2a (Issue #97)
+ * CCScrollLayer: automatic menuItems unselection when stealTouches=YES (Sideeffect of fix for #97)
+ * CCVideoPlayer: +playMovieWithPath ( Pull Requests #101 & #102 )
+ * CCBigImage doesn't change default pixel format anymore
+ * Versions of extensions in Copyrights and Javadoc
+
0.2 - 09-November-2011
* New Extension: CCLayerPanZoom (iOS Only)
* New Extension: TMXGenerator.
@@ -1,7 +1,7 @@
/*
- * CCBigImage - Dynamic Tiled Node for holding Large Images
+ * CCBigImage
*
- * cocos2d-extensions
+ * Cocos2D-iPhone-Extensions v0.2.1
* https://github.com/cocos2d/cocos2d-iphone-extensions
*
* Copyright (c) 2010-2011 Stepan Generalov
@@ -48,6 +48,8 @@
* rendered to increase performance.
*
* LIMITATIONS: CCCamera may be not supported.
+ *
+ * @version 0.2.1
*/
@interface CCBigImage : CCNode
{
@@ -1,10 +1,10 @@
/*
- * CCBigImage - Dynamic Tiled Node for holding Large Images
+ * CCBigImage
*
- * cocos2d-extensions
+ * Cocos2D-iPhone-Extensions v0.2.1
* https://github.com/cocos2d/cocos2d-iphone-extensions
*
- * Copyright (c) 2010-2011 Stepan Generalov
+ * Copyright (c) 2010-2012 Stepan Generalov
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -95,14 +95,22 @@ -(void) visit
if (!visible_)
return;
+#if COCOS2D_VERSION >= 0x00020000
+ kmGLPushMatrix();
+#else
glPushMatrix();
+#endif
[self transform];
- [self.sprite visit];
-
+ [self.sprite visit];
+#if COCOS2D_VERSION >= 0x00020000
+ kmGLPopMatrix();
+#else
glPopMatrix();
+#endif
+
}
- (CGRect) boundingBox
@@ -122,10 +130,7 @@ - (void) dealloc
- (void) loadedTexture: (CCTexture2D *) aTex
{
-
[aTex setAntiAliasTexParameters];
- //[aTex setMipMapTexParameters];
-
//create sprite, position it and at to self
self.sprite = [[ [CCSprite alloc] initWithTexture: aTex] autorelease];
@@ -142,15 +147,11 @@ - (void) unload
self.sprite = nil;
}
-
- (void) load
{
if (self.sprite)
return; //< already loaded
- [CCTexture2D setDefaultAlphaPixelFormat:kTexture2DPixelFormat_RGBA4444];
-
-
if ([NSThread currentThread] != [[CCDirector sharedDirector] runningThread] )
{
// _cmd called in other thread - load safely
@@ -163,7 +164,6 @@ - (void) load
// _cmd called in cocos thread - load now
[self loadedTexture: [[CCTextureCache sharedTextureCache] addImage: _imageName ] ];
}
-
}
@end
@@ -259,7 +259,12 @@ - (id) initWithTilesFile: (NSString *) filename
self.dynamicMode = YES;
#endif
- NSString *path = [CCFileUtils fullPathFromRelativePath: filename];
+#if COCOS2D_VERSION >= 0x00020000
+ NSString *path = [[CCFileUtils sharedFileUtils] fullPathFromRelativePath: filename];
+#else
+ NSString *path = [CCFileUtils fullPathFromRelativePath: filename];
+#endif
+
[self prepareTilesWithFile: path extension: extension z: tilesZ ];
if (!self.dynamicMode)
@@ -479,15 +484,19 @@ - (void) stopTilesLoadingThread
- (void) updateLoadRect
{
// get screen rect
- CGRect screenRect = CGRectZero;;
+ CGRect screenRect = CGRectZero;
screenRect.size = [[CCDirector sharedDirector] winSize];
+#if COCOS2D_VERSION < 0x00020000
screenRect.size.width *= CC_CONTENT_SCALE_FACTOR();
screenRect.size.height *= CC_CONTENT_SCALE_FACTOR();
+#endif
screenRect = CGRectApplyAffineTransform(screenRect, [self worldToNodeTransform] );
+#if COCOS2D_VERSION < 0x00020000
screenRect.origin = ccpMult(screenRect.origin, 1/CC_CONTENT_SCALE_FACTOR() );
screenRect.size.width /= CC_CONTENT_SCALE_FACTOR();
screenRect.size.height /= CC_CONTENT_SCALE_FACTOR();
+#endif
// get level's must-be-loaded-part rect
_loadedRect = CGRectMake(screenRect.origin.x - _screenLoadRectExtension.width,
@@ -1,7 +1,7 @@
/*
- * CCBigImage - Dynamic Tiled Node for holding Large Images
+ * CCBigImage
*
- * cocos2d-extensions
+ * Cocos2D-iPhone-Extensions v0.2.1
* https://github.com/cocos2d/cocos2d-iphone-extensions
*
* Copyright (c) 2010-2011 Stepan Generalov
@@ -1,10 +1,10 @@
/*
- * CCBigImage - Dynamic Tiled Node for holding Large Images
+ * CCBigImage
*
- * cocos2d-extensions
+ * Cocos2D-iPhone-Extensions v0.2.1
* https://github.com/cocos2d/cocos2d-iphone-extensions
*
- * Copyright (c) 2010-2011 Stepan Generalov
+ * Copyright (c) 2010-2012 Stepan Generalov
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -28,6 +28,7 @@
#import "CCTextureCache+CCBigImageExtensions.h"
+#if COCOS2D_VERSION < 0x00020000
@interface CCAsyncObject : NSObject
{
@@ -46,24 +47,27 @@ -(void) addImageWithAsyncObject:(CCAsyncObject*)async;
@end
-
+#endif
@implementation CCTextureCache (iTraceurDynamicTiles)
-(void) addImageFromAnotherThreadWithName: (NSString*) filename target:(id)target selector:(SEL)selector
{
NSAssert(filename != nil, @"TextureCache: fileimage MUST not be nill");
- // load here async
-
+ // load here async
+#if COCOS2D_VERSION >= 0x00020000
+ [self addImageAsync:filename target:target selector:selector];
+#else
CCAsyncObject *asyncObject = [[ CCAsyncObject alloc] init];
asyncObject.selector = selector;
asyncObject.target = target;
asyncObject.data = filename;
-
[self addImageWithAsyncObject: asyncObject];
[asyncObject release];
+#endif
+
}
@end
@@ -34,16 +34,4 @@ Just execute it in folder with png's and it will compress them all to RGBA4444 p
CCMenuAdvancedTest uses pvr.ccz now. Cause with png it was too long to build.
Compressed tiles in 8e67e772174ba57536380fc7bebf19cb88194f9a
-Replaced all 'png' with 'pvr.ccz' in 072fdd4d621902c22f13254e81bb850f90405450
-
-Quality
---------------------------------------------------
-As mentioned above, it is recommended to use pvr.ccz instead of png.
-However, if you use png - you may notice some quality issues, due to RGBA4444
-set as default texture format in UnloadableSpriteNode#load:
-
- [CCTexture2D setDefaultAlphaPixelFormat:kTexture2DPixelFormat_RGBA4444];
-
-You may comment this line, but it's recommended to keep it, to save memory.
-But the best will be to use pvr.ccz (you can use RGBA4444 format with dithering -
-that will give you best quality while saving memory).
+Replaced all 'png' with 'pvr.ccz' in 072fdd4d621902c22f13254e81bb850f90405450
@@ -1,10 +1,11 @@
/*
- * CCLayerPanZoom Tests
+ * CCLayerPanZoom
*
- * cocos2d-extensions
+ * Cocos2D-iPhone-Extensions v0.2.1
* https://github.com/cocos2d/cocos2d-iphone-extensions
*
* Copyright (c) 2011 Alexey Lang
+ * Copyright (c) 2011-2012 Stepan Generalov
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -61,8 +62,11 @@ typedef enum
@end
-/** @class CCLayerPanZoom Class that represents the layer that can be scrolled
- * and zoomed with one or two fingers. */
+/** @class CCLayerPanZoom Represents the layer that can be scrolled
+ * and zoomed with one or two fingers.
+ *
+ * @version 0.2.1
+ */
@interface CCLayerPanZoom : CCLayer
{
CGFloat _maxScale;
@@ -1,10 +1,11 @@
/*
- * CCLayerPanZoom Tests
+ * CCLayerPanZoom
*
- * cocos2d-extensions
+ * Cocos2D-iPhone-Extensions v0.2.1
* https://github.com/cocos2d/cocos2d-iphone-extensions
*
* Copyright (c) 2011 Alexey Lang
+ * Copyright (c) 2011-2012 Stepan Generalov
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -64,7 +65,11 @@ @implementation CCLayerPanZoomDebugLines
- (void) draw
{
+#if COCOS2D_VERSION >= 0x00020000
+ ccDrawColor4F(1.0f, 0.0f, 0.0f, 1.0);
+#else
glColor4f(1.0f, 0.0f, 0.0f, 1.0);
+#endif
glLineWidth(2.0f);
ccDrawLine(ccp(self.leftFrameMargin, 0.0f),
ccp(self.leftFrameMargin, self.contentSize.height));
@@ -180,7 +185,11 @@ - (id) init
{
if ((self = [super init]))
{
+#if COCOS2D_VERSION >= 0x00020000
+ self.ignoreAnchorPointForPosition = NO;
+#else
self.isRelativeAnchorPoint = YES;
+#endif
self.isTouchEnabled = YES;
self.maxScale = 3.0f;
@@ -393,14 +402,25 @@ - (void) update: (ccTime) dt
- (void) onEnter
{
[super onEnter];
- [[CCScheduler sharedScheduler] scheduleUpdateForTarget: self
- priority: 0
- paused: NO];
+
+#if COCOS2D_VERSION >= 0x00020000
+ CCScheduler *scheduler = [[CCDirector sharedDirector] scheduler];
+#else
+ CCScheduler *scheduler = [CCScheduler sharedScheduler];
+#endif
+
+ [scheduler scheduleUpdateForTarget: self priority: 0 paused: NO];
}
- (void) onExit
{
- [[CCScheduler sharedScheduler] unscheduleAllSelectorsForTarget: self];
+#if COCOS2D_VERSION >= 0x00020000
+ CCScheduler *scheduler = [[CCDirector sharedDirector] scheduler];
+#else
+ CCScheduler *scheduler = [CCScheduler sharedScheduler];
+#endif
+
+ [scheduler unscheduleAllSelectorsForTarget: self];
[super onExit];
}
@@ -1,10 +1,10 @@
/*
* CCMenuAdvanced
*
- * cocos2d-extensions
+ * Cocos2D-iPhone-Extensions v0.2.1
* https://github.com/cocos2d/cocos2d-iphone-extensions
*
- * Copyright (c) 2011 Stepan Generalov
+ * Copyright (c) 2011-2012 Stepan Generalov
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -36,16 +36,18 @@
@end
-/** @class CCMenuAdvanced CCMenu with some aditional features.
+/** @class CCMenuAdvanced CCMenu with some aditional features:
+ * 1) Selecting and activating CCMenuItems with Keyboard
+ * (by default next/prev bindings aren't set - set them manually or use one of align methods to bind arrows for this).
+ * 2) One of CCMenuItems can be set as escapeDelegate - so it will be activated by pressing escape
+ * 3) align left->right, right->left, bottom->top, top->bottom with autosetting self contentSize
+ * 4) externalBoundsRect - if it is set then menu items will be scrollable inside these bounds
+ * 5) priority property - must be set before onEnter to make it register with that priority
*
- * 1) Selecting and activating CCMenuItems with Keyboard
- * (by default next/prev bindings aren't set - set them manually or use one of align methods to bind arrows for this).
- * 2) One of CCMenuItems can be set as escapeDelegate - so it will be activated by pressing escape
- * 3) align left->right, right->left, bottom->top, top->bottom with autosetting self contentSize
- * 4) externalBoundsRect - if it is set then menu items will be scrollable inside these bounds
- * 5) priority property - must be set before onEnter to make it register with that priority
- * @todo [v0.2] add columns and rows alignment methods
-*/
+ * @todo Add columns and rows alignment methods
+ *
+ * @version 0.2.1
+ */
@interface CCMenuAdvanced : CCMenu
{
NSInteger priority_;
Oops, something went wrong.

0 comments on commit 4899616

Please sign in to comment.