rewrite portions of some uiviewcontrollers
authorkoda
Sun, 01 Aug 2010 17:58:09 +0200
changeset 3701 8c449776ebe6
parent 3699 e5e2cbc90891
child 3703 12d17c6e8855
rewrite portions of some uiviewcontrollers
hedgewars/SDLh.pas
project_files/HedgewarsMobile/Classes/DetailViewController.h
project_files/HedgewarsMobile/Classes/DetailViewController.m
project_files/HedgewarsMobile/Classes/InGameMenuViewController.m
project_files/HedgewarsMobile/Classes/MainMenuViewController.h
project_files/HedgewarsMobile/Classes/MainMenuViewController.m
project_files/HedgewarsMobile/Classes/MasterViewController.h
project_files/HedgewarsMobile/Classes/MasterViewController.m
project_files/HedgewarsMobile/Classes/OverlayViewController.m
project_files/HedgewarsMobile/Classes/SingleWeaponViewController.m
project_files/HedgewarsMobile/Classes/SplitViewRootController.h
project_files/HedgewarsMobile/Classes/SplitViewRootController.m
project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj
project_files/HedgewarsMobile/Hedgewars_Prefix.pch
--- a/hedgewars/SDLh.pas	Sun Aug 01 09:17:59 2010 -0400
+++ b/hedgewars/SDLh.pas	Sun Aug 01 17:58:09 2010 +0200
@@ -718,6 +718,7 @@
 function  SDL_GetRelativeMouseState(x, y: PLongInt): Byte; cdecl; external SDLLibName;
 function  SDL_GetNumMice: LongInt; cdecl; external SDLLibName;
 function  SDL_PixelFormatEnumToMasks(format: TSDL_ArrayByteOrder; bpp: PLongInt; Rmask, Gmask, Bmask, Amask: PLongInt): boolean; cdecl; external SDLLibName;
+function  SDL_RenderReadPixels(rect: PSDL_Rect; format: LongInt; pixels: pointer; pitch: LongInt): LongInt; cdecl; external SDLLibName;
 {$ENDIF}
 
 function  SDL_GetKeyState(numkeys: PLongInt): PByteArray; cdecl; external SDLLibName {$IFDEF SDL13} name 'SDL_GetKeyboardState'{$ENDIF};
--- a/project_files/HedgewarsMobile/Classes/DetailViewController.h	Sun Aug 01 09:17:59 2010 -0400
+++ b/project_files/HedgewarsMobile/Classes/DetailViewController.h	Sun Aug 01 17:58:09 2010 +0200
@@ -15,7 +15,7 @@
 
 @interface DetailViewController : UITableViewController <UISplitViewControllerDelegate, UIPopoverControllerDelegate> {
     NSArray *controllerNames;
-    
+
     GeneralSettingsViewController *generalSettingsViewController;
     TeamSettingsViewController *teamSettingsViewController;
     WeaponSettingsViewController *weaponSettingsViewController;
@@ -26,7 +26,7 @@
 // used in iphone version
 -(IBAction) dismissSplitView;
 
-@property (nonatomic, retain) NSArray *controllerNames;
+@property (nonatomic,retain) NSArray *controllerNames;
 @property (nonatomic,retain) UIPopoverController *popoverController;
 
 @end
--- a/project_files/HedgewarsMobile/Classes/DetailViewController.m	Sun Aug 01 09:17:59 2010 -0400
+++ b/project_files/HedgewarsMobile/Classes/DetailViewController.m	Sun Aug 01 17:58:09 2010 +0200
@@ -15,17 +15,13 @@
 #import "CommodityFunctions.h"
 
 @implementation DetailViewController
-@synthesize controllerNames,popoverController;
+@synthesize controllerNames, popoverController;
 
 
 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
     return rotationManager(interfaceOrientation);
 }
 
