small fix for starting the ios game
authorkoda
Sat, 30 Apr 2011 20:06:05 +0200
changeset 5194 851c6fbb44e6
parent 5192 881c14f81d12
child 5195 1bfa81f0bc21
small fix for starting the ios game
hedgewars/PascalExports.pas
project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m
project_files/HedgewarsMobile/Classes/ObjcExports.m
--- a/hedgewars/PascalExports.pas	Fri Apr 29 17:11:08 2011 +0400
+++ b/hedgewars/PascalExports.pas	Sat Apr 30 20:06:05 2011 +0200
@@ -28,8 +28,7 @@
  *           http://en.wikipedia.org/wiki/X86_calling_conventions#cdecl
  *)
 interface
-uses uTypes, uConsts, uVariables, GLunit, uKeys, uSound, uAmmos, uUtils,
-     uCommands, uMobile;
+uses uTypes, uConsts, uVariables, GLunit, uKeys, uSound, uAmmos, uUtils, uCommands;
 
 {$INCLUDE "config.inc"}
 procedure HW_versionInfo(netProto: PLongInt; versionStr: PPChar); cdecl; export;
@@ -201,7 +200,6 @@
 // equivalent to esc+y; when closeFrontend = true the game exits after memory cleanup
 procedure HW_terminate(closeFrontend: boolean); cdecl; export;
 begin
-    {$IFDEF IPHONEOS}setGameRunning(false);{$ENDIF}
     alsoShutdownFrontend:= closeFrontend;
     ParseCommand('forcequit', true);
 end;
--- a/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m	Fri Apr 29 17:11:08 2011 +0400
+++ b/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m	Sat Apr 30 20:06:05 2011 +0200
@@ -61,7 +61,6 @@
 
     [self.overlayController setUseClassicMenu:[[dict objectForKey:@"menu"] boolValue]];
     [self.overlayController setInitialOrientation:[[dict objectForKey:@"orientation"] intValue]];
-    objcExportsInit(self.overlayController);
 
     UIWindow *gameWindow = (IS_DUALHEAD() ? [HedgewarsAppDelegate sharedAppDelegate].uiwindow : [[UIApplication sharedApplication] keyWindow]);
     [gameWindow addSubview:self.overlayController.view];
@@ -129,6 +128,8 @@
     [localeString release];
     [ipcString release];
 
+    objcExportsInit(self.overlayController);
+
     // this is the pascal fuction that starts the game, wrapped around isInGame
     [HedgewarsAppDelegate sharedAppDelegate].isInGame = YES;
     Game(gameArgs);
--- a/project_files/HedgewarsMobile/Classes/ObjcExports.m	Fri Apr 29 17:11:08 2011 +0400
+++ b/project_files/HedgewarsMobile/Classes/ObjcExports.m	Sat Apr 30 20:06:05 2011 +0200
@@ -101,6 +101,9 @@
 }
 
 void saveBeganSynching() {
+    savedGame = YES;
+    stopSpinningProgress();
+
     overlay_instance.view.backgroundColor = [UIColor blackColor];
     overlay_instance.view.alpha = 0.75;
     overlay_instance.view.userInteractionEnabled = NO;
@@ -114,9 +117,6 @@
     [overlay_instance.savesIndicator startAnimating];
     [overlay_instance.view addSubview:overlay_instance.savesIndicator];
     [overlay_instance.savesIndicator release];
-
-    savedGame = YES;
-    stopSpinningProgress();
 }
 
 void saveFinishedSynching() {
@@ -131,7 +131,6 @@
     [overlay_instance.savesIndicator performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1];
 
     gameRunning = YES;
-    savedGame = NO;
 }
 
 void updateVisualsNewTurn(void) {