equal
deleted
inserted
replaced
73 [mainViewController release]; |
73 [mainViewController release]; |
74 [super dealloc]; |
74 [super dealloc]; |
75 } |
75 } |
76 |
76 |
77 // main routine for calling the actual game engine |
77 // main routine for calling the actual game engine |
78 -(IBAction) startSDLgame { |
78 -(IBAction) startSDLgame: (NSDictionary *)gameDictionary { |
79 [UIView beginAnimations:@"removing main controller" context:NULL]; |
79 [UIView beginAnimations:@"removing main controller" context:NULL]; |
80 [UIView setAnimationDuration:1]; |
80 [UIView setAnimationDuration:1]; |
81 mainViewController.view.alpha = 0; |
81 mainViewController.view.alpha = 0; |
82 [UIView commitAnimations]; |
82 [UIView commitAnimations]; |
83 |
83 |
84 // pull out useful configuration info from various files |
84 // pull out useful configuration info from various files |
85 GameSetup *setup = [[GameSetup alloc] init]; |
85 GameSetup *setup = [[GameSetup alloc] initWithDictionary:gameDictionary]; |
|
86 |
86 [setup startThread:@"engineProtocol"]; |
87 [setup startThread:@"engineProtocol"]; |
87 const char **gameArgs = [setup getSettings]; |
88 const char **gameArgs = [setup getSettings]; |
88 [setup release]; |
89 [setup release]; |
89 |
90 |
90 // since the sdlwindow is not yet created, we add the overlayController with a delay |
91 // since the sdlwindow is not yet created, we add the overlayController with a delay |
94 isInGame = YES; |
95 isInGame = YES; |
95 Game(gameArgs); |
96 Game(gameArgs); |
96 isInGame = NO; |
97 isInGame = NO; |
97 free(gameArgs); |
98 free(gameArgs); |
98 |
99 |
|
100 // bring the uiwindow below in front |
99 UIWindow *aWin = [[[UIApplication sharedApplication] windows] objectAtIndex:0]; |
101 UIWindow *aWin = [[[UIApplication sharedApplication] windows] objectAtIndex:0]; |
100 [aWin makeKeyAndVisible]; |
102 [aWin makeKeyAndVisible]; |
101 aWin = [[[UIApplication sharedApplication] windows] lastObject]; |
103 aWin = [[[UIApplication sharedApplication] windows] lastObject]; |
102 [aWin removeFromSuperview]; |
104 [aWin removeFromSuperview]; |
103 |
105 |