--(void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
-    self.view.frame = CGRectMake(0, 0, 1024, 1024);
-}
-
 -(void) viewDidLoad {
     self.title = NSLocalizedString(@"Settings",@"");
 
--- a/project_files/HedgewarsMobile/Classes/InGameMenuViewController.m	Sun Aug 01 09:17:59 2010 -0400
+++ b/project_files/HedgewarsMobile/Classes/InGameMenuViewController.m	Sun Aug 01 17:58:09 2010 +0200
@@ -27,7 +27,7 @@
 
 -(void) viewDidLoad {
     NSArray *array = [[NSArray alloc] initWithObjects:
-                      NSLocalizedString(@"Return to Game", @""),
+                      NSLocalizedString(@"Show Help", @""),
                       NSLocalizedString(@"Chat", @""),
                       NSLocalizedString(@"End Game", @""),
                       nil];
--- a/project_files/HedgewarsMobile/Classes/MainMenuViewController.h	Sun Aug 01 09:17:59 2010 -0400
+++ b/project_files/HedgewarsMobile/Classes/MainMenuViewController.h	Sun Aug 01 17:58:09 2010 +0200
@@ -13,11 +13,14 @@
 
 @interface MainMenuViewController : UIViewController {
     UILabel *versionLabel;
+    GameConfigViewController *gameConfigViewController;
     SplitViewRootController *settingsViewController;
-    GameConfigViewController *gameConfigViewController;
 }
 
 @property (nonatomic,retain) IBOutlet UILabel *versionLabel;
+@property (nonatomic,retain) GameConfigViewController *gameConfigViewController;
+@property (nonatomic,retain) SplitViewRootController *settingsViewController;
 
 -(IBAction) switchViews:(id)sender;
+
 @end
--- a/project_files/HedgewarsMobile/Classes/MainMenuViewController.m	Sun Aug 01 09:17:59 2010 -0400
+++ b/project_files/HedgewarsMobile/Classes/MainMenuViewController.m	Sun Aug 01 17:58:09 2010 +0200
@@ -15,7 +15,7 @@
 #import "SDL_mixer.h"
 
 @implementation MainMenuViewController
-@synthesize versionLabel;
+@synthesize versionLabel, gameConfigViewController, settingsViewController;
 
 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
     return rotationManager(interfaceOrientation);
@@ -24,10 +24,10 @@
 - (void)didReceiveMemoryWarning {
     // Releases the view if it doesn't have a superview.
     [super didReceiveMemoryWarning];
-    if (settingsViewController.view.superview == nil)
-        settingsViewController = nil;
-    if (gameConfigViewController.view.superview == nil)
-        gameConfigViewController = nil;
+    if (self.settingsViewController.view.superview == nil)
+        self.settingsViewController = nil;
+    if (self.gameConfigViewController.view.superview == nil)
+        self.gameConfigViewController = nil;
     MSG_MEMCLEAN();
 }
 
@@ -118,17 +118,23 @@
 
     switch (button.tag) {
         case 0:
-            gameConfigViewController = [[GameConfigViewController alloc] initWithNibName:@"GameConfigViewController" bundle:nil];
+            if (nil == self.gameConfigViewController) {
+                GameConfigViewController *gcvc = [[GameConfigViewController alloc] initWithNibName:@"GameConfigViewController" bundle:nil];
+                self.gameConfigViewController = gcvc;
+                [gcvc release];
+            }
 
-            [self presentModalViewController:gameConfigViewController animated:YES];
+            [self presentModalViewController:self.gameConfigViewController animated:YES];
             break;
         case 2:
-            if (nil == settingsViewController) {
-                settingsViewController = [[SplitViewRootController alloc] initWithNibName:nil bundle:nil];
-                settingsViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
+            if (nil == self.settingsViewController) {
+                SplitViewRootController *svrc = [[SplitViewRootController alloc] initWithNibName:nil bundle:nil];
+                svrc.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
+                self.settingsViewController = svrc;
+                [svrc release];
             }
 
-            [self presentModalViewController:settingsViewController animated:YES];
+            [self presentModalViewController:self.settingsViewController animated:YES];
             break;
         case 3:
             debugStr = [[NSString alloc] initWithContentsOfFile:DEBUG_FILE()];
@@ -162,11 +168,10 @@
     [self dismissModalViewControllerAnimated:YES];
 }
 
-
 -(void) viewDidUnload {
     self.versionLabel = nil;
-    gameConfigViewController = nil;
-    settingsViewController = nil;
+    self.gameConfigViewController = nil;
+    self.settingsViewController = nil;
     MSG_DIDUNLOAD();
     [super viewDidUnload];
 }
--- a/project_files/HedgewarsMobile/Classes/MasterViewController.h	Sun Aug 01 09:17:59 2010 -0400
+++ b/project_files/HedgewarsMobile/Classes/MasterViewController.h	Sun Aug 01 17:58:09 2010 +0200
@@ -16,7 +16,7 @@
 @class SchemeSettingsViewController;
 
 @interface MasterViewController : UITableViewController {
-    DetailViewController *detailViewController;
+    MasterViewController *targetController;
     NSArray *controllerNames;
     NSIndexPath *lastIndexPath;
     GeneralSettingsViewController *generalSettingsViewController;
@@ -25,7 +25,7 @@
     SchemeSettingsViewController *schemeSettingsViewController;
 }
 
-@property (nonatomic, retain) DetailViewController *detailViewController;
+@property (nonatomic, retain) MasterViewController *targetController;
 @property (nonatomic, retain) NSArray *controllerNames;
 @property (nonatomic, retain) NSIndexPath *lastIndexPath;
 
--- a/project_files/HedgewarsMobile/Classes/MasterViewController.m	Sun Aug 01 09:17:59 2010 -0400
+++ b/project_files/HedgewarsMobile/Classes/MasterViewController.m	Sun Aug 01 17:58:09 2010 +0200
@@ -15,7 +15,7 @@
 #import "CommodityFunctions.h"
 
 @implementation MasterViewController
-@synthesize detailViewController, controllerNames, lastIndexPath;
+@synthesize targetController, controllerNames, lastIndexPath;
 
 
 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
@@ -29,20 +29,29 @@
     [super viewDidLoad];
 
     // the list of selectable controllers
-    controllerNames = [[NSArray alloc] initWithObjects:NSLocalizedString(@"General",@""),
-                                                       NSLocalizedString(@"Teams",@""),
-                                                       NSLocalizedString(@"Weapons",@""),
-                                                       NSLocalizedString(@"Schemes",@""),
-                                                       nil];
-    // the "Done" button on top left
-    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone
-                                                                                          target:self
-                                                                                          action:@selector(dismissSplitView)];
+    NSArray *array = [[NSArray alloc] initWithObjects:NSLocalizedString(@"General",@""),
+                                                      NSLocalizedString(@"Teams",@""),
+                                                      NSLocalizedString(@"Weapons",@""),
+                                                      NSLocalizedString(@"Schemes",@""),
+                                                      nil];
+    self.controllerNames = array;
+    [array release];
+
+    // targetControllers tells whether we're on the right or left side of the splitview -- on iphone we only use the right side
+    if (targetController == nil && UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
+        if (nil == generalSettingsViewController)
+            generalSettingsViewController = [[GeneralSettingsViewController alloc] initWithStyle:UITableViewStyleGrouped];
+        generalSettingsViewController.navigationItem.hidesBackButton = YES;
+        [self.navigationController pushViewController:generalSettingsViewController animated:NO];
+    } else {
+        self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone
+                                                                                              target:self
+                                                                                              action:@selector(dismissSplitView)];
+    }
 }
 
 #pragma mark -
 #pragma mark Table view data source
