project_files/HedgewarsMobile/Classes/InGameMenuViewController.m
changeset 3926 668b71f31e51
parent 3924 2a9ace189288
child 3971 5c82ee165ed5
equal deleted inserted replaced
3924:2a9ace189288 3926:668b71f31e51
    47                       nil];
    47                       nil];
    48     self.menuList = array;
    48     self.menuList = array;
    49     [array release];
    49     [array release];
    50 
    50 
    51     // save the sdl window (!= uikit window) for future reference
    51     // save the sdl window (!= uikit window) for future reference
    52     SDL_VideoDevice *_this = SDL_GetVideoDevice();
    52     SDL_VideoDevice *videoDevice = SDL_GetVideoDevice();
    53     SDL_VideoDisplay *display = &_this->displays[0];
    53     if (videoDevice) {
    54     sdlwindow = display->windows;
    54         SDL_VideoDisplay *display = &videoDevice->displays[0];
    55 
    55         if (display)
       
    56             sdlwindow = display->windows;
       
    57     }
    56     [super viewDidLoad];
    58     [super viewDidLoad];
       
    59 }
       
    60 
       
    61 -(void) viewWillAppear:(BOOL)animated {
       
    62     if (sdlwindow == NULL) {
       
    63         SDL_VideoDevice *_this = SDL_GetVideoDevice();
       
    64         if (_this) {
       
    65             SDL_VideoDisplay *display = &_this->displays[0];
       
    66             if (display)
       
    67                 sdlwindow = display->windows;
       
    68         }
       
    69     }
       
    70     [super viewWillAppear:animated];
    57 }
    71 }
    58 
    72 
    59 -(void) viewDidUnload {
    73 -(void) viewDidUnload {
    60     self.menuList = nil;
    74     self.menuList = nil;
       
    75     sdlwindow = NULL;
    61     MSG_DIDUNLOAD();
    76     MSG_DIDUNLOAD();
    62     [super viewDidUnload];
    77     [super viewDidUnload];
    63 }
    78 }
    64 
    79 
    65 -(void) dealloc {
    80 -(void) dealloc {