diff --git a/HelloWorld/ios/AppController.h b/HelloWorld/ios/AppController.h index aa839d30f6..dbbf494977 100644 --- a/HelloWorld/ios/AppController.h +++ b/HelloWorld/ios/AppController.h @@ -21,6 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ + @class RootViewController; @interface AppController : NSObject { diff --git a/HelloWorld/ios/AppController.mm b/HelloWorld/ios/AppController.mm index b05522d0e7..8281988190 100644 --- a/HelloWorld/ios/AppController.mm +++ b/HelloWorld/ios/AppController.mm @@ -72,31 +72,31 @@ static AppDelegate s_sharedApplication; Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. */ + cocos2d::CCDirector::sharedDirector()->pause(); } +- (void)applicationDidBecomeActive:(UIApplication *)application { + /* + Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + */ + cocos2d::CCDirector::sharedDirector()->resume(); +} - (void)applicationDidEnterBackground:(UIApplication *)application { /* Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. If your application supports background execution, called instead of applicationWillTerminate: when the user quits. */ + cocos2d::CCDirector::sharedDirector()->stopAnimation(); } - - (void)applicationWillEnterForeground:(UIApplication *)application { /* Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. */ + cocos2d::CCDirector::sharedDirector()->startAnimation(); } - -- (void)applicationDidBecomeActive:(UIApplication *)application { - /* - Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - */ -} - - - (void)applicationWillTerminate:(UIApplication *)application { /* Called when the application is about to terminate. @@ -122,9 +122,3 @@ static AppDelegate s_sharedApplication; @end -int main(int argc, char *argv[]) { - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - UIApplicationMain(argc, argv, nil, @"AppController"); - [pool release]; - return 0; -} diff --git a/HelloWorld/ios/HelloWorld.xcodeproj/project.pbxproj.REMOVED.git-id b/HelloWorld/ios/HelloWorld.xcodeproj/project.pbxproj.REMOVED.git-id index 778542b8eb..b368d1ae7c 100644 --- a/HelloWorld/ios/HelloWorld.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/HelloWorld/ios/HelloWorld.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -d98275a6f64d1c1068591e6d99d3f9a28c5591ac \ No newline at end of file +3bf906169e90a3e1c2fd3ee256c43d4581150d49 \ No newline at end of file diff --git a/HelloWorld/ios/RootViewController.h b/HelloWorld/ios/RootViewController.h index ab4f9cf49f..a40c2edd28 100644 --- a/HelloWorld/ios/RootViewController.h +++ b/HelloWorld/ios/RootViewController.h @@ -1,10 +1,27 @@ -// -// RootViewController.h -// test -// -// Created by Walzer on 11-4-28. -// Copyright 2011 __MyCompanyName__. All rights reserved. -// +/**************************************************************************** + Copyright (c) 2010-2011 cocos2d-x.org + Copyright (c) 2010 Ricardo Quesada + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #import diff --git a/HelloWorld/ios/RootViewController.mm b/HelloWorld/ios/RootViewController.mm index 7904cd4670..90d9a0941c 100644 --- a/HelloWorld/ios/RootViewController.mm +++ b/HelloWorld/ios/RootViewController.mm @@ -1,10 +1,27 @@ - // -// RootViewController.mm -// test -// -// Created by Walzer on 11-4-28. -// Copyright 2011 __MyCompanyName__. All rights reserved. -// +/**************************************************************************** + Copyright (c) 2010-2011 cocos2d-x.org + Copyright (c) 2010 Ricardo Quesada + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #import "RootViewController.h" diff --git a/HelloWorld/ios/main.m b/HelloWorld/ios/main.m new file mode 100644 index 0000000000..bd577a036e --- /dev/null +++ b/HelloWorld/ios/main.m @@ -0,0 +1,17 @@ +// +// main.m +// iphone +// +// Created by Walzer on 10-11-16. +// Copyright 2010 __MyCompanyName__. All rights reserved. +// + +#import + +int main(int argc, char *argv[]) { + + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + int retVal = UIApplicationMain(argc, argv, nil, @"AppController"); + [pool release]; + return retVal; +} diff --git a/cocos2dx/platform/wophone/CCFileUtils_wophone.cpp b/cocos2dx/platform/wophone/CCFileUtils_wophone.cpp index da4caf0309..b891a1254d 100644 --- a/cocos2dx/platform/wophone/CCFileUtils_wophone.cpp +++ b/cocos2dx/platform/wophone/CCFileUtils_wophone.cpp @@ -55,8 +55,12 @@ bool isResourceExist(const char* pszResName) CC_BREAK_IF(nPos != UNZ_OK); bRet = true; - unzClose(pZipFile); + } while (0); + if (pZipFile) + { + unzClose(pZipFile); + } } else {