-
 -(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView {
     return 1;
 }
@@ -58,9 +67,17 @@
     UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
     if (cell == nil) {
         cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
-        cell.textLabel.text = [controllerNames objectAtIndex:[indexPath row]];
     }
 
+    cell.textLabel.text = [controllerNames objectAtIndex:[indexPath row]];
+    if (nil == targetController) {
+        UIImage *icon = [[UIImage alloc] initWithContentsOfFile:@"Icon-Small.png"];
+        cell.imageView.image = icon;
+        [icon release];
+        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
+    } else
+        cell.accessoryType = UITableViewCellAccessoryNone;
+
     return cell;
 }
 
@@ -73,7 +90,7 @@
 
     if (newRow != oldRow) {
         [self.tableView deselectRowAtIndexPath:lastIndexPath animated:YES];
-        [detailViewController.navigationController popToRootViewControllerAnimated:NO];
+        [targetController.navigationController popToRootViewControllerAnimated:NO];
 
         switch (newRow) {
             case 0:
@@ -98,11 +115,17 @@
                 break;
         }
 
-        nextController.navigationItem.hidesBackButton = YES;
         nextController.title = [controllerNames objectAtIndex:newRow];
-        [detailViewController.navigationController pushViewController:nextController animated:NO];
         self.lastIndexPath = indexPath;
         [self.tableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone];
+
+        if (nil == targetController) {
+            nextController.navigationItem.hidesBackButton = NO;
+            [self.navigationController pushViewController:nextController animated:YES];
+        } else {
+            nextController.navigationItem.hidesBackButton = YES;
+            [targetController.navigationController pushViewController:nextController animated:NO];
+        }
     }
 }
 
