equal
deleted
inserted
replaced
77 [super dealloc]; |
77 [super dealloc]; |
78 } |
78 } |
79 |
79 |
80 // main routine for calling the actual game engine |
80 // main routine for calling the actual game engine |
81 -(void) startSDLgame:(NSDictionary *)gameDictionary { |
81 -(void) startSDLgame:(NSDictionary *)gameDictionary { |
82 UIView *blackView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.height, self.view.frame.size.width)]; |
82 UIWindow *aWin = [[[UIApplication sharedApplication] windows] objectAtIndex:0]; |
|
83 |
|
84 UIView *blackView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, aWin.frame.size.height, aWin.frame.size.width)]; |
83 blackView.opaque = YES; |
85 blackView.opaque = YES; |
84 blackView.backgroundColor = [UIColor blackColor]; |
86 blackView.backgroundColor = [UIColor blackColor]; |
85 [self.view addSubview:blackView]; |
87 [aWin addSubview:blackView]; |
86 |
88 |
87 // pull out useful configuration info from various files |
89 // pull out useful configuration info from various files |
88 GameSetup *setup = [[GameSetup alloc] initWithDictionary:gameDictionary]; |
90 GameSetup *setup = [[GameSetup alloc] initWithDictionary:gameDictionary]; |
89 NSNumber *isNetGameNum = [gameDictionary objectForKey:@"netgame"]; |
91 NSNumber *isNetGameNum = [gameDictionary objectForKey:@"netgame"]; |
90 |
92 |
100 isInGame = YES; |
102 isInGame = YES; |
101 Game(gameArgs); |
103 Game(gameArgs); |
102 isInGame = NO; |
104 isInGame = NO; |
103 free(gameArgs); |
105 free(gameArgs); |
104 |
106 |
105 UIWindow *aWin = [[[UIApplication sharedApplication] windows] objectAtIndex:0]; [aWin makeKeyAndVisible]; |
107 [aWin makeKeyAndVisible]; |
106 [UIView beginAnimations:@"fading in from ingame" context:NULL]; |
108 [UIView beginAnimations:@"fading in from ingame" context:NULL]; |
107 [UIView setAnimationDuration:1]; |
109 [UIView setAnimationDuration:1]; |
108 blackView.alpha = 0; |
110 blackView.alpha = 0; |
109 [UIView commitAnimations]; |
111 [UIView commitAnimations]; |
110 [blackView performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1]; |
112 [blackView performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1]; |