cocoaTouch/overlayViewController.m
changeset 3029 67483e87590c
parent 3027 32890edaa483
child 3034 b576460ba8ad
equal deleted inserted replaced
3028:d17cf923d7c3 3029:67483e87590c
    32                                         selector:@selector(dimOverlay)
    32                                         selector:@selector(dimOverlay)
    33                                         userInfo:nil
    33                                         userInfo:nil
    34                                          repeats:YES];
    34                                          repeats:YES];
    35     
    35     
    36     [[NSRunLoop currentRunLoop] addTimer:dimTimer forMode:NSDefaultRunLoopMode];
    36     [[NSRunLoop currentRunLoop] addTimer:dimTimer forMode:NSDefaultRunLoopMode];
       
    37     
       
    38     [NSTimer scheduledTimerWithTimeInterval:2 target:self selector:@selector(showMenuAfterwards) userInfo:nil repeats:NO];
    37 }
    39 }
    38 
    40 
    39 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    41 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    40     return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
    42     return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
    41 }
    43 }
    43 -(void) viewDidUnload {
    45 -(void) viewDidUnload {
    44 	[dimTimer invalidate];
    46 	[dimTimer invalidate];
    45 }
    47 }
    46 
    48 
    47 -(void) dealloc {
    49 -(void) dealloc {
    48     [dimTimer release];
    50     // dimTimer is autoreleased
    49     [super dealloc];
    51     [super dealloc];
    50 }
    52 }
    51 
    53 
    52 // draws the controller overlay after the sdl window has taken control
    54 // draws the controller overlay after the sdl window has taken control
    53 -(void) showMenuAfterwards {
    55 -(void) showMenuAfterwards {
   165 	HW_allKeysUp();
   167 	HW_allKeysUp();
   166 }
   168 }
   167 
   169 
   168 -(void) touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
   170 -(void) touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
   169 	// this can happen if the user puts more than 5 touches on the screen at once, or perhaps in other circumstances.
   171 	// this can happen if the user puts more than 5 touches on the screen at once, or perhaps in other circumstances.
   170 	// Usually (it seems) all active touches are canceled.
       
   171 	[self touchesEnded:touches withEvent:event];
   172 	[self touchesEnded:touches withEvent:event];
   172 }
   173 }
   173 
   174 
   174 -(void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
   175 -(void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
   175 	NSArray *twoTouches;
   176 	NSArray *twoTouches;