ios: disble logging, stop music correctly in preferences, move script command before seed, try using reatin instead of if
authorkoda
Sun, 03 Jul 2011 02:33:17 +0200
changeset 5370 a3f87be7b09a
parent 5368 a66d5141a3ba
child 5372 7283bc768228
ios: disble logging, stop music correctly in preferences, move script command before seed, try using reatin instead of if
hedgewars/options.inc
project_files/HedgewarsMobile/Classes/EngineProtocolNetwork.m
project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m
project_files/HedgewarsMobile/Classes/GeneralSettingsViewController.m
project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj
--- a/hedgewars/options.inc	Sun Jul 03 01:10:39 2011 +0200
+++ b/hedgewars/options.inc	Sun Jul 03 02:33:17 2011 +0200
@@ -32,10 +32,11 @@
   {$DEFINE HWLIBRARY}
   {$DEFINE S3D_DISABLED}
   {$DEFINE GLunit:=gles11}
+{$ELSE}
+  {$DEFINE DEBUGFILE}
+  //{$DEFINE TRACEAIACTIONS}
+  //{$DEFINE COUNTTICKS}
 {$ENDIF}
 
-{$DEFINE DEBUGFILE}
-//{$DEFINE TRACEAIACTIONS}
-//{$DEFINE COUNTTICKS}
 
 //also available LUA_DISABLED
--- a/project_files/HedgewarsMobile/Classes/EngineProtocolNetwork.m	Sun Jul 03 01:10:39 2011 +0200
+++ b/project_files/HedgewarsMobile/Classes/EngineProtocolNetwork.m	Sun Jul 03 02:33:17 2011 +0200
@@ -285,6 +285,11 @@
                 NSString *saveHeader = @"TS";
                 [self dumpRawData:[saveHeader UTF8String] ofSize:[saveHeader length]];
 
+                // lua script (if set)
+                NSString *script = [gameConfig objectForKey:@"mission_command"];
+                if ([script length] != 0)
+                    [self sendToEngine:script];
+
                 // seed info
                 [self sendToEngine:[gameConfig objectForKey:@"seed_command"]];
 
@@ -298,11 +303,6 @@
                 if ([staticMap length] != 0)
                     [self sendToEngine:staticMap];
 
-                // lua script (if set)
-                NSString *script = [gameConfig objectForKey:@"mission_command"];
-                if ([script length] != 0)
-                    [self sendToEngine:script];
-
                 // theme info
                 [self sendToEngine:[gameConfig objectForKey:@"theme_command"]];
 
--- a/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m	Sun Jul 03 01:10:39 2011 +0200
+++ b/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m	Sun Jul 03 02:33:17 2011 +0200
@@ -183,8 +183,7 @@
 
     // release the network manager and the savepath as they are not needed anymore
     releaseAndNil(self.engineProtocol);
-    if (self.gameType != gtSave)
-        releaseAndNil(self.savePath);
+    releaseAndNil(self.savePath);
 
     if ([[userDefaults objectForKey:@"music"] boolValue])
         [HedgewarsAppDelegate playBackgroundMusic];
@@ -210,7 +209,7 @@
 // set up variables for a save game
 -(void) startSaveGame:(NSString *)atPath {
     self.gameType = gtSave;
-    self.savePath = atPath;
+    self.savePath = [atPath retain];
 
     [self.engineProtocol spawnThread:self.savePath];
     [self prepareEngineLaunch];
--- a/project_files/HedgewarsMobile/Classes/GeneralSettingsViewController.m	Sun Jul 03 01:10:39 2011 +0200
+++ b/project_files/HedgewarsMobile/Classes/GeneralSettingsViewController.m	Sun Jul 03 02:33:17 2011 +0200
@@ -62,6 +62,9 @@
             [settings setObject:[NSNumber numberWithBool:NO] forKey:@"music"];
             theOtherSwitch = (UISwitch *)[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:1 inSection:1]].accessoryView;
             [theOtherSwitch setOn:NO animated:YES];
+
+            if (theOtherSwitch.on)
+                [HedgewarsAppDelegate pauseBackgroundMusic];
             break;
         case 20:    //musicSwitch
             // if switch above (sound) is off, never turn on
--- a/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj	Sun Jul 03 01:10:39 2011 +0200
+++ b/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj	Sun Jul 03 02:33:17 2011 +0200
@@ -701,7 +701,6 @@
 		29B97323FDCFA39411CA2CEA /* Frameworks */ = {
 			isa = PBXGroup;
 			children = (
-				612CABAA1391CE68005E9596 /* AVFoundation.framework */,
 				619599BA1364E65900B429B6 /* Freetype.xcodeproj */,
 				6195993F1364C82B00B429B6 /* Lua.xcodeproj */,
 				619598181364BCD200B429B6 /* Tremor.xcodeproj */,
@@ -711,6 +710,7 @@
 				618E27B612A2C30700C20EF0 /* SDL_net.xcodeproj */,
 				61798A0B114AB65600BA94A9 /* SDL_ttf.xcodeproj */,
 				61798934114AB25F00BA94A9 /* AudioToolbox.framework */,
+				612CABAA1391CE68005E9596 /* AVFoundation.framework */,
 				61A117FE1168322700359010 /* CoreGraphics.framework */,
 				1D30AB110D05D00D00671497 /* Foundation.framework */,
 				28FD14FF0DC6FC520079059D /* OpenGLES.framework */,