Permalink
Browse files

Mac: added Mac templates.

Also added cocos2d icon to Mac tests
  • Loading branch information...
1 parent 8c90657 commit cfdc5d64cd769dc801b12cfd58be4b2f411d27be @ricardoquesada ricardoquesada committed Nov 25, 2010
Showing with 5,819 additions and 9 deletions.
  1. +3 −0 CHANGELOG
  2. +1 −1 Resources-Mac/cocos2d_mac-Info.plist
  3. BIN Resources-Mac/icon.icns
  4. +26 −0 cocos2d-mac.xcodeproj/project.pbxproj
  5. +27 −3 install-templates.sh
  6. +1 −1 templates/cocos2d_app/___PROJECTNAME___.xcodeproj/TemplateInfo.plist
  7. +1 −0 templates/cocos2d_app/libs/README
  8. +1 −1 templates/cocos2d_box2d_app/___PROJECTNAME___.xcodeproj/TemplateInfo.plist
  9. +1 −1 templates/cocos2d_chipmunk_app/___PROJECTNAME___.xcodeproj/TemplateInfo.plist
  10. +21 −0 templates/cocos2d_mac/Classes/HelloWorldScene.h
  11. +62 −0 templates/cocos2d_mac/Classes/HelloWorldScene.m
  12. +20 −0 templates/cocos2d_mac/Classes/___PROJECTNAMEASIDENTIFIER___AppDelegate.h
  13. +39 −0 templates/cocos2d_mac/Classes/___PROJECTNAMEASIDENTIFIER___AppDelegate.m
  14. +17 −0 templates/cocos2d_mac/Classes/main.m
  15. +23 −0 templates/cocos2d_mac/LICENSE.cocos2d
  16. +21 −0 templates/cocos2d_mac/LICENSE.cocosdenshion
  17. +2 −0 templates/cocos2d_mac/Resources/English.lproj/InfoPlist.strings
  18. +4,307 −0 templates/cocos2d_mac/Resources/English.lproj/MainMenu.xib
  19. +32 −0 templates/cocos2d_mac/Resources/Info.plist
  20. +7 −0 templates/cocos2d_mac/Resources/___PROJECTNAMEASIDENTIFIER____Prefix.pch
  21. BIN templates/cocos2d_mac/Resources/fps_images.png
  22. BIN templates/cocos2d_mac/Resources/icon.icns
  23. +8 −0 templates/cocos2d_mac/___PROJECTNAMEASIDENTIFIER____Prefix.pch
  24. BIN templates/cocos2d_mac/___PROJECTNAME___.xcodeproj/TemplateIcon.icns
  25. +8 −0 templates/cocos2d_mac/___PROJECTNAME___.xcodeproj/TemplateInfo.plist
  26. +1,175 −0 templates/cocos2d_mac/___PROJECTNAME___.xcodeproj/project.pbxproj
  27. +16 −0 templates/cocos2d_mac/main.m
  28. +0 −2 tests/Texture2dTest.m
