project_files/HedgewarsMobile/Classes/ObjcExports.m
changeset 6259 02765411a912
parent 6247 6dfad55fd71c
child 6409 ca93f38a1aab
equal deleted inserted replaced
6258:ba9defb98a70 6259:02765411a912
    21 
    21 
    22 #import "ObjcExports.h"
    22 #import "ObjcExports.h"
    23 #import "OverlayViewController.h"
    23 #import "OverlayViewController.h"
    24 #import "AmmoMenuViewController.h"
    24 #import "AmmoMenuViewController.h"
    25 
    25 
       
    26 //FIXME: add a proper #import when this is exposed in SDL
       
    27 extern UIView *SDL_getUikitView(void *);
    26 
    28 
    27 // cache the grenade time
    29 // cache the grenade time
    28 static NSInteger grenadeTime;
    30 static NSInteger grenadeTime;
    29 // the reference to the newMenu instance
    31 // the reference to the newMenu instance
    30 static OverlayViewController *overlay_instance;
    32 static OverlayViewController *overlay_instance;
    48     return (IS_IPAD() == NO);
    50     return (IS_IPAD() == NO);
    49 }
    51 }
    50 
    52 
    51 void startLoadingIndicator() {
    53 void startLoadingIndicator() {
    52     // this is the first ojbc function called by engine, so we have to initialize some variables here
    54     // this is the first ojbc function called by engine, so we have to initialize some variables here
    53     overlay_instance = [OverlayViewController mainOverlay];
    55     overlay_instance = [[OverlayViewController alloc] initWithNibName:@"OverlayViewController" bundle:nil];
       
    56     // in order to get rotation events we have to insert the view inside the first view of the second window
       
    57     //TODO: when multihead make sure that overlay is displayed in the touch-enabled window
       
    58     [SDL_getUikitView(HW_getSDLWindow()) addSubview:overlay_instance.view];
    54     grenadeTime = 2;
    59     grenadeTime = 2;
    55 
    60 
    56     if ([HWUtils gameType] == gtSave) {
    61     if ([HWUtils gameType] == gtSave) {
    57         [[UIApplication sharedApplication] setIdleTimerDisabled:YES];
    62         [[UIApplication sharedApplication] setIdleTimerDisabled:YES];
    58 
    63