cocoaTouch/iPad/MainMenuViewController.m
changeset 3122 e005359efc59
parent 3113 2829ea0dd47c
child 3165 3ec07a7d8456
equal deleted inserted replaced
3121:77cfee30b952 3122:e005359efc59
    16 //SoundEffect *erasingSound = [[SoundEffect alloc] initWithContentsOfFile:[mainBundle pathForResource:@"Erase" ofType:@"caf"]];
    16 //SoundEffect *erasingSound = [[SoundEffect alloc] initWithContentsOfFile:[mainBundle pathForResource:@"Erase" ofType:@"caf"]];
    17 //SoundEffect *selectSound = [[SoundEffect alloc] initWithContentsOfFile:[mainBundle pathForResource:@"Select" ofType:@"caf"]];
    17 //SoundEffect *selectSound = [[SoundEffect alloc] initWithContentsOfFile:[mainBundle pathForResource:@"Select" ofType:@"caf"]];
    18 
    18 
    19 
    19 
    20 @implementation MainMenuViewController
    20 @implementation MainMenuViewController
       
    21 @synthesize cover;
    21 
    22 
    22 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
    23 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
    23 	return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
    24 	return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
    24 }
    25 }
    25 
    26 
    93     
    94     
    94     [UIView beginAnimations:@"inserting main controller" context:NULL];
    95     [UIView beginAnimations:@"inserting main controller" context:NULL];
    95 	[UIView setAnimationDuration:1];
    96 	[UIView setAnimationDuration:1];
    96 	self.view.alpha = 1;
    97 	self.view.alpha = 1;
    97 	[UIView commitAnimations];
    98 	[UIView commitAnimations];
       
    99     
       
   100     // this is a silly way to hide the sdl contex that remained active
       
   101     if (nil == cover) {
       
   102         cover= [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
       
   103         cover.backgroundColor = [UIColor blackColor];
       
   104     }
       
   105     [[SDLUIKitDelegate sharedAppDelegate].uiwindow insertSubview:cover belowSubview:self.view];
    98 }
   106 }
    99 
   107 
   100 -(void) disappear {
   108 -(void) disappear {
       
   109     if (nil != cover)
       
   110         [cover release];
       
   111     
   101     [UIView beginAnimations:@"removing main controller" context:NULL];
   112     [UIView beginAnimations:@"removing main controller" context:NULL];
   102 	[UIView setAnimationDuration:1];
   113 	[UIView setAnimationDuration:1];
   103 	self.view.alpha = 0;
   114 	self.view.alpha = 0;
   104 	[UIView commitAnimations];
   115 	[UIView commitAnimations];
   105     
   116