42 self.proto = engineProtocol; |
42 self.proto = engineProtocol; |
43 [engineProtocol release]; |
43 [engineProtocol release]; |
44 [self.proto spawnThread:self.savePath withOptions:optionsOrNil]; |
44 [self.proto spawnThread:self.savePath withOptions:optionsOrNil]; |
45 |
45 |
46 // add a black view hiding the background |
46 // add a black view hiding the background |
47 CGRect theFrame = [[UIScreen mainScreen] bounds]; |
|
48 UIWindow *thisWindow = [[HedgewarsAppDelegate sharedAppDelegate] uiwindow]; |
47 UIWindow *thisWindow = [[HedgewarsAppDelegate sharedAppDelegate] uiwindow]; |
49 self.blackView = [[UIView alloc] initWithFrame:theFrame]; |
48 self.blackView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; |
50 self.blackView.opaque = YES; |
49 self.blackView.opaque = YES; |
51 self.blackView.backgroundColor = [UIColor blackColor]; |
50 self.blackView.backgroundColor = [UIColor blackColor]; |
52 self.blackView.alpha = 0; |
51 self.blackView.alpha = 0; |
|
52 self.blackView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; |
53 [UIView beginAnimations:@"fade out" context:NULL]; |
53 [UIView beginAnimations:@"fade out" context:NULL]; |
54 [UIView setAnimationDuration:1]; |
54 [UIView setAnimationDuration:1]; |
55 self.blackView.alpha = 1; |
55 self.blackView.alpha = 1; |
56 [UIView commitAnimations]; |
56 [UIView commitAnimations]; |
57 [thisWindow addSubview:self.blackView]; |
57 [thisWindow addSubview:self.blackView]; |