project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.m
changeset 5968 4e8bb227be9a
parent 5699 1a9a6a7662aa
child 5975 c3a8cab64fcb
equal deleted inserted replaced
5967:500e7a1cf9a3 5968:4e8bb227be9a
   131     }
   131     }
   132     print_free_memory();
   132     print_free_memory();
   133     // don't clean mainMenuViewController here!!!
   133     // don't clean mainMenuViewController here!!!
   134 }
   134 }
   135 
   135 
       
   136 // true multitasking with sdl works only on 4.2 and above; we close the game to avoid a black screen at return
   136 -(void) applicationWillResignActive:(UIApplication *)application {
   137 -(void) applicationWillResignActive:(UIApplication *)application {
   137     // true multitasking with sdl works only on 4.2 and above; we close the game to avoid a black screen at return
   138     if (self.isInGame)
   138     if (self.isInGame && ([[[UIDevice currentDevice] systemVersion] floatValue] < 4.2f))
   139         if ([[[UIDevice currentDevice] systemVersion] floatValue] < 4.2f)
   139         HW_terminate(NO);
   140             HW_terminate(NO);
       
   141         else
       
   142             HW_suspend();
   140     [super applicationWillResignActive:application];
   143     [super applicationWillResignActive:application];
   141 }
   144 }
   142 
   145 
       
   146 -(void) applicationDidBecomeActive:(UIApplication *)application {
       
   147     HW_resume();
       
   148     [super applicationDidBecomeActive:application];
       
   149 }
   143 
   150 
   144 @end
   151 @end