cocoaTouch/SDLOverrides/SDL_uikitappdelegate.m
changeset 2772 1965eba10be6
parent 2743 39d097ac2276
child 2803 1f446fc5c8ec
equal deleted inserted replaced
2771:477957a89881 2772:1965eba10be6
    26 #import "SDL_events_c.h"
    26 #import "SDL_events_c.h"
    27 #import "jumphack.h"
    27 #import "jumphack.h"
    28 #import "SDL_video.h"
    28 #import "SDL_video.h"
    29 #import "GameSetup.h"
    29 #import "GameSetup.h"
    30 #import "PascalImports.h"
    30 #import "PascalImports.h"
       
    31 #import "MainMenuViewController.h"
    31 
    32 
    32 //#import "SoundEffect.h"	
    33 //#import "SoundEffect.h"	
    33 //	SoundEffect *erasingSound = [[SoundEffect alloc] initWithContentsOfFile:[mainBundle pathForResource:@"Erase" ofType:@"caf"]];
    34 //	SoundEffect *erasingSound = [[SoundEffect alloc] initWithContentsOfFile:[mainBundle pathForResource:@"Erase" ofType:@"caf"]];
    34 //	SoundEffect *selectSound = [[SoundEffect alloc] initWithContentsOfFile:[mainBundle pathForResource:@"Select" ofType:@"caf"]];
    35 //	SoundEffect *selectSound = [[SoundEffect alloc] initWithContentsOfFile:[mainBundle pathForResource:@"Select" ofType:@"caf"]];
    35 
    36 
    83 	self.viewController.mainView.alpha = 0;
    84 	self.viewController.mainView.alpha = 0;
    84 	[UIView commitAnimations];
    85 	[UIView commitAnimations];
    85 
    86 
    86 	NSLog(@"Game is launching...");
    87 	NSLog(@"Game is launching...");
    87 	const char **gameArgs = [setup getSettings];
    88 	const char **gameArgs = [setup getSettings];
       
    89 	[setup release];
    88 	
    90 	
    89 	// direct execution or thread? check the one that gives most fps
    91 	// this is the pascal fuction that starts the game
    90 	// library or call SDL_main? pascal quits at the end of the main
       
    91 	Game(gameArgs);
    92 	Game(gameArgs);
    92 	
    93 	
    93 	free(gameArgs);
    94 	free(gameArgs);
    94 	NSLog(@"Game is exting...");
    95 	NSLog(@"Game is exting...");
    95 	
       
    96 	[setup release];
       
    97 
    96 
    98 	[uiwindow addSubview: viewController.view];
    97 	[uiwindow addSubview: viewController.view];
    99 	[uiwindow makeKeyAndVisible];
    98 	[uiwindow makeKeyAndVisible];
   100 	
    99 	
   101 	[UIView beginAnimations:@"inserting main controller" context:NULL];
   100 	[UIView beginAnimations:@"inserting main controller" context:NULL];
   105 	
   104 	
   106 	[internal_pool release];
   105 	[internal_pool release];
   107 }
   106 }
   108 
   107 
   109 -(BOOL) checkFirstRun {
   108 -(BOOL) checkFirstRun {
       
   109 	//move all this inside the MainMenuViewController
   110 	BOOL isFirstRun = NO;
   110 	BOOL isFirstRun = NO;
   111 	
   111 	
   112 	//use a nssthread a ask the user to wait
   112 	//use a nssthread a ask the user to wait
   113 	
   113 	
   114 	NSString *filePath = [self dataFilePath:@"settings.plist"];
   114 	NSString *filePath = [self dataFilePath:@"settings.plist"];