project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.m
branchhedgeroid
changeset 6224 42b256eca362
parent 6208 b831679e9467
child 6247 6dfad55fd71c
equal deleted inserted replaced
6055:88cfcd9161d3 6224:42b256eca362
    18  * File created on 13/03/2011.
    18  * File created on 13/03/2011.
    19  */
    19  */
    20 
    20 
    21 
    21 
    22 #import "HedgewarsAppDelegate.h"
    22 #import "HedgewarsAppDelegate.h"
    23 #import "PascalImports.h"
    23 #import "MainMenuViewController.h"
    24 #import "ObjcExports.h"
    24 #import "ObjcExports.h"
    25 #import "CommodityFunctions.h"
       
    26 #import "MainMenuViewController.h"
       
    27 #include <unistd.h>
    25 #include <unistd.h>
    28 
    26 
    29 
    27 
    30 @implementation SDLUIKitDelegate (customDelegate)
    28 @implementation SDLUIKitDelegate (customDelegate)
    31 
    29 
    90         [self.secondWindow makeKeyAndVisible];
    88         [self.secondWindow makeKeyAndVisible];
    91     }
    89     }
    92 }
    90 }
    93 
    91 
    94 -(void) applicationDidReceiveMemoryWarning:(UIApplication *)application {
    92 -(void) applicationDidReceiveMemoryWarning:(UIApplication *)application {
    95     // don't stop music when it is playing
    93     [HWUtils releaseCache];
       
    94     // don't stop music if it is playing
    96     if (self.isInGame) {
    95     if (self.isInGame) {
    97         [AudioManagerController cleanupMemory];
    96         [AudioManagerController releaseCache];
    98         MSG_MEMCLEAN();
       
    99     }
    97     }
   100     print_free_memory();
    98     MSG_MEMCLEAN();
   101     // don't clean mainMenuViewController here!!!
    99     // don't clean mainMenuViewController here!!!
   102 }
   100 }
   103 
   101 
   104 // true multitasking with sdl works only on 4.2 and above; we close the game to avoid a black screen at return
   102 // true multitasking with sdl works only on 4.2 and above; we close the game to avoid a black screen at return
   105 -(void) applicationWillResignActive:(UIApplication *)application {
   103 -(void) applicationWillResignActive:(UIApplication *)application {