View
@@ -1,11 +1,14 @@
version 0.99.5 - xx-Dec-2010
+. [NEW-MAC] Added Mac templates
. [FIX] Camera: uses points intead of pixels. Works OK in RetinaDisplay mode (issue #1023)
. [FIX] Configuration: checks for possible glErrors. Only ask for max samples if iOS >= 4 (issue #1041)
. [FIX] FileUtils: loads .gz / .ccz files correctly in RetinaDisplay mode (issue #1037)
. [FIX] FileUtils: fixed big memory leaks on .ccz inflater
. [FIX] Sprite: updateTransform can be overriden (issue #824)
. [FIX-MAC] Display Link thread: async images works as expected. Enabled by default.
. [TEST] Added Glyph Designer test case
+. [TEST-MAC] Added cocos2d icon to Mac tests
+
version 0.99.5-rc1 - 15-Nov-2010
. [NEW] Director: setProjection calls "updateProjection" delegate if "custom" projection is used
@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
- <string></string>
+ <string>icon</string>
<key>CFBundleIdentifier</key>
<string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
View
Binary file not shown.
@@ -35,6 +35,18 @@
E01E6A3E121EDCD3001A484F /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E01E6A3D121EDCD3001A484F /* ApplicationServices.framework */; };
E01E6B36121EDCED001A484F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E036A79E121B5C870037C5C6 /* QuartzCore.framework */; };
E01E6B49121EDCF4001A484F /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E036A79C121B5C720037C5C6 /* OpenGL.framework */; };
+ E02A8538129F11BF00341C97 /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = E02A8537129F11BF00341C97 /* icon.icns */; };
+ E02A8539129F11BF00341C97 /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = E02A8537129F11BF00341C97 /* icon.icns */; };
+ E02A853A129F11BF00341C97 /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = E02A8537129F11BF00341C97 /* icon.icns */; };
+ E02A853B129F11BF00341C97 /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = E02A8537129F11BF00341C97 /* icon.icns */; };
+ E02A853C129F11BF00341C97 /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = E02A8537129F11BF00341C97 /* icon.icns */; };
+ E02A853D129F11BF00341C97 /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = E02A8537129F11BF00341C97 /* icon.icns */; };
+ E02A853E129F11BF00341C97 /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = E02A8537129F11BF00341C97 /* icon.icns */; };
+ E02A853F129F11BF00341C97 /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = E02A8537129F11BF00341C97 /* icon.icns */; };
+ E02A8540129F11BF00341C97 /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = E02A8537129F11BF00341C97 /* icon.icns */; };
+ E02A8541129F11BF00341C97 /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = E02A8537129F11BF00341C97 /* icon.icns */; };
+ E02A8542129F11BF00341C97 /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = E02A8537129F11BF00341C97 /* icon.icns */; };
+ E02A8543129F11BF00341C97 /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = E02A8537129F11BF00341C97 /* icon.icns */; };
E02BBC7D126CD870006E46A2 /* CCAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = E02BBC79126CD870006E46A2 /* CCAnimation.m */; };
E02BBC7E126CD870006E46A2 /* CCAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = E02BBC7A126CD870006E46A2 /* CCAnimation.h */; };
E02BBC7F126CD870006E46A2 /* CCAnimationCache.m in Sources */ = {isa = PBXBuildFile; fileRef = E02BBC7B126CD870006E46A2 /* CCAnimationCache.m */; };
@@ -3054,6 +3066,7 @@
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
E01E663D121CA00A001A484F /* libcocos2d.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libcocos2d.a; sourceTree = BUILT_PRODUCTS_DIR; };
E01E6A3D121EDCD3001A484F /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = System/Library/Frameworks/ApplicationServices.framework; sourceTree = SDKROOT; };
+ E02A8537129F11BF00341C97 /* icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = icon.icns; path = "Resources-Mac/icon.icns"; sourceTree = "<group>"; };
E02BBC79126CD870006E46A2 /* CCAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCAnimation.m; sourceTree = "<group>"; };
E02BBC7A126CD870006E46A2 /* CCAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCAnimation.h; sourceTree = "<group>"; };
E02BBC7B126CD870006E46A2 /* CCAnimationCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCAnimationCache.m; sourceTree = "<group>"; };
@@ -3741,6 +3754,7 @@
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
+ E02A8537129F11BF00341C97 /* icon.icns */,
E076EB2E1225EFF200DE0DA2 /* MainMenu.xib */,
E076EAE81225EE8500DE0DA2 /* cocos2d_mac-Info.plist */,
E076EAED1225EE8500DE0DA2 /* main.m */,
@@ -4977,6 +4991,7 @@
E05053F1122D5AE6005B74CB /* TileMaps in Resources */,
E05053F2122D5AE6005B74CB /* zwoptex in Resources */,
E05053F3122D5AE6005B74CB /* MainMenu.xib in Resources */,
+ E02A853C129F11BF00341C97 /* icon.icns in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -5193,6 +5208,7 @@
E076EAE31225EE2B00DE0DA2 /* zwoptex in Resources */,
E076EB301225EFF200DE0DA2 /* MainMenu.xib in Resources */,
E05052B2122D5655005B74CB /* fps_images.png in Resources */,
+ E02A853F129F11BF00341C97 /* icon.icns in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -5409,6 +5425,7 @@
E076EAE61225EE2B00DE0DA2 /* TileMaps in Resources */,
E076EAE71225EE2B00DE0DA2 /* zwoptex in Resources */,
E076EB311225EFF200DE0DA2 /* MainMenu.xib in Resources */,
+ E02A8539129F11BF00341C97 /* icon.icns in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -5625,6 +5642,7 @@
E076EC501225F82200DE0DA2 /* TileMaps in Resources */,
E076EC511225F82200DE0DA2 /* zwoptex in Resources */,
E076EC521225F82200DE0DA2 /* MainMenu.xib in Resources */,
+ E02A853A129F11BF00341C97 /* icon.icns in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -5843,6 +5861,7 @@
E076ED9D1225FDE300DE0DA2 /* MainMenu.xib in Resources */,
E0D44F3A1291BFFB0094708A /* test_image_rgba4444.pvr.ccz in Resources */,
E0D44F3B1291BFFB0094708A /* test_image_rgba4444.pvr.gz in Resources */,
+ E02A8538129F11BF00341C97 /* icon.icns in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -6060,6 +6079,7 @@
E076F20A12268A9800DE0DA2 /* zwoptex in Resources */,
E076F20B12268A9800DE0DA2 /* MainMenu.xib in Resources */,
E0D2D560128CB06A00F78C63 /* piece.png in Resources */,
+ E02A853B129F11BF00341C97 /* icon.icns in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -6276,6 +6296,7 @@
E0AC06951228021600EFA814 /* TileMaps in Resources */,
E0AC06961228021600EFA814 /* zwoptex in Resources */,
E0AC06971228021600EFA814 /* MainMenu.xib in Resources */,
+ E02A8543129F11BF00341C97 /* icon.icns in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -6492,6 +6513,7 @@
E0AC0789122803BC00EFA814 /* TileMaps in Resources */,
E0AC078A122803BC00EFA814 /* zwoptex in Resources */,
E0AC078B122803BC00EFA814 /* MainMenu.xib in Resources */,
+ E02A8541129F11BF00341C97 /* icon.icns in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -6714,6 +6736,7 @@
E0C60680128ECC110099367C /* konqa32.png in Resources */,
E0C60681128ECC110099367C /* larabie-16-hd.png in Resources */,
E0C60682128ECC110099367C /* larabie-16.png in Resources */,
+ E02A853E129F11BF00341C97 /* icon.icns in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -6930,6 +6953,7 @@
E0B92DBC1226A0C9003FF67E /* TileMaps in Resources */,
E0B92DBD1226A0C9003FF67E /* zwoptex in Resources */,
E0B92DBE1226A0C9003FF67E /* MainMenu.xib in Resources */,
+ E02A853D129F11BF00341C97 /* icon.icns in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -7146,6 +7170,7 @@
E0B92EE51226A621003FF67E /* TileMaps in Resources */,
E0B92EE61226A621003FF67E /* zwoptex in Resources */,
E0B92EE71226A621003FF67E /* MainMenu.xib in Resources */,
+ E02A8540129F11BF00341C97 /* icon.icns in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -7362,6 +7387,7 @@
E0B92FF71226C0DD003FF67E /* TileMaps in Resources */,
E0B92FF81226C0DD003FF67E /* zwoptex in Resources */,
E0B92FF91226C0DD003FF67E /* MainMenu.xib in Resources */,
+ E02A8542129F11BF00341C97 /* icon.icns in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
@@ -69,6 +69,14 @@ check_dst_dir(){
mkdir -p "$DST_DIR"
}
+copy_base_mac_files(){
+ echo ...copying cocos2d files
+ copy_files cocos2d "$LIBS_DIR"
+
+ echo ...copying CocosDenshion files
+ copy_files CocosDenshion "$LIBS_DIR"
+}
+
copy_base_files(){
echo ...copying cocos2d files
copy_files cocos2d "$LIBS_DIR"
@@ -109,7 +117,7 @@ copy_project_templates(){
mkdir -p "$TEMPLATE_DIR"
fi
- print_template_banner "Installing cocos2d template"
+ print_template_banner "Installing cocos2d iOS template"
DST_DIR="$TEMPLATE_DIR""cocos2d Application/"
LIBS_DIR="$DST_DIR"libs
@@ -123,7 +131,7 @@ copy_project_templates(){
echo done!
- print_template_banner "Installing cocos2d + box2d template"
+ print_template_banner "Installing cocos2d iOS + box2d template"
DST_DIR="$TEMPLATE_DIR""cocos2d Box2d Application/"
LIBS_DIR="$DST_DIR"libs
@@ -141,7 +149,7 @@ copy_project_templates(){
echo done!
- print_template_banner "Installing cocos2d + chipmunk template"
+ print_template_banner "Installing cocos2d iOS + chipmunk template"
DST_DIR="$TEMPLATE_DIR""cocos2d Chipmunk Application/"
LIBS_DIR="$DST_DIR"libs
@@ -157,6 +165,20 @@ copy_project_templates(){
copy_files external/Chipmunk "$LIBS_DIR"
echo done!
+
+ print_template_banner "Installing cocos2d Mac template"
+
+ DST_DIR="$TEMPLATE_DIR""cocos2d Application - Mac/"
+ LIBS_DIR="$DST_DIR"libs
+
+ check_dst_dir
+
+ echo ...copying template files
+ copy_files templates/cocos2d_mac/ "$DST_DIR"
+
+ copy_base_mac_files
+
+ echo done!
}
copy_file_templates(){
@@ -166,6 +188,8 @@ copy_file_templates(){
TEMPLATE_DIR="${BASE_TEMPLATE_DIR}/File Templates/${COCOS2D_VER}/"
fi
+ echo ...copying file templates
+
DST_DIR="$TEMPLATE_DIR"
check_dst_dir
@@ -3,6 +3,6 @@
<plist version="1.0">
<dict>
<key>Description</key>
- <string>This template provides a starting point for an application that uses the cocos2d-iphone framework.</string>
+ <string>This template provides a starting point for an application that uses cocos2d for iOS.</string>
</dict>
</plist>
@@ -0,0 +1 @@
+This directory contains the libraries used in cocos2d
@@ -3,6 +3,6 @@
<plist version="1.0">
<dict>
<key>Description</key>
- <string>This template provides a starting point for an application that uses the cocos2d-iphone framework and the Box2d physics library.</string>
+ <string>This template provides a starting point for an application that uses cocos2d iOS and Box2d.</string>
</dict>
</plist>
@@ -3,6 +3,6 @@
<plist version="1.0">
<dict>
<key>Description</key>
- <string>This template provides a starting point for an application that uses the cocos2d-iphone framework and the Chipmunk physics library.</string>
+ <string>This template provides a starting point for an application that uses cocos2d iOS and Chipmunk.</string>
</dict>
</plist>
@@ -0,0 +1,21 @@
+//
+// HelloWorldLayer.h
+// ___PROJECTNAME___
+//
+// Created by ___FULLUSERNAME___ on ___DATE___.
+// Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
+//
+
+
+// When you import this file, you import all the cocos2d classes
+#import "cocos2d.h"
+
+// HelloWorld Layer
+@interface HelloWorld : CCLayer
+{
+}
+
+// returns a Scene that contains the HelloWorld as the only child
++(id) scene;
+
+@end
@@ -0,0 +1,62 @@
+//
+// HelloWorldLayer.m
+// ___PROJECTNAME___
+//
+// Created by ___FULLUSERNAME___ on ___DATE___.
+// Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
+//
+
+// Import the interfaces
+#import "HelloWorldScene.h"
+
+// HelloWorld implementation
+@implementation HelloWorld
+
++(id) scene
+{
+ // 'scene' is an autorelease object.
+ CCScene *scene = [CCScene node];
+
+ // 'layer' is an autorelease object.
+ HelloWorld *layer = [HelloWorld node];
+
+ // add layer as a child to scene
+ [scene addChild: layer];
+
+ // return the scene
+ return scene;
+}
+
+// on "init" you need to initialize your instance
+-(id) init
+{
+ // always call "super" init
+ // Apple recommends to re-assign "self" with the "super" return value
+ if( (self=[super init] )) {
+
+ // create and initialize a Label
+ CCLabelTTF *label = [CCLabelTTF labelWithString:@"Hello World" fontName:@"Marker Felt" fontSize:64];
+
+ // ask director the the window size
+ CGSize size = [[CCDirector sharedDirector] winSize];
+
+ // position the label on the center of the screen
+ label.position = ccp( size.width /2 , size.height/2 );
+
+ // add the label as a child to this Layer
+ [self addChild: label];
+ }
+ return self;
+}
+
+// on "dealloc" you need to release all your retained objects
+- (void) dealloc
+{
+ // in case you have something to dealloc, do it in this method
+ // in this particular example nothing needs to be released.
+ // cocos2d will automatically release all the children (Label)
+
+ // don't forget to call "super dealloc"
+ [super dealloc];
+}
+@end
@@ -0,0 +1,20 @@
+//
+// ___PROJECTNAMEASIDENTIFIER___AppDelegate.h
+// ___PROJECTNAME___
+//
+// Created by ___FULLUSERNAME___ on ___DATE___.
+// Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
+//
+
+#import "cocos2d.h"
+
+@interface ___PROJECTNAMEASIDENTIFIER___AppDelegate : NSObject <NSApplicationDelegate>
+{
+ NSWindow *window_;
+ MacGLView *glView_;
+}
+
+@property (assign) IBOutlet NSWindow *window;
+@property (assign) IBOutlet MacGLView *glView;
+
+@end
@@ -0,0 +1,39 @@
+//
+// ___PROJECTNAMEASIDENTIFIER___AppDelegate.m
+// ___PROJECTNAME___
+//
+// Created by ___FULLUSERNAME___ on ___DATE___.
+// Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
+//
+
+#import "___PROJECTNAMEASIDENTIFIER___AppDelegate.h"
+#import "HelloWorldScene.h"
+
+@implementation ___PROJECTNAMEASIDENTIFIER___AppDelegate
+@synthesize window=window_, glView=glView_;
+
+- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
+{
+ CCDirector *director = [CCDirector sharedDirector];
+
+ [director setDisplayFPS:YES];
+
+ [director setOpenGLView:glView_];
+
+// [director setProjection:kCCDirectorProjection2D];
+
+ // Enable "moving" mouse event. Default no.
+ [window_ setAcceptsMouseMovedEvents:NO];
+
+
+ [director runWithScene:[HelloWorld scene]];
+}
+
+- (void)dealloc
+{
+ [[CCDirector sharedDirector] release];
+ [window_ release];
+ [super dealloc];
+}
+
+@end
Oops, something went wrong.

0 comments on commit cfdc5d6

Please sign in to comment.