113 // override the direct execution of SDL_main to allow us to implement the frontend (or even using a nib) |
113 // override the direct execution of SDL_main to allow us to implement the frontend (or even using a nib) |
114 -(void) applicationDidFinishLaunching:(UIApplication *)application { |
114 -(void) applicationDidFinishLaunching:(UIApplication *)application { |
115 [application setStatusBarHidden:YES]; |
115 [application setStatusBarHidden:YES]; |
116 |
116 |
117 UIWindow *uiwindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; |
117 UIWindow *uiwindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; |
118 uiwindow.backgroundColor = [UIColor blackColor]; |
|
119 |
118 |
120 if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) |
119 if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) |
121 self.mainViewController = [[MainMenuViewController alloc] initWithNibName:@"MainMenuViewController-iPad" bundle:nil]; |
120 self.mainViewController = [[MainMenuViewController alloc] initWithNibName:@"MainMenuViewController-iPad" bundle:nil]; |
122 else |
121 else |
123 self.mainViewController = [[MainMenuViewController alloc] initWithNibName:@"MainMenuViewController-iPhone" bundle:nil]; |
122 self.mainViewController = [[MainMenuViewController alloc] initWithNibName:@"MainMenuViewController-iPhone" bundle:nil]; |
124 |
123 |
125 [uiwindow addSubview:self.mainViewController.view]; |
124 [uiwindow addSubview:self.mainViewController.view]; |
126 [self.mainViewController release]; |
125 [self.mainViewController release]; |
|
126 uiwindow.backgroundColor = [UIColor blackColor]; |
127 [uiwindow makeKeyAndVisible]; |
127 [uiwindow makeKeyAndVisible]; |
128 |
128 |
129 // Set working directory to resource path |
129 // set working directory to resource path |
130 [[NSFileManager defaultManager] changeCurrentDirectoryPath:[[NSBundle mainBundle] resourcePath]]; |
130 [[NSFileManager defaultManager] changeCurrentDirectoryPath:[[NSBundle mainBundle] resourcePath]]; |
131 } |
131 } |
132 |
132 |
133 -(void) applicationWillTerminate:(UIApplication *)application { |
133 -(void) applicationWillTerminate:(UIApplication *)application { |
134 SDL_SendQuit(); |
134 SDL_SendQuit(); |