cocoaTouch/SDLOverrides/SDL_uikitappdelegate.m
changeset 3305 91074496d5c9
parent 3270 9bd8fb1707b9
child 3316 52f0482b043f
equal deleted inserted replaced
3304:8690a3aa93b5 3305:91074496d5c9
    77 	[setup startThread:@"engineProtocol"];
    77 	[setup startThread:@"engineProtocol"];
    78 	const char **gameArgs = [setup getSettings];
    78 	const char **gameArgs = [setup getSettings];
    79 	[setup release];
    79 	[setup release];
    80     
    80     
    81     // overlay with controls, become visible after 2 seconds
    81     // overlay with controls, become visible after 2 seconds
    82     overlayController = [[OverlayViewController alloc] initWithNibName:@"OverlayViewController" bundle:nil];
    82     if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
       
    83         overlayController = [[OverlayViewController alloc] initWithNibName:@"OverlayViewController-iPad" bundle:nil];
       
    84     else
       
    85         overlayController = [[OverlayViewController alloc] initWithNibName:@"OverlayViewController-iPhone" bundle:nil];
       
    86 
    83     [uiwindow addSubview:overlayController.view];
    87     [uiwindow addSubview:overlayController.view];
    84     [overlayController release];
    88     [overlayController release];
    85 
    89 
    86     isInGame = YES;
    90     isInGame = YES;
    87 	Game(gameArgs); // this is the pascal fuction that starts the game
    91 	Game(gameArgs); // this is the pascal fuction that starts the game
   108     [application setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];  
   112     [application setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];  
   109 		
   113 		
   110 	self.uiwindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
   114 	self.uiwindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
   111 	self.uiwindow.backgroundColor = [UIColor blackColor];
   115 	self.uiwindow.backgroundColor = [UIColor blackColor];
   112 	
   116 	
   113 	self.viewController = [[MainMenuViewController alloc] initWithNibName:@"MainMenuViewController" bundle:nil];
   117     if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
       
   118         self.viewController = [[MainMenuViewController alloc] initWithNibName:@"MainMenuViewController-iPad" bundle:nil];
       
   119     else
       
   120         self.viewController = [[MainMenuViewController alloc] initWithNibName:@"MainMenuViewController-iPhone" bundle:nil];
   114 	[uiwindow addSubview:viewController.view];
   121 	[uiwindow addSubview:viewController.view];
   115     [viewController release];
   122     [viewController release];
   116 	
   123 	
   117 	// Set working directory to resource path
   124 	// Set working directory to resource path
   118 	[[NSFileManager defaultManager] changeCurrentDirectoryPath: [[NSBundle mainBundle] resourcePath]];
   125 	[[NSFileManager defaultManager] changeCurrentDirectoryPath: [[NSBundle mainBundle] resourcePath]];