remove the need of saving the calling controller (disabling stats, but they were already broken by a previous commit)
authorkoda
Wed, 02 Nov 2011 16:31:16 +0100 (2011-11-02)
changeset 6261 7050772ae46a
parent 6260 025d50a6aeb0
child 6262 32a032f1b178
remove the need of saving the calling controller (disabling stats, but they were already broken by a previous commit)
project_files/HedgewarsMobile/Classes/GameInterfaceBridge.h
project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m
--- a/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.h	Wed Nov 02 09:48:29 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.h	Wed Nov 02 16:31:16 2011 +0100
@@ -25,17 +25,13 @@
 @class OverlayViewController;
 
 @interface GameInterfaceBridge : NSObject <EngineProtocolDelegate> {
-    UIViewController *parentController;
-
     NSString *savePath;
     EngineProtocolNetwork *engineProtocol;
 
     NSInteger ipcPort;  // Port on which engine will listen
 }
 
-@property (assign) UIViewController *parentController;
 @property (nonatomic,retain) NSString *savePath;
-
 @property (nonatomic,retain) EngineProtocolNetwork *engineProtocol;
 
 @property (assign) NSInteger ipcPort;
@@ -46,8 +42,6 @@
 -(void) startSaveGame:(NSString *)atPath;
 -(void) startMissionGame:(NSString *)withScript;
 
--(void) prepareEngineLaunch;
--(void) engineLaunch;
 -(void) gameHasEndedWithStats:(NSArray *)stats;
 
 @end
--- a/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m	Wed Nov 02 09:48:29 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m	Wed Nov 02 16:31:16 2011 +0100
@@ -27,14 +27,13 @@
 #import "ObjcExports.h"
 
 @implementation GameInterfaceBridge
-@synthesize parentController, savePath, engineProtocol, ipcPort;
+@synthesize savePath, engineProtocol, ipcPort;
 
 -(id) initWithController:(id) viewController {
     if (self = [super init]) {
         self.ipcPort = [HWUtils randomPort];
         self.savePath = nil;
 
-        self.parentController = (UIViewController *)viewController;
         self.engineProtocol = [[EngineProtocolNetwork alloc] initOnPort:self.ipcPort];
     }
     return self;
@@ -116,13 +115,15 @@
 
 // prepares the controllers for hosting a game
 -(void) prepareEngineLaunch {
+    CGRect theFrame = [[UIScreen mainScreen] bounds];
+    UIWindow *thisWindow = [[HedgewarsAppDelegate sharedAppDelegate] uiwindow];
     // we add a black view hiding the background
-    CGRect theFrame = CGRectMake(0, 0, self.parentController.view.frame.size.height, self.parentController.view.frame.size.width);
     UIView *blackView = [[UIView alloc] initWithFrame:theFrame];
-    [self.parentController.view addSubview:blackView];
+    [thisWindow addSubview:blackView];
     blackView.opaque = YES;
     blackView.backgroundColor = [UIColor blackColor];
     blackView.alpha = 0;
+
     // when dual screen we apply a little transition
     if (IS_DUALHEAD()) {
         [UIView beginAnimations:@"fade out" context:NULL];
@@ -159,9 +160,6 @@
     // the overlay is not needed any more and can be removed
     [[OverlayViewController mainOverlay] removeOverlay];
 
-    // warn our host that it's going to be visible again
-    [self.parentController viewWillAppear:YES];
-
     [AudioManagerController playBackgroundMusic];
 }
 
@@ -204,6 +202,7 @@
     [self prepareEngineLaunch];
 }
 
+/*
 -(void) gameHasEndedWithStats:(NSArray *)stats {
     // wrap this around a retain/realse to prevent being deallocated too soon
     [self retain];
@@ -224,5 +223,6 @@
         [[NSFileManager defaultManager] removeItemAtPath:self.savePath error:nil];
     [self release];
 }
+*/
 
 @end