project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.m
changeset 5106 517bdd3865f1
parent 5017 d29cf06d7d11
child 5109 6d2e8a24277e
equal deleted inserted replaced
5104:e31409482740 5106:517bdd3865f1
    33 #undef main
    33 #undef main
    34 #endif
    34 #endif
    35 
    35 
    36 #define BLACKVIEW_TAG 17935
    36 #define BLACKVIEW_TAG 17935
    37 #define SECONDBLACKVIEW_TAG 48620
    37 #define SECONDBLACKVIEW_TAG 48620
    38 #define VALGRIND "/opt/fink/bin/valgrind"
    38 
    39 
    39 @implementation SDLUIKitDelegate (customDelegate)
    40 int main (int argc, char *argv[]) {
    40 
    41 #ifdef VALGRIND_REXEC
    41 +(NSString *)getAppDelegateClassName {
    42     // Using the valgrind build config, rexec ourself in valgrind
    42     return @"HedgewarsAppDelegate";
    43     // from http://landonf.bikemonkey.org/code/iphone/iPhone_Simulator_Valgrind.20081224.html
    43 }
    44     if (argc < 2 || (argc >= 2 && strcmp(argv[1], "-valgrind") != 0))
    44 
    45         execl(VALGRIND, VALGRIND, "--leak-check=full", "--dsymutil=yes", argv[0], "-valgrind", NULL);
    45 @end
    46 #endif
       
    47     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
       
    48     int retVal = UIApplicationMain(argc, argv, nil, @"HedgewarsAppDelegate");
       
    49     [pool release];
       
    50     return retVal;
       
    51 }
       
    52 
       
    53 int SDL_main(int argc, char **argv) {
       
    54     // dummy function to prevent linkage fail
       
    55     return 0;
       
    56 }
       
    57 
    46 
    58 @implementation HedgewarsAppDelegate
    47 @implementation HedgewarsAppDelegate
    59 @synthesize mainViewController, overlayController, uiwindow, secondWindow, isInGame;
    48 @synthesize mainViewController, overlayController, uiwindow, secondWindow, isInGame;
    60 
    49 
    61 // convenience method
    50 // convenience method