slight simplification
authorkoda
Wed, 02 Nov 2011 09:48:29 +0100
changeset 6260 025d50a6aeb0
parent 6259 02765411a912
child 6261 7050772ae46a
slight simplification
project_files/HedgewarsMobile/Classes/DefinesAndMacros.h
project_files/HedgewarsMobile/Classes/InGameMenuViewController.m
project_files/HedgewarsMobile/Classes/OverlayViewController.m
--- a/project_files/HedgewarsMobile/Classes/DefinesAndMacros.h	Wed Nov 02 09:24:18 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/DefinesAndMacros.h	Wed Nov 02 09:48:29 2011 +0100
@@ -79,5 +79,3 @@
 #define IS_NOT_VERY_POWERFUL(x) ([x hasPrefix:@"iPad1"] || [x hasPrefix:@"iPhone2"] || [x hasPrefix:@"iPod3"] || [x hasPrefix:@"iPod4"])
 #define IS_VERY_POWERFUL(x)     (IS_NOT_POWERFUL(x) == NO && IS_NOT_VERY_POWERFUL(x) == NO)
 
-#define UIVIEW_HW_SDLVIEW       [[[[UIApplication sharedApplication] keyWindow] subviews] objectAtIndex:0]
-
--- a/project_files/HedgewarsMobile/Classes/InGameMenuViewController.m	Wed Nov 02 09:24:18 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/InGameMenuViewController.m	Wed Nov 02 09:48:29 2011 +0100
@@ -23,6 +23,8 @@
 #import "SDL_sysvideo.h"
 #import "SDL_uikitkeyboard.h"
 
+//FIXME: add a proper #import when this is exposed in SDL
+extern UIView *SDL_getUikitView(void *);
 
 #define VIEW_HEIGHT 200
 
@@ -170,7 +172,7 @@
                                              cancelButtonTitle:NSLocalizedString(@"Well, maybe not...", @"")
                                         destructiveButtonTitle:NSLocalizedString(@"Of course!", @"")
                                              otherButtonTitles:nil];
-            [actionSheet showInView:(IS_IPAD() ? self.view : UIVIEW_HW_SDLVIEW)];
+            [actionSheet showInView:(IS_IPAD() ? self.view : SDL_getUikitView(HW_getSDLWindow()))];
             [actionSheet release];
 
             break;
--- a/project_files/HedgewarsMobile/Classes/OverlayViewController.m	Wed Nov 02 09:24:18 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/OverlayViewController.m	Wed Nov 02 09:48:29 2011 +0100
@@ -205,6 +205,7 @@
     [self.popoverController performSelectorOnMainThread:@selector(dismissPopoverAnimated:) withObject:nil waitUntilDone:YES];
     [self.view performSelectorOnMainThread:@selector(removeFromSuperview) withObject:nil waitUntilDone:YES];
     [self performSelectorOnMainThread:@selector(release) withObject:nil waitUntilDone:YES];
+    mainOverlay = nil;
 }
 
 #pragma mark -