diff -r 500e7a1cf9a3 -r 4e8bb227be9a project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.m --- a/project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.m Mon Sep 19 23:18:48 2011 +0200 +++ b/project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.m Mon Sep 19 23:35:07 2011 +0200 @@ -133,12 +133,19 @@ // don't clean mainMenuViewController here!!! } +// true multitasking with sdl works only on 4.2 and above; we close the game to avoid a black screen at return -(void) applicationWillResignActive:(UIApplication *)application { - // true multitasking with sdl works only on 4.2 and above; we close the game to avoid a black screen at return - if (self.isInGame && ([[[UIDevice currentDevice] systemVersion] floatValue] < 4.2f)) - HW_terminate(NO); + if (self.isInGame) + if ([[[UIDevice currentDevice] systemVersion] floatValue] < 4.2f) + HW_terminate(NO); + else + HW_suspend(); [super applicationWillResignActive:application]; } +-(void) applicationDidBecomeActive:(UIApplication *)application { + HW_resume(); + [super applicationDidBecomeActive:application]; +} @end