project_files/HedgewarsMobile/Classes/ObjcExports.m
changeset 6259 02765411a912
parent 6247 6dfad55fd71c
child 6409 ca93f38a1aab
--- a/project_files/HedgewarsMobile/Classes/ObjcExports.m	Mon Oct 31 21:04:18 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/ObjcExports.m	Wed Nov 02 09:24:18 2011 +0100
@@ -23,6 +23,8 @@
 #import "OverlayViewController.h"
 #import "AmmoMenuViewController.h"
 
+//FIXME: add a proper #import when this is exposed in SDL
+extern UIView *SDL_getUikitView(void *);
 
 // cache the grenade time
 static NSInteger grenadeTime;
@@ -50,7 +52,10 @@
 
 void startLoadingIndicator() {
     // this is the first ojbc function called by engine, so we have to initialize some variables here
-    overlay_instance = [OverlayViewController mainOverlay];
+    overlay_instance = [[OverlayViewController alloc] initWithNibName:@"OverlayViewController" bundle:nil];
+    // in order to get rotation events we have to insert the view inside the first view of the second window
+    //TODO: when multihead make sure that overlay is displayed in the touch-enabled window
+    [SDL_getUikitView(HW_getSDLWindow()) addSubview:overlay_instance.view];
     grenadeTime = 2;
 
     if ([HWUtils gameType] == gtSave) {