Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
minggo committed Jun 24, 2011
2 parents d032e31 + d789d25 commit 525950f
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 31 deletions.
1 change: 1 addition & 0 deletions HelloWorld/ios/AppController.h
Expand Up @@ -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 <UIAccelerometerDelegate, UIAlertViewDelegate, UITextFieldDelegate,UIApplicationDelegate> {
Expand Down
24 changes: 9 additions & 15 deletions HelloWorld/ios/AppController.mm
Expand Up @@ -72,31 +72,31 @@ - (void)applicationWillResignActive:(UIApplication *)application {
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.
Expand All @@ -122,9 +122,3 @@ - (void)dealloc {

@end

int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
UIApplicationMain(argc, argv, nil, @"AppController");
[pool release];
return 0;
}
@@ -1 +1 @@
d98275a6f64d1c1068591e6d99d3f9a28c5591ac
3bf906169e90a3e1c2fd3ee256c43d4581150d49
31 changes: 24 additions & 7 deletions 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 <UIKit/UIKit.h>

Expand Down
31 changes: 24 additions & 7 deletions 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"

Expand Down
17 changes: 17 additions & 0 deletions 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 <UIKit/UIKit.h>

int main(int argc, char *argv[]) {

NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, @"AppController");
[pool release];
return retVal;
}
6 changes: 5 additions & 1 deletion cocos2dx/platform/wophone/CCFileUtils_wophone.cpp
Expand Up @@ -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
{
Expand Down

0 comments on commit 525950f

Please sign in to comment.