server somewhat simplified and correct sporadic crasher
authorkoda
Thu, 24 Jun 2010 01:08:25 +0200
changeset 3548 4d220ee7c75f
parent 3547 02875b1145b7
child 3550 149416b948fc
server somewhat simplified and correct sporadic crasher workaround for not-rotating curl effect display memory warning only once
project_files/HedgewarsMobile/Classes/CommodityFunctions.h
project_files/HedgewarsMobile/Classes/GameConfigViewController.m
project_files/HedgewarsMobile/Classes/GameSetup.h
project_files/HedgewarsMobile/Classes/GameSetup.m
project_files/HedgewarsMobile/Classes/SDL_uikitappdelegate.m
project_files/HedgewarsMobile/Classes/SchemeSettingsViewController.m
project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m
project_files/HedgewarsMobile/Classes/WeaponSettingsViewController.m
project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj
--- a/project_files/HedgewarsMobile/Classes/CommodityFunctions.h	Wed Jun 23 22:03:56 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/CommodityFunctions.h	Thu Jun 24 01:08:25 2010 +0200
@@ -36,8 +36,8 @@
 #define MAPS_DIRECTORY()        [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Maps/"]
 #define VOICES_DIRECTORY()      [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Sounds/voices/"]
 
-#define MSG_MEMCLEAN()          DLog(@"has cleaned up some memory"); print_free_memory()
-#define MSG_DIDUNLOAD()         DLog(@"did unload");
+#define MSG_MEMCLEAN()          DLog(@"has cleaned up some memory");
+#define MSG_DIDUNLOAD()         DLog(@"unloaded");
 
 void createTeamNamed (NSString *nameWithoutExt);
 void createWeaponNamed (NSString *nameWithoutExt);
--- a/project_files/HedgewarsMobile/Classes/GameConfigViewController.m	Wed Jun 23 22:03:56 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController.m	Thu Jun 24 01:08:25 2010 +0200
@@ -17,7 +17,8 @@
 
 
 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
-    return rotationManager(interfaceOrientation);
+    // dirty trick to avoid rotating below the curl
+    return interfaceOrientation == self.parentViewController.interfaceOrientation;
 }
 
 -(IBAction) buttonPressed:(id) sender {
@@ -112,6 +113,17 @@
         return;
     }
     
+    if ([schemeWeaponConfigViewController.selectedScheme length] == 0 || [schemeWeaponConfigViewController.selectedWeapon length] == 0 ) {
+        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Missing detail",@"")
+                                                        message:NSLocalizedString(@"Make sure you selected one Scheme and one Weapon for this game",@"")
+                                                       delegate:nil
+                                              cancelButtonTitle:NSLocalizedString(@"Ok, got it",@"")
+                                              otherButtonTitles:nil];
+        [alert show];
+        [alert release];
+        return;
+    }
+    
     // create the configuration file that is going to be sent to engine
     NSDictionary *dict = [[NSDictionary alloc] initWithObjectsAndKeys:mapConfigViewController.seedCommand,@"seed_command",
                                                                       mapConfigViewController.templateFilterCommand,@"templatefilter_command",
--- a/project_files/HedgewarsMobile/Classes/GameSetup.h	Wed Jun 23 22:03:56 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/GameSetup.h	Thu Jun 24 01:08:25 2010 +0200
@@ -13,8 +13,8 @@
     NSDictionary *systemSettings;
     NSDictionary *gameConfig;
     
-    NSInteger ipcPort;
-    TCPsocket sd, csd; // Socket descriptor, Client socket descriptor
+    NSInteger ipcPort;  // Port on which engine will listen
+    TCPsocket csd;      // Client socket descriptor
 }
 
 @property (nonatomic, retain) NSDictionary *systemSettings;
--- a/project_files/HedgewarsMobile/Classes/GameSetup.m	Wed Jun 23 22:03:56 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/GameSetup.m	Thu Jun 24 01:08:25 2010 +0200
@@ -16,7 +16,6 @@
 #import "CommodityFunctions.h"
 
 #define BUFFER_SIZE 256
-#define debug(format, ...) CFShow([NSString stringWithFormat:format, ## __VA_ARGS__]);
 
 @implementation GameSetup
 
@@ -38,10 +37,6 @@
     return self;
 }
 
--(NSString *)description {
-    return [NSString stringWithFormat:@"ipcport: %d\nsockets: %d,%d\n teams: %@\n systemSettings: %@",ipcPort,sd,csd,gameConfig,systemSettings];
-}
-
 -(void) dealloc {
     [gameConfig release];
     [systemSettings release];
@@ -235,50 +230,49 @@
 // method that handles net setup with engine and keeps connection alive
 -(void) engineProtocol {
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+    TCPsocket sd;
     IPaddress ip;
     int eProto;
-    BOOL clientQuit, serverQuit;
-    char buffer[BUFFER_SIZE], string[BUFFER_SIZE];
+    BOOL clientQuit;
+    char buffer[BUFFER_SIZE];
     uint8_t msgSize;
     uint16_t gameTicks;
-
-    serverQuit = NO;
+    
+    clientQuit = NO;
+    csd = NULL;
 
     if (SDLNet_Init() < 0) {
         DLog(@"SDLNet_Init: %s", SDLNet_GetError());
-        serverQuit = YES;
+        clientQuit = YES;
     }
     
     // Resolving the host using NULL make network interface to listen
-    if (SDLNet_ResolveHost(&ip, NULL, ipcPort) < 0) {
+    if (SDLNet_ResolveHost(&ip, NULL, ipcPort) < 0 && !clientQuit) {
         DLog(@"SDLNet_ResolveHost: %s\n", SDLNet_GetError());
-        serverQuit = YES;
+        clientQuit = YES;
     }
     
     // Open a connection with the IP provided (listen on the host's port) 
-    if (!(sd = SDLNet_TCP_Open(&ip))) {
+    if (!(sd = SDLNet_TCP_Open(&ip)) && !clientQuit) {
         DLog(@"SDLNet_TCP_Open: %s %\n", SDLNet_GetError(), ipcPort);
-        serverQuit = YES;
+        clientQuit = YES;
     }
     
     DLog(@"Waiting for a client on port %d", ipcPort);
-    while (!serverQuit) {
-        // This check the sd if there is a pending connection.
-        // If there is one, accept that, and open a new socket for communicating
+    while (csd == NULL) 
         csd = SDLNet_TCP_Accept(sd);
-        if (NULL != csd) {
-            // Now we can communicate with the client using csd socket
-            // sd will remain opened waiting other connections
-            DLog(@"client found");
-            
-            //first byte of the command alwayas contain the size of the command
-            SDLNet_TCP_Recv(csd, &msgSize, sizeof(uint8_t));
-            
-            SDLNet_TCP_Recv(csd, buffer, msgSize);
-            gameTicks = SDLNet_Read16 (&buffer[msgSize - 2]);
-            //DLog(@"engineProtocol - %d: received [%s]", gameTicks, buffer);
-            
-            if ('C' == buffer[0]) {
+    SDLNet_TCP_Close(sd);
+    
+    while (!clientQuit) {
+        msgSize = 0;
+        memset(buffer, 0, BUFFER_SIZE);
+        if (SDLNet_TCP_Recv(csd, &msgSize, sizeof(uint8_t)) <= 0)
+            clientQuit = YES;
+        if (SDLNet_TCP_Recv(csd, buffer, msgSize) <=0)
+            clientQuit = YES;
+        
+        switch (buffer[0]) {
+            case 'C':
                 DLog(@"sending game config");
                 
                 // local game
@@ -286,12 +280,12 @@
                 
                 // seed info
                 [self sendToEngine:[self.gameConfig objectForKey:@"seed_command"]];
-
+                
                 // dimension of the map
                 [self sendToEngine:[self.gameConfig objectForKey:@"templatefilter_command"]];
                 [self sendToEngine:[self.gameConfig objectForKey:@"mapgen_command"]];
                 [self sendToEngine:[self.gameConfig objectForKey:@"mazesize_command"]];
-
+                
                 // theme info
                 [self sendToEngine:[self.gameConfig objectForKey:@"theme_command"]];
                 
@@ -306,77 +300,58 @@
                                   ofColor:[teamData objectForKey:@"color"]];
                 }
                 
-                [self provideAmmoData:@"Default.plist" forPlayingTeams:[teamsConfig count]];
+                [self provideAmmoData:[self.gameConfig objectForKey:@"weapon"] forPlayingTeams:[teamsConfig count]];
                 
                 clientQuit = NO;
-            } else {
-                DLog(@"wrong message or client closed connection");
+                break;
+            case '?':
+                // without this sleep sometimes frontend replies before engine has processed any flag (resulting in an error)
+                [NSThread sleepForTimeInterval:0.4];
+                DLog(@"Ping? Pong!");
+                [self sendToEngine:@"!"];
+                break;
+            case 'E':
+                DLog(@"ERROR - last console line: [%s]", &buffer[1]);
                 clientQuit = YES;
-            }
-            
-            while (!clientQuit){
-                msgSize = 0;
-                memset(buffer, 0, BUFFER_SIZE);
-                memset(string, 0, BUFFER_SIZE);
-                if (SDLNet_TCP_Recv(csd, &msgSize, sizeof(uint8_t)) <= 0)
-                    clientQuit = YES;
-                if (SDLNet_TCP_Recv(csd, buffer, msgSize) <=0)
+                break;
+            case 'e':
+                sscanf(buffer, "%*s %d", &eProto);
+                short int netProto = 0;
+                char *versionStr;
+                
+                HW_versionInfo(&netProto, &versionStr);
+                if (netProto == eProto) {
+                    DLog(@"Setting protocol version %d (%s)", eProto, versionStr);
+                } else {
+                    DLog(@"ERROR - wrong protocol number: [%s] - expecting %d", &buffer[1], eProto);
                     clientQuit = YES;
-                
-                gameTicks = SDLNet_Read16(&buffer[msgSize - 2]);
-                //DLog(@"engineProtocolThread - %d: received [%s]", gameTicks, buffer);
+                }
                 
-                switch (buffer[0]) {
-                    case '?':
-                        DLog(@"Ping? Pong!");
-                        [self sendToEngine:@"!"];
-                        break;
-                    case 'E':
-                        DLog(@"ERROR - last console line: [%s]", buffer);
-                        clientQuit = YES;
+                break;
+            case 'i':
+                switch (buffer[1]) {
+                    case 'r':
+                        NSLog(@"Winning team: %s", &buffer[2]);
                         break;
-                    case 'e':
-                        sscanf(buffer, "%*s %d", &eProto);
-                        short int netProto = 0;
-                        char *versionStr;
-                        
-                        HW_versionInfo(&netProto, &versionStr);
-                        if (netProto == eProto) {
-                            DLog(@"Setting protocol version %d (%s)", eProto, versionStr);
-                        } else {
-                            DLog(@"ERROR - wrong protocol number: [%s] - expecting %d", buffer, eProto);
-                            clientQuit = YES;
-                        }
-                        
+                    case 'k':
+                        NSLog(@"Best Hedgehog: %s", &buffer[2]);
                         break;
-                    case 'i':
-                        switch (buffer[1]) {
-                            case 'r':
-                                NSLog(@"Winning team: %s", &buffer[2]);
-                                break;
-                            case 'k':
-                                NSLog(@"Best Hedgehog: %s", &buffer[2]);
-                                break;
-                        }
-                        break;
-                    default:
-                        // empty packet or just statistics
-                        break;
-                    // missing case for exiting right away
                 }
-            }
-            DLog(@"Engine exited, closing server");
-            // wait a little to let the client close cleanly
-            [NSThread sleepForTimeInterval:2];
-            // Close the client socket
-            SDLNet_TCP_Close(csd);
-            serverQuit = YES;
+                break;
+            default:
+                // empty packet or just statistics -- in either cases gameTicks is sent
+                //gameTicks = SDLNet_Read16 (&buffer[msgSize - 2]);
+                //DLog(@"engineProtocol - %d: received [%s]", gameTicks, buffer);
+                break;
         }
     }
+    DLog(@"Engine exited, closing server");
+    // wait a little to let the client close cleanly
+    [NSThread sleepForTimeInterval:2];
+    // Close the client socket
+    SDLNet_TCP_Close(csd);    
+    SDLNet_Quit();
     
-    SDLNet_TCP_Close(sd);
-    SDLNet_Quit();
-
     [[NSFileManager defaultManager] removeItemAtPath:GAMECONFIG_FILE() error:NULL];
     
     [pool release];
--- a/project_files/HedgewarsMobile/Classes/SDL_uikitappdelegate.m	Wed Jun 23 22:03:56 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SDL_uikitappdelegate.m	Thu Jun 24 01:08:25 2010 +0200
@@ -147,6 +147,10 @@
     }
 }
 
+-(void) applicationDidReceiveMemoryWarning:(UIApplication *)application {
+    print_free_memory();
+}
+
 -(void) applicationWillResignActive:(UIApplication *)application {
     //NSLog(@"%@", NSStringFromSelector(_cmd));
     if (isInGame) {
--- a/project_files/HedgewarsMobile/Classes/SchemeSettingsViewController.m	Wed Jun 23 22:03:56 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SchemeSettingsViewController.m	Thu Jun 24 01:08:25 2010 +0200
@@ -116,14 +116,6 @@
     [self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
 }
 
--(BOOL) tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
-    UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
-    if (![cell.textLabel.text isEqualToString:@"Default"]) 
-        return YES;
-    else
-        return NO;
-}
-
 #pragma mark -
 #pragma mark Table view delegate
 -(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
--- a/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m	Wed Jun 23 22:03:56 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m	Thu Jun 24 01:08:25 2010 +0200
@@ -23,6 +23,9 @@
 
     CGSize screenSize = [[UIScreen mainScreen] bounds].size;
     self.view.frame = CGRectMake(0, 0, screenSize.height, screenSize.width - 44);
+    
+    self.selectedScheme = @"";
+    self.selectedWeapon = @"";
 }
 
 -(void) viewWillAppear:(BOOL) animated {
@@ -31,12 +34,15 @@
     NSArray *contentsOfDir = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:SCHEMES_DIRECTORY() error:NULL];
     self.listOfSchemes = contentsOfDir;
     
+    if ([listOfSchemes containsObject:@"Default.plist"])
+         self.selectedScheme = @"Default.plist";
+    
     contentsOfDir = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:WEAPONS_DIRECTORY() error:NULL];
     self.listOfWeapons = contentsOfDir;
-    
-    self.selectedScheme = @"Default.plist";
-    self.selectedWeapon = @"Default.plist";
-    
+         
+    if ([listOfWeapons containsObject:@"Default.plist"])
+         self.selectedWeapon = @"Default.plist";
+
     [self.tableView reloadData];
 }
 
--- a/project_files/HedgewarsMobile/Classes/WeaponSettingsViewController.m	Wed Jun 23 22:03:56 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/WeaponSettingsViewController.m	Thu Jun 24 01:08:25 2010 +0200
@@ -115,14 +115,6 @@
     [self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
 }
 
--(BOOL) tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
-    UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
-    if (![cell.textLabel.text isEqualToString:@"Default"]) 
-        return YES;
-    else
-        return NO;
-}
-
 #pragma mark -
 #pragma mark Table view delegate
 -(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
--- a/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj	Wed Jun 23 22:03:56 2010 +0200
+++ b/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj	Thu Jun 24 01:08:25 2010 +0200
@@ -282,17 +282,17 @@
 		6165920911CA9BA200D6E256 /* VoicesViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VoicesViewController.m; sourceTree = "<group>"; };
 		6165920A11CA9BA200D6E256 /* WeaponSettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeaponSettingsViewController.h; sourceTree = "<group>"; };
 		6165920B11CA9BA200D6E256 /* WeaponSettingsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WeaponSettingsViewController.m; sourceTree = "<group>"; };
-		6165922311CA9BD500D6E256 /* CGPointUtils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = CGPointUtils.c; path = Classes/otherSrc/CGPointUtils.c; sourceTree = "<group>"; };
-		6165922411CA9BD500D6E256 /* CGPointUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CGPointUtils.h; path = Classes/otherSrc/CGPointUtils.h; sourceTree = "<group>"; };
-		6165922511CA9BD500D6E256 /* CommodityFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommodityFunctions.h; path = Classes/otherSrc/CommodityFunctions.h; sourceTree = "<group>"; };
-		6165922611CA9BD500D6E256 /* CommodityFunctions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CommodityFunctions.m; path = Classes/otherSrc/CommodityFunctions.m; sourceTree = "<group>"; };
-		6165922711CA9BD500D6E256 /* HogButtonView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HogButtonView.h; path = Classes/otherSrc/HogButtonView.h; sourceTree = "<group>"; };
-		6165922811CA9BD500D6E256 /* HogButtonView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HogButtonView.m; path = Classes/otherSrc/HogButtonView.m; sourceTree = "<group>"; };
-		6165922911CA9BD500D6E256 /* PascalImports.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PascalImports.h; path = Classes/otherSrc/PascalImports.h; sourceTree = "<group>"; };
-		6165922A11CA9BD500D6E256 /* SquareButtonView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SquareButtonView.h; path = Classes/otherSrc/SquareButtonView.h; sourceTree = "<group>"; };
-		6165922B11CA9BD500D6E256 /* SquareButtonView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SquareButtonView.m; path = Classes/otherSrc/SquareButtonView.m; sourceTree = "<group>"; };
-		6165922C11CA9BD500D6E256 /* UIImageExtra.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UIImageExtra.h; path = Classes/otherSrc/UIImageExtra.h; sourceTree = "<group>"; };
-		6165922D11CA9BD500D6E256 /* UIImageExtra.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = UIImageExtra.m; path = Classes/otherSrc/UIImageExtra.m; sourceTree = "<group>"; };
+		6165922311CA9BD500D6E256 /* CGPointUtils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = CGPointUtils.c; path = Classes/CGPointUtils.c; sourceTree = "<group>"; };
+		6165922411CA9BD500D6E256 /* CGPointUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CGPointUtils.h; path = Classes/CGPointUtils.h; sourceTree = "<group>"; };
+		6165922511CA9BD500D6E256 /* CommodityFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommodityFunctions.h; path = Classes/CommodityFunctions.h; sourceTree = "<group>"; };
+		6165922611CA9BD500D6E256 /* CommodityFunctions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CommodityFunctions.m; path = Classes/CommodityFunctions.m; sourceTree = "<group>"; };
+		6165922711CA9BD500D6E256 /* HogButtonView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HogButtonView.h; path = Classes/HogButtonView.h; sourceTree = "<group>"; };
+		6165922811CA9BD500D6E256 /* HogButtonView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HogButtonView.m; path = Classes/HogButtonView.m; sourceTree = "<group>"; };
+		6165922911CA9BD500D6E256 /* PascalImports.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PascalImports.h; path = Classes/PascalImports.h; sourceTree = "<group>"; };
+		6165922A11CA9BD500D6E256 /* SquareButtonView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SquareButtonView.h; path = Classes/SquareButtonView.h; sourceTree = "<group>"; };
+		6165922B11CA9BD500D6E256 /* SquareButtonView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SquareButtonView.m; path = Classes/SquareButtonView.m; sourceTree = "<group>"; };
+		6165922C11CA9BD500D6E256 /* UIImageExtra.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UIImageExtra.h; path = Classes/UIImageExtra.h; sourceTree = "<group>"; };
+		6165922D11CA9BD500D6E256 /* UIImageExtra.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = UIImageExtra.m; path = Classes/UIImageExtra.m; sourceTree = "<group>"; };
 		6165923311CA9C4600D6E256 /* commands.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = commands.c; path = ../../misc/libopenalbridge/commands.c; sourceTree = SOURCE_ROOT; };
 		6165923411CA9C4600D6E256 /* commands.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = commands.h; path = ../../misc/libopenalbridge/commands.h; sourceTree = SOURCE_ROOT; };
 		6165923511CA9C4600D6E256 /* globals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = globals.h; path = ../../misc/libopenalbridge/globals.h; sourceTree = SOURCE_ROOT; };
@@ -329,8 +329,8 @@
 		6165928411CA9D4800D6E256 /* playButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = playButton.png; path = Resources/playButton.png; sourceTree = "<group>"; };
 		6165928511CA9D4800D6E256 /* settingsButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = settingsButton.png; path = Resources/settingsButton.png; sourceTree = "<group>"; };
 		6165928611CA9D4800D6E256 /* storeButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = storeButton.png; path = Resources/storeButton.png; sourceTree = "<group>"; };
-		6165929C11CA9E2F00D6E256 /* SDL_uikitappdelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_uikitappdelegate.h; path = Classes/otherSrc/SDL_uikitappdelegate.h; sourceTree = "<group>"; };
-		6165929D11CA9E2F00D6E256 /* SDL_uikitappdelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDL_uikitappdelegate.m; path = Classes/otherSrc/SDL_uikitappdelegate.m; sourceTree = "<group>"; };
+		6165929C11CA9E2F00D6E256 /* SDL_uikitappdelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_uikitappdelegate.h; path = Classes/SDL_uikitappdelegate.h; sourceTree = "<group>"; };
+		6165929D11CA9E2F00D6E256 /* SDL_uikitappdelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDL_uikitappdelegate.m; path = Classes/SDL_uikitappdelegate.m; sourceTree = "<group>"; };
 		617987E1114AA34C00BA94A9 /* CCHandlers.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = CCHandlers.inc; path = ../../hedgewars/CCHandlers.inc; sourceTree = SOURCE_ROOT; };
 		617987E4114AA34C00BA94A9 /* GSHandlers.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = GSHandlers.inc; path = ../../hedgewars/GSHandlers.inc; sourceTree = SOURCE_ROOT; };
 		617987E5114AA34C00BA94A9 /* HHHandlers.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = HHHandlers.inc; path = ../../hedgewars/HHHandlers.inc; sourceTree = SOURCE_ROOT; };
@@ -466,21 +466,21 @@
 		29B97315FDCFA39411CA2CEA /* Other Sources */ = {
 			isa = PBXGroup;
 			children = (
+				32CA4F630368D1EE00C91783 /* Hedgewars_Prefix.pch */,
+				6165922911CA9BD500D6E256 /* PascalImports.h */,
+				6165924811CA9C4B00D6E256 /* libopenalbridge */,
 				6165929C11CA9E2F00D6E256 /* SDL_uikitappdelegate.h */,
 				6165929D11CA9E2F00D6E256 /* SDL_uikitappdelegate.m */,
-				6165924811CA9C4B00D6E256 /* libopenalbridge */,
+				6165922411CA9BD500D6E256 /* CGPointUtils.h */,
 				6165922311CA9BD500D6E256 /* CGPointUtils.c */,
-				6165922411CA9BD500D6E256 /* CGPointUtils.h */,
 				6165922511CA9BD500D6E256 /* CommodityFunctions.h */,
 				6165922611CA9BD500D6E256 /* CommodityFunctions.m */,
 				6165922711CA9BD500D6E256 /* HogButtonView.h */,
 				6165922811CA9BD500D6E256 /* HogButtonView.m */,
-				6165922911CA9BD500D6E256 /* PascalImports.h */,
 				6165922A11CA9BD500D6E256 /* SquareButtonView.h */,
 				6165922B11CA9BD500D6E256 /* SquareButtonView.m */,
 				6165922C11CA9BD500D6E256 /* UIImageExtra.h */,
 				6165922D11CA9BD500D6E256 /* UIImageExtra.m */,
-				32CA4F630368D1EE00C91783 /* Hedgewars_Prefix.pch */,
 			);
 			name = "Other Sources";
 			sourceTree = "<group>";
@@ -1298,7 +1298,7 @@
 		6164429D11B5CDE500B9A6F3 /* Valgrind */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+				ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
 				CODE_SIGN_IDENTITY = "iPhone Developer: Vittorio Giovara (DC2BRETXAC)";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Vittorio Giovara (DC2BRETXAC)";
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
@@ -1333,7 +1333,7 @@
 					"-Wl,-no_order_inits",
 				);
 				PREBINDING = NO;
-				SDKROOT = iphonesimulator3.2;
+				SDKROOT = iphoneos3.2;
 				TARGETED_DEVICE_FAMILY = "1,2";
 				VALIDATE_PRODUCT = NO;
 			};
@@ -1501,7 +1501,7 @@
 		C01FCF4F08A954540054247B /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+				ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
 				CODE_SIGN_IDENTITY = "iPhone Developer: Vittorio Giovara (DC2BRETXAC)";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Vittorio Giovara (DC2BRETXAC)";
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
@@ -1541,7 +1541,7 @@
 		C01FCF5008A954540054247B /* Release */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+				ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				FPC_COMMON_OPTIONS = "-dIPHONEOS -Cs2000000 -vwi -B  -Sgix";