From 8fc5a2beef037ba07a18d325b2ff6dff205bfaf1 Mon Sep 17 00:00:00 2001 From: chsieh Date: Mon, 18 Apr 2011 23:01:02 -0700 Subject: [PATCH] Adding comments. --- Littlest.xcodeproj/project.pbxproj | 1 + Littlest/AppDelegate.h | 4 ++-- Littlest/AppDelegate.mm | 23 ++++++++++++++++------- Littlest/HelloWorldLayer.h | 4 ++-- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/Littlest.xcodeproj/project.pbxproj b/Littlest.xcodeproj/project.pbxproj index cb6088e..16a40b3 100644 --- a/Littlest.xcodeproj/project.pbxproj +++ b/Littlest.xcodeproj/project.pbxproj @@ -1432,6 +1432,7 @@ 4B8CC18F135BFDF900B3E49F /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/Littlest/AppDelegate.h b/Littlest/AppDelegate.h index 6e47755..cb3d749 100644 --- a/Littlest/AppDelegate.h +++ b/Littlest/AppDelegate.h @@ -11,8 +11,8 @@ @class RootViewController; @interface AppDelegate : NSObject { - UIWindow *window; - RootViewController *viewController; + UIWindow* window; + RootViewController* viewController; } @property (nonatomic, retain) UIWindow *window; diff --git a/Littlest/AppDelegate.mm b/Littlest/AppDelegate.mm index 14c04c4..440ebf5 100644 --- a/Littlest/AppDelegate.mm +++ b/Littlest/AppDelegate.mm @@ -63,16 +63,16 @@ // // EAGLView *glView = [EAGLView viewWithFrame:[window bounds] - pixelFormat:kEAGLColorFormatRGB565 // kEAGLColorFormatRGBA8 - depthFormat:0 // GL_DEPTH_COMPONENT16_OES - ]; + pixelFormat:kEAGLColorFormatRGBA8 + depthFormat:0 // GL_DEPTH_COMPONENT16_OES + ]; // attach the openglView to the director [director setOpenGLView:glView]; -// // Enables High Res mode (Retina Display) on iPhone 4 and maintains low res on all other devices -// if( ! [director enableRetinaDisplay:YES] ) -// CCLOG(@"Retina Display Not supported"); + // Enables High Res mode (Retina Display) on iPhone 4 and maintains low res on all other devices + //if( ! [director enableRetinaDisplay:YES] ) + // CCLOG(@"Retina Display Not supported"); // // VERY IMPORTANT: @@ -96,9 +96,10 @@ // make the OpenGLView a child of the view controller [viewController setView:glView]; - // make the View Controller a child of the main window + // make the View in the View Controller a child of the main window [window addSubview: viewController.view]; + // this also lets the system know that we're ready to handle events [window makeKeyAndVisible]; // Default texture format for PNG/BMP/TIFF/JPEG/GIF images @@ -115,26 +116,32 @@ } +// Pausing - (void)applicationWillResignActive:(UIApplication *)application { [[CCDirector sharedDirector] pause]; } +// Resuming - (void)applicationDidBecomeActive:(UIApplication *)application { [[CCDirector sharedDirector] resume]; } +// Low on memory - (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { [[CCDirector sharedDirector] purgeCachedData]; } +// Alt-tabbed out? Update but don't render? -(void) applicationDidEnterBackground:(UIApplication*)application { [[CCDirector sharedDirector] stopAnimation]; } +// Alt-tabbed in? -(void) applicationWillEnterForeground:(UIApplication*)application { [[CCDirector sharedDirector] startAnimation]; } +// Killing - (void)applicationWillTerminate:(UIApplication *)application { CCDirector *director = [CCDirector sharedDirector]; @@ -147,10 +154,12 @@ [director end]; } +// What's this? - (void)applicationSignificantTimeChange:(UIApplication *)application { [[CCDirector sharedDirector] setNextDeltaTimeZero:YES]; } +// Killed - (void)dealloc { [[CCDirector sharedDirector] release]; [window release]; diff --git a/Littlest/HelloWorldLayer.h b/Littlest/HelloWorldLayer.h index ca00e03..1eb1fc8 100644 --- a/Littlest/HelloWorldLayer.h +++ b/Littlest/HelloWorldLayer.h @@ -15,8 +15,8 @@ // HelloWorldLayer @interface HelloWorldLayer : CCLayer { - b2World* world; - GLESDebugDraw *m_debugDraw; + b2World* world; + GLESDebugDraw* m_debugDraw; } // returns a CCScene that contains the HelloWorldLayer as the only child -- 1.7.0.4