@@ -125,7 +148,7 @@
 }
 
 -(void) viewDidUnload {
-    self.detailViewController = nil;
+    self.targetController = nil;
     self.controllerNames = nil;
     self.lastIndexPath = nil;
     generalSettingsViewController = nil;
@@ -137,8 +160,8 @@
 }
 
 -(void) dealloc {
+    targetController = nil;
     [controllerNames release];
-    [detailViewController release];
     [lastIndexPath release];
     [generalSettingsViewController release];
     [teamSettingsViewController release];
--- a/project_files/HedgewarsMobile/Classes/OverlayViewController.m	Sun Aug 01 09:17:59 2010 -0400
+++ b/project_files/HedgewarsMobile/Classes/OverlayViewController.m	Sun Aug 01 17:58:09 2010 +0200
@@ -128,6 +128,8 @@
     SDL_VideoDevice *_this = SDL_GetVideoDevice();
     SDL_VideoDisplay *display = &_this->displays[0];
     sdlwindow = display->windows;
+
+    doDim();
 }
 
 -(void) viewDidUnload {
--- a/project_files/HedgewarsMobile/Classes/SingleWeaponViewController.m	Sun Aug 01 09:17:59 2010 -0400
+++ b/project_files/HedgewarsMobile/Classes/SingleWeaponViewController.m	Sun Aug 01 17:58:09 2010 +0200
@@ -214,6 +214,22 @@
         return 120;
 }
 
+-(NSString *)tableView:(UITableView *)aTableView titleForHeaderInSection:(NSInteger)section {
+    NSString *sectionTitle = nil;
+    switch (section) {
+        case 0:
+            sectionTitle = NSLocalizedString(@"Weaponset Name", @"");
+            break;
+        case 1:
+            sectionTitle = NSLocalizedString(@"Weapon Ammuntions", @"");
+            break;
+        default:
+            DLog(@"nope");
+            break;
+    }
+    return sectionTitle;
+}
+
 #pragma mark -
 #pragma mark Table view delegate
 -(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
--- a/project_files/HedgewarsMobile/Classes/SplitViewRootController.h	Sun Aug 01 09:17:59 2010 -0400
+++ b/project_files/HedgewarsMobile/Classes/SplitViewRootController.h	Sun Aug 01 17:58:09 2010 +0200
@@ -8,10 +8,12 @@
 
 #import <UIKit/UIKit.h>
 
-@class DetailViewController;
+@class MasterViewController;
 
 @interface SplitViewRootController: UIViewController {
-    DetailViewController *detailViewController;
+    MasterViewController *activeController;
 }
 
+@property (nonatomic,retain) MasterViewController *activeController;
+
 @end
--- a/project_files/HedgewarsMobile/Classes/SplitViewRootController.m	Sun Aug 01 09:17:59 2010 -0400
+++ b/project_files/HedgewarsMobile/Classes/SplitViewRootController.m	Sun Aug 01 17:58:09 2010 +0200
@@ -12,7 +12,7 @@
 #import "CommodityFunctions.h"
 
 @implementation SplitViewRootController
-
+@synthesize activeController;
 
 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
     return rotationManager(interfaceOrientation);
@@ -22,52 +22,56 @@
     // Releases the view if it doesn't have a superview.
     [super didReceiveMemoryWarning];
     // Release any cached data, images, etc that aren't in use.
-    if (detailViewController.view.superview == nil)
-        detailViewController = nil;
+    if (self.activeController.view.superview == nil)
+        self.activeController = nil;
     MSG_MEMCLEAN();
 }
 
 // load the view programmatically; we need a splitViewController that handles a MasterViewController
 // (which is just a UITableViewController) and a DetailViewController where we present options
 -(void) viewDidLoad {
-    detailViewController = [[DetailViewController alloc] initWithStyle:UITableViewStyleGrouped];
-    UINavigationController *detailedNavController = [[UINavigationController alloc] initWithRootViewController:detailViewController];
-    [detailViewController release];
+    CGRect rect = [[UIScreen mainScreen] bounds];
+    self.view.frame = CGRectMake(0, 0, rect.size.height, rect.size.width);
 
-    CGRect rect = [[UIScreen mainScreen] bounds];
+    if (self.activeController == nil) {
+        MasterViewController *rightController = [[MasterViewController alloc] initWithStyle:UITableViewStyleGrouped];
+        rightController.targetController = nil;
+        self.activeController = rightController;
+        [rightController release];
+    }
+    UINavigationController *rightNavController = [[UINavigationController alloc] initWithRootViewController:self.activeController];
+
     if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
-        self.view.frame = CGRectMake(0, 0, rect.size.height, rect.size.width);
+        MasterViewController *leftController = [[MasterViewController alloc] initWithStyle:UITableViewStylePlain];
+        leftController.targetController = self.activeController;
+        UINavigationController *leftNavController = [[UINavigationController alloc] initWithRootViewController:leftController];
+        [leftController release];
 
         UISplitViewController *splitViewRootController = [[UISplitViewController alloc] init];
+        splitViewRootController.delegate = nil;
         splitViewRootController.view.frame = CGRectMake(0, 0, rect.size.height, rect.size.width);
-
-        MasterViewController *masterViewController = [[MasterViewController alloc] initWithStyle:UITableViewStylePlain];
-        UINavigationController *mainNavController = [[UINavigationController alloc] initWithRootViewController:masterViewController];
-        [masterViewController release];
-
-        splitViewRootController.delegate = detailViewController;
-        masterViewController.detailViewController = detailViewController;
-        splitViewRootController.viewControllers = [NSArray arrayWithObjects: mainNavController, detailedNavController, nil];
-        [mainNavController release];
-        [detailedNavController release];
+        splitViewRootController.viewControllers = [NSArray arrayWithObjects: leftNavController, rightNavController, nil];
+        [leftNavController release];
+        [rightNavController release];
 
         // add view to main controller
         [self.view addSubview:splitViewRootController.view];
     } else {
-        [self.view addSubview:detailedNavController.view];
+        rightNavController.view.frame = CGRectMake(0, 0, rect.size.height, rect.size.width);
+        [self.view addSubview:rightNavController.view];
     }
 
     [super viewDidLoad];
 }
 
 -(void) viewDidUnload {
-    detailViewController = nil;
+    self.activeController = nil;
     MSG_DIDUNLOAD();
     [super viewDidUnload];
 }
 
 -(void) dealloc {
-    [detailViewController release];
+    [self.activeController release];
     [super dealloc];
 }
 
@@ -76,22 +80,22 @@
 // see http://davidebenini.it/2009/01/03/viewwillappear-not-being-called-inside-a-uinavigationcontroller/
 -(void) viewWillAppear:(BOOL)animated {
     [super viewWillAppear:animated];
-    [detailViewController.navigationController viewWillAppear:animated];
+    [self.activeController.navigationController viewWillAppear:animated];
 }
 
 -(void) viewWillDisappear:(BOOL)animated {
     [super viewWillDisappear:animated];
-    [detailViewController.navigationController viewWillDisappear:animated];
+    [self.activeController.navigationController viewWillDisappear:animated];
 }
 
 -(void) viewDidAppear:(BOOL)animated {
     [super viewDidLoad];
-    [detailViewController.navigationController viewDidAppear:animated];
+    [self.activeController.navigationController viewDidAppear:animated];
 }
 
 -(void) viewDidDisappear:(BOOL)animated {
     [super viewDidUnload];
-    [detailViewController.navigationController viewDidDisappear:animated];
+    [self.activeController.navigationController viewDidDisappear:animated];
 }
 
 
--- a/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj	Sun Aug 01 09:17:59 2010 -0400
+++ b/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj	Sun Aug 01 17:58:09 2010 +0200
@@ -37,7 +37,6 @@
 		61370653117B1D50004EE44A /* Entitlements-Distribution.plist in Resources */ = {isa = PBXBuildFile; fileRef = 61370652117B1D50004EE44A /* Entitlements-Distribution.plist */; };
 		61536DF411CEAE7100D87A7E /* GameConfigViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6165924A11CA9CB400D6E256 /* GameConfigViewController.xib */; };
 		6163EE7E11CC2600001C0453 /* SingleWeaponViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6163EE7D11CC2600001C0453 /* SingleWeaponViewController.m */; };
-		6165920C11CA9BA200D6E256 /* DetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616591DF11CA9BA200D6E256 /* DetailViewController.m */; };
 		6165920D11CA9BA200D6E256 /* FlagsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616591E111CA9BA200D6E256 /* FlagsViewController.m */; };
 		6165920E11CA9BA200D6E256 /* FortsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616591E311CA9BA200D6E256 /* FortsViewController.m */; };
 		6165920F11CA9BA200D6E256 /* GameConfigViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616591E511CA9BA200D6E256 /* GameConfigViewController.m */; };
@@ -115,7 +114,6 @@
 		61A118D311683CD100359010 /* HedgewarsTitle.png in Resources */ = {isa = PBXBuildFile; fileRef = 611FD9CB1155A28C00C2203D /* HedgewarsTitle.png */; };
 		61B3D71C11EA6F2700EC7420 /* uKeys.pas in Sources */ = {isa = PBXBuildFile; fileRef = 617987FE114AA34C00BA94A9 /* uKeys.pas */; };
 		61C079E411F35A300072BF46 /* EditableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 61C079E311F35A300072BF46 /* EditableCellView.m */; };
-		61C3255B1179A384001E70B1 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61C3255A1179A384001E70B1 /* OpenAL.framework */; };
 		61E1F4F811D004240016A5AA /* adler32.pas in Sources */ = {isa = PBXBuildFile; fileRef = 61E1F4F711D004240016A5AA /* adler32.pas */; };
 		61EBA62911DFF2BC0048B68A /* bricks.png in Resources */ = {isa = PBXBuildFile; fileRef = 61EBA62711DFF2BC0048B68A /* bricks.png */; };
 		61EBA62A11DFF2BC0048B68A /* title.png in Resources */ = {isa = PBXBuildFile; fileRef = 61EBA62811DFF2BC0048B68A /* title.png */; };
@@ -696,8 +694,6 @@
 		614E333D11DE9A93009DBA4E /* VGSHandlers.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = VGSHandlers.inc; path = ../../hedgewars/VGSHandlers.inc; sourceTree = SOURCE_ROOT; };
 		6163EE7C11CC2600001C0453 /* SingleWeaponViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SingleWeaponViewController.h; sourceTree = "<group>"; };
 		6163EE7D11CC2600001C0453 /* SingleWeaponViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SingleWeaponViewController.m; sourceTree = "<group>"; };
-		616591DE11CA9BA200D6E256 /* DetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetailViewController.h; sourceTree = "<group>"; };
-		616591DF11CA9BA200D6E256 /* DetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DetailViewController.m; sourceTree = "<group>"; };
 		616591E011CA9BA200D6E256 /* FlagsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FlagsViewController.h; sourceTree = "<group>"; };
 		616591E111CA9BA200D6E256 /* FlagsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FlagsViewController.m; sourceTree = "<group>"; };
 		616591E211CA9BA200D6E256 /* FortsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FortsViewController.h; sourceTree = "<group>"; };
@@ -812,7 +808,6 @@
 		61A117FE1168322700359010 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
 		61C079E211F35A300072BF46 /* EditableCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditableCellView.h; sourceTree = "<group>"; };
 		61C079E311F35A300072BF46 /* EditableCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EditableCellView.m; sourceTree = "<group>"; };
-		61C3251D1179A300001E70B1 /* libopenalbridge.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libopenalbridge.a; sourceTree = BUILT_PRODUCTS_DIR; };
 		61C3255A1179A384001E70B1 /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; };
 		61E1F4F711D004240016A5AA /* adler32.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = adler32.pas; path = ../../hedgewars/adler32.pas; sourceTree = SOURCE_ROOT; };
 		61EBA62711DFF2BC0048B68A /* bricks.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = bricks.png; path = "Resources/Frontend-iPad/bricks.png"; sourceTree = "<group>"; };
@@ -878,14 +873,6 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
-		61C3251B1179A300001E70B1 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				61C3255B1179A384001E70B1 /* OpenAL.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
 /* End PBXFrameworksBuildPhase section */
 
 /* Begin PBXGroup section */
@@ -910,7 +897,6 @@
 			children = (
 				1D6058910D05DD3D006BFB54 /* Hedgewars.app */,
 				928301170F10CAFC00CC5A3C /* libfpc.a */,
-				61C3251D1179A300001E70B1 /* libopenalbridge.a */,
 			);
 			name = Products;
 			sourceTree = "<group>";
@@ -1083,8 +1069,6 @@
 				6165920311CA9BA200D6E256 /* SplitViewRootController.m */,
 				616591F411CA9BA200D6E256 /* MasterViewController.h */,
 				616591F511CA9BA200D6E256 /* MasterViewController.m */,
-				616591DE11CA9BA200D6E256 /* DetailViewController.h */,
-				616591DF11CA9BA200D6E256 /* DetailViewController.m */,
 				6163EE4E11CC248D001C0453 /* First Level */,
 				6163EE4F11CC2497001C0453 /* Second Level */,
 				6163EE5011CC24A1001C0453 /* Third Level */,
@@ -1331,16 +1315,6 @@
 		};
 /* End PBXGroup section */
 
-/* Begin PBXHeadersBuildPhase section */
-		61C325191179A300001E70B1 /* Headers */ = {
-			isa = PBXHeadersBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXHeadersBuildPhase section */
-
 /* Begin PBXNativeTarget section */
 		1D6058900D05DD3D006BFB54 /* Hedgewars */ = {
 			isa = PBXNativeTarget;
@@ -1361,23 +1335,6 @@
 			productReference = 1D6058910D05DD3D006BFB54 /* Hedgewars.app */;
 			productType = "com.apple.product-type.application";
 		};
-		61C3251C1179A300001E70B1 /* openalbridge */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 61C325351179A314001E70B1 /* Build configuration list for PBXNativeTarget "openalbridge" */;
-			buildPhases = (
-				61C325191179A300001E70B1 /* Headers */,
-				61C3251A1179A300001E70B1 /* Sources */,
-				61C3251B1179A300001E70B1 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = openalbridge;
-			productName = openalbridge;
-			productReference = 61C3251D1179A300001E70B1 /* libopenalbridge.a */;
-			productType = "com.apple.product-type.library.static";
-		};
 		928301160F10CAFC00CC5A3C /* fpc */ = {
 			isa = PBXNativeTarget;
 			buildConfigurationList = 9283011C0F10CB4B00CC5A3C /* Build configuration list for PBXNativeTarget "fpc" */;
@@ -1441,7 +1398,6 @@
 			targets = (
 				1D6058900D05DD3D006BFB54 /* Hedgewars */,
 				928301160F10CAFC00CC5A3C /* fpc */,
-				61C3251C1179A300001E70B1 /* openalbridge */,
 				6179928B114AE0C800BA94A9 /* UpdateDataFolder */,
 			);
 		};
@@ -2092,7 +2048,6 @@
 				6179883C114AA34C00BA94A9 /* uVisualGears.pas in Sources */,
 				6179883D114AA34C00BA94A9 /* uWorld.pas in Sources */,
 				611F4D4B11B27A9900F9759A /* uScript.pas in Sources */,
-				6165920C11CA9BA200D6E256 /* DetailViewController.m in Sources */,
 				6165920D11CA9BA200D6E256 /* FlagsViewController.m in Sources */,
 				6165920E11CA9BA200D6E256 /* FortsViewController.m in Sources */,
 				6165920F11CA9BA200D6E256 /* GameConfigViewController.m in Sources */,
@@ -2129,13 +2084,6 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
-		61C3251A1179A300001E70B1 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
 /* End PBXSourcesBuildPhase section */
 
 /* Begin PBXTargetDependency section */
@@ -2154,6 +2102,8 @@
 				ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
 				COPY_PHASE_STRIP = NO;
 				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_GENERATE_TEST_COVERAGE_FILES = YES;
+				GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES;
 				GCC_OPTIMIZATION_LEVEL = 0;
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = Hedgewars_Prefix.pch;
@@ -2162,6 +2112,10 @@
 					"$(inherited)",
 					"\"$(SRCROOT)\"",
 				);
+				OTHER_LDFLAGS = (
+					"$(inherited)",
+					"-lgcov",
+				);
 				PRODUCT_NAME = Hedgewars;
 				TARGETED_DEVICE_FAMILY = "1,2";
 			};
@@ -2269,30 +2223,6 @@
 			};
 			name = Distribution;
 		};
-		6137064E117B1CB3004EE44A /* Distribution */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ALWAYS_SEARCH_USER_PATHS = NO;
-				COPY_PHASE_STRIP = YES;
-				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-				GCC_ENABLE_FIX_AND_CONTINUE = NO;
-				HEADER_SEARCH_PATHS = (
-					/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/OpenAL.framework/Headers,
-					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/include\"/**",
-					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src\"/**",
-					"\"$(SRCROOT)/../../../Library/lpng141\"",
-					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_net\"",
-					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_mixer\"",
-					"\"$(SRCROOT)/../../../Library/libvorbis-1.3.1/include\"",
-					"\"$(SRCROOT)/../../../Library/libogg-1.2.0/include\"",
-				);
-				OTHER_LDFLAGS = "";
-				PREBINDING = NO;
-				PRODUCT_NAME = openalbridge;
-				ZERO_LINK = NO;
-			};
-			name = Distribution;
-		};
 		6137064F117B1CB3004EE44A /* Distribution */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
@@ -2383,29 +2313,6 @@
 			};
 			name = Valgrind;
 		};
-		616442A011B5CDE500B9A6F3 /* Valgrind */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ALWAYS_SEARCH_USER_PATHS = NO;
-				COPY_PHASE_STRIP = NO;
-				GCC_DYNAMIC_NO_PIC = NO;
-				GCC_OPTIMIZATION_LEVEL = 0;
-				HEADER_SEARCH_PATHS = (
-					/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/OpenAL.framework/Headers,
-					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/include\"/**",
-					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src\"/**",
-					"\"$(SRCROOT)/../../../Library/lpng141\"",
-					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_net\"",
-					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_mixer\"",
-					"\"$(SRCROOT)/../../../Library/libvorbis-1.3.1/include\"",
-					"\"$(SRCROOT)/../../../Library/libogg-1.2.0/include\"",
-				);
-				OTHER_LDFLAGS = "";
-				PREBINDING = NO;
-				PRODUCT_NAME = openalbridge;
-			};
-			name = Valgrind;
-		};
 		616442A111B5CDE500B9A6F3 /* Valgrind */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
@@ -2437,53 +2344,6 @@
 			};
 			name = Release;
 		};
-		61C3251E1179A300001E70B1 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ALWAYS_SEARCH_USER_PATHS = NO;
-				COPY_PHASE_STRIP = NO;
-				GCC_DYNAMIC_NO_PIC = NO;
-				GCC_OPTIMIZATION_LEVEL = 0;
-				HEADER_SEARCH_PATHS = (
-					/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/OpenAL.framework/Headers,
-					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/include\"/**",
-					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src\"/**",
-					"\"$(SRCROOT)/../../../Library/lpng141\"",
-					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_net\"",
-					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_mixer\"",
-					"\"$(SRCROOT)/../../../Library/libvorbis-1.3.1/include\"",
-					"\"$(SRCROOT)/../../../Library/libogg-1.2.0/include\"",
-				);
-				OTHER_LDFLAGS = "";
-				PREBINDING = NO;
-				PRODUCT_NAME = openalbridge;
-			};
-			name = Debug;
-		};
-		61C3251F1179A300001E70B1 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ALWAYS_SEARCH_USER_PATHS = NO;
-				COPY_PHASE_STRIP = YES;
-				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-				GCC_ENABLE_FIX_AND_CONTINUE = NO;
-				HEADER_SEARCH_PATHS = (
-					/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/OpenAL.framework/Headers,
-					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/include\"/**",
-					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src\"/**",
-					"\"$(SRCROOT)/../../../Library/lpng141\"",
-					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_net\"",
-					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_mixer\"",
-					"\"$(SRCROOT)/../../../Library/libvorbis-1.3.1/include\"",
-					"\"$(SRCROOT)/../../../Library/libogg-1.2.0/include\"",
-				);
-				OTHER_LDFLAGS = "";
-				PREBINDING = NO;
-				PRODUCT_NAME = openalbridge;
-				ZERO_LINK = NO;
-			};
-			name = Release;
-		};
 		928301180F10CAFD00CC5A3C /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
@@ -2623,17 +2483,6 @@
 			defaultConfigurationIsVisible = 0;
 			defaultConfigurationName = Release;
 		};
-		61C325351179A314001E70B1 /* Build configuration list for PBXNativeTarget "openalbridge" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				61C3251E1179A300001E70B1 /* Debug */,
-				61C3251F1179A300001E70B1 /* Release */,
-				6137064E117B1CB3004EE44A /* Distribution */,
-				616442A011B5CDE500B9A6F3 /* Valgrind */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
 		9283011C0F10CB4B00CC5A3C /* Build configuration list for PBXNativeTarget "fpc" */ = {
 			isa = XCConfigurationList;
 			buildConfigurations = (
--- a/project_files/HedgewarsMobile/Hedgewars_Prefix.pch	Sun Aug 01 09:17:59 2010 -0400
+++ b/project_files/HedgewarsMobile/Hedgewars_Prefix.pch	Sun Aug 01 17:58:09 2010 +0200
@@ -6,6 +6,13 @@
 #import <Foundation/Foundation.h>
 #import <CoreGraphics/CoreGraphics.h>
 #import <UIKit/UIKit.h>
+#import "PascalImports.h"
+#import "UIImageExtra.h"
+#import "CommodityFunctions.h"
+#import "SDL.h"
+#import "SDL_video.h"
+#import "SDL_net.h"
+#import "SDL_mixer.h"
 #endif
 
 // by http://www.cimgf.com/2010/05/02/my-current-prefix-pch-file/
@@ -19,7 +26,7 @@
   #endif
   #define ALog(...) NSLog(@"%s %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__])
 #endif
- 
+
 #define ZAssert(condition, ...) do { if (!(condition)) { ALog(__VA_ARGS__); }} while(0)
 
 // by http://blog.coriolis.ch/2009/01/05/macros-for-xcode/