# HG changeset patch # User koda # Date 1272561546 0 # Node ID 0d522416d97f1b9ccad89aa98a8e0f26ab5f5e45 # Parent c1ff724a5c3451150e16ae2ec4af42e3766353a9 lazy loading for all the tables with images (might affect performance but ui feels much more responsive) code rearranged a little game configuration for ipad diff -r c1ff724a5c34 -r 0d522416d97f cocoaTouch/DetailViewController.m --- a/cocoaTouch/DetailViewController.m Thu Apr 29 02:43:28 2010 +0000 +++ b/cocoaTouch/DetailViewController.m Thu Apr 29 17:19:06 2010 +0000 @@ -44,7 +44,6 @@ [self.view addSubview:label]; [label release]; - //[self.navigationController pushViewController:nextController animated:NO]; } else { self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone diff -r c1ff724a5c34 -r 0d522416d97f cocoaTouch/FlagsViewController.h --- a/cocoaTouch/FlagsViewController.h Thu Apr 29 02:43:28 2010 +0000 +++ b/cocoaTouch/FlagsViewController.h Thu Apr 29 17:19:06 2010 +0000 @@ -12,14 +12,12 @@ @interface FlagsViewController : UITableViewController { NSDictionary *teamDictionary; - NSArray *flagArray; - NSArray *flagSprites; - + NSArray *flagArray; NSIndexPath *lastIndexPath; } @property (nonatomic,retain) NSDictionary * teamDictionary; @property (nonatomic,retain) NSArray *flagArray; -@property (nonatomic,retain) NSArray *flagSprites; @property (nonatomic,retain) NSIndexPath *lastIndexPath; + @end diff -r c1ff724a5c34 -r 0d522416d97f cocoaTouch/FlagsViewController.m --- a/cocoaTouch/FlagsViewController.m Thu Apr 29 02:43:28 2010 +0000 +++ b/cocoaTouch/FlagsViewController.m Thu Apr 29 17:19:06 2010 +0000 @@ -10,7 +10,7 @@ #import "CommodityFunctions.h" @implementation FlagsViewController -@synthesize teamDictionary, flagArray, flagSprites, lastIndexPath; +@synthesize teamDictionary, flagArray, lastIndexPath; -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation { @@ -20,60 +20,31 @@ #pragma mark - #pragma mark View lifecycle -- (void)viewDidLoad { +-(void) viewDidLoad { [super viewDidLoad]; - NSString *flagsDirectory = FLAGS_DIRECTORY(); - NSArray *array = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:flagsDirectory error:NULL]; - self.flagArray = array; - - NSMutableArray *spriteArray = [[NSMutableArray alloc] initWithCapacity:[flagArray count]]; - for (NSString *flagName in flagArray) { - NSString *flagFile = [[NSString alloc] initWithFormat:@"%@/%@", flagsDirectory, flagName]; - UIImage *flagSprite = [[UIImage alloc] initWithContentsOfFile:flagFile]; - [flagFile release]; - [spriteArray addObject:flagSprite]; - [flagSprite release]; - } - self.flagSprites = spriteArray; - [spriteArray release]; + self.flagArray = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:FLAGS_DIRECTORY() error:NULL]; } -- (void)viewWillAppear:(BOOL)animated { +-(void) viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [self.tableView reloadData]; [self.tableView setContentOffset:CGPointMake(0,0) animated:NO]; } -/* -- (void)viewDidAppear:(BOOL)animated { - [super viewDidAppear:animated]; -} -*/ -/* -- (void)viewWillDisappear:(BOOL)animated { - [super viewWillDisappear:animated]; -} -*/ -/* -- (void)viewDidDisappear:(BOOL)animated { - [super viewDidDisappear:animated]; -} -*/ - #pragma mark - #pragma mark Table view data source -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { +-(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView { return 1; } -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { +-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [flagArray count]; } // Customize the appearance of table view cells. -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { +-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; @@ -82,8 +53,15 @@ cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } - cell.imageView.image = [flagSprites objectAtIndex:[indexPath row]]; - cell.textLabel.text = [[flagArray objectAtIndex:[indexPath row]] stringByDeletingPathExtension]; + NSString *flag = [flagArray objectAtIndex:[indexPath row]]; + + NSString *flagFile = [[NSString alloc] initWithFormat:@"%@/%@", FLAGS_DIRECTORY(), flag]; + UIImage *flagSprite = [[UIImage alloc] initWithContentsOfFile:flagFile]; + [flagFile release]; + cell.imageView.image = flagSprite; + [flagSprite release]; + + cell.textLabel.text = [flag stringByDeletingPathExtension]; if ([cell.textLabel.text isEqualToString:[self.teamDictionary objectForKey:@"flag"]]) { cell.accessoryType = UITableViewCellAccessoryCheckmark; self.lastIndexPath = indexPath; @@ -95,49 +73,9 @@ } -/* -// Override to support conditional editing of the table view. -- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { - // Return NO if you do not want the specified item to be editable. - return YES; -} -*/ - - -/* -// Override to support editing the table view. -- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { - - if (editingStyle == UITableViewCellEditingStyleDelete) { - // Delete the row from the data source - [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:YES]; - } - else if (editingStyle == UITableViewCellEditingStyleInsert) { - // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view - } -} -*/ - - -/* -// Override to support rearranging the table view. -- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { -} -*/ - - -/* -// Override to support conditional rearranging of the table view. -- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { - // Return NO if you do not want the item to be re-orderable. - return YES; -} -*/ - - #pragma mark - #pragma mark Table view delegate -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { +-(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { int newRow = [indexPath row]; int oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1; @@ -147,38 +85,38 @@ // tell our boss to write this new stuff on disk [[NSNotificationCenter defaultCenter] postNotificationName:@"setWriteNeedTeams" object:nil]; - [self.tableView reloadData]; + UITableViewCell *newCell = [aTableView cellForRowAtIndexPath:indexPath]; + newCell.accessoryType = UITableViewCellAccessoryCheckmark; + UITableViewCell *oldCell = [aTableView cellForRowAtIndexPath:lastIndexPath]; + oldCell.accessoryType = UITableViewCellAccessoryNone; self.lastIndexPath = indexPath; - [self.tableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone]; + [aTableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone]; } - [self.tableView deselectRowAtIndexPath:indexPath animated:YES]; + [aTableView deselectRowAtIndexPath:indexPath animated:YES]; [self.navigationController popViewControllerAnimated:YES]; } #pragma mark - #pragma mark Memory management -- (void)didReceiveMemoryWarning { +-(void) didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Relinquish ownership any cached data, images, etc that aren't in use. } -- (void)viewDidUnload { +-(void) viewDidUnload { self.teamDictionary = nil; self.lastIndexPath = nil; self.flagArray = nil; - self.flagSprites = nil; [super viewDidUnload]; } - -- (void)dealloc { +-(void) dealloc { [teamDictionary release]; [lastIndexPath release]; [flagArray release]; - [flagSprites release]; [super dealloc]; } diff -r c1ff724a5c34 -r 0d522416d97f cocoaTouch/FortsViewController.h --- a/cocoaTouch/FortsViewController.h Thu Apr 29 02:43:28 2010 +0000 +++ b/cocoaTouch/FortsViewController.h Thu Apr 29 17:19:06 2010 +0000 @@ -13,13 +13,12 @@ NSDictionary *teamDictionary; NSArray *fortArray; - NSArray *fortSprites; - +// NSArray *fortSprites; NSIndexPath *lastIndexPath; } @property (nonatomic,retain) NSDictionary * teamDictionary; @property (nonatomic,retain) NSArray *fortArray; -@property (nonatomic,retain) NSArray *fortSprites; +//@property (nonatomic,retain) NSArray *fortSprites; @property (nonatomic,retain) NSIndexPath *lastIndexPath; @end diff -r c1ff724a5c34 -r 0d522416d97f cocoaTouch/FortsViewController.m --- a/cocoaTouch/FortsViewController.m Thu Apr 29 02:43:28 2010 +0000 +++ b/cocoaTouch/FortsViewController.m Thu Apr 29 17:19:06 2010 +0000 @@ -11,7 +11,7 @@ #import "UIImageExtra.h" @implementation FortsViewController -@synthesize teamDictionary, fortArray, fortSprites, lastIndexPath; +@synthesize teamDictionary, fortArray, lastIndexPath; -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation { @@ -21,11 +21,10 @@ #pragma mark - #pragma mark View lifecycle -- (void)viewDidLoad { +-(void) viewDidLoad { [super viewDidLoad]; - NSString *fortsDirectory = FORTS_DIRECTORY(); - NSArray *directoryContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath: fortsDirectory error:NULL]; + NSArray *directoryContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:FORTS_DIRECTORY() error:NULL]; NSMutableArray *filteredContents = [[NSMutableArray alloc] initWithCapacity:([directoryContents count] / 2)]; // we need to remove the double entries and the L.png suffix for (int i = 0; i < [directoryContents count]; i++) { @@ -35,12 +34,10 @@ [filteredContents addObject:correctName]; } } - self.fortArray = filteredContents; [filteredContents release]; - //NSLog(@"%@",fortArray); - + /* // this creates a scaled down version of the image NSMutableArray *spriteArray = [[NSMutableArray alloc] initWithCapacity:[fortArray count]]; for (NSString *fortName in fortArray) { @@ -52,6 +49,7 @@ } self.fortSprites = spriteArray; [spriteArray release]; + */ // statically set row height instead of using delegate method for performance reasons self.tableView.rowHeight = 200; @@ -64,36 +62,19 @@ [self.tableView setContentOffset:CGPointMake(0,0) animated:NO]; } -/* -- (void)viewDidAppear:(BOOL)animated { - [super viewDidAppear:animated]; -} -*/ -/* -- (void)viewWillDisappear:(BOOL)animated { - [super viewWillDisappear:animated]; -} -*/ -/* -- (void)viewDidDisappear:(BOOL)animated { - [super viewDidDisappear:animated]; -} -*/ - #pragma mark - #pragma mark Table view data source -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { +-(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView { return 1; } -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return [fortArray count]; +-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return [self.fortArray count]; } // Customize the appearance of table view cells. -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - +-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; @@ -102,8 +83,17 @@ reuseIdentifier:CellIdentifier] autorelease]; } - cell.imageView.image = [fortSprites objectAtIndex:[indexPath row]]; - cell.textLabel.text = [fortArray objectAtIndex:[indexPath row]]; + NSString *fortName = [fortArray objectAtIndex:[indexPath row]]; + cell.textLabel.text = fortName; + + // this creates a scaled down version of the image + // TODO: create preview files, scaling is way too slow! + NSString *fortFile = [[NSString alloc] initWithFormat:@"%@/%@L.png", FORTS_DIRECTORY(), fortName]; + UIImage *fortSprite = [[UIImage alloc] initWithContentsOfFile:fortFile]; + [fortFile release]; + cell.imageView.image = [fortSprite scaleToSize:CGSizeMake(196,196)]; + [fortSprite release]; + cell.detailTextLabel.text = @"Insert funny description here"; if ([cell.textLabel.text isEqualToString:[self.teamDictionary objectForKey:@"fort"]]) { cell.accessoryType = UITableViewCellAccessoryCheckmark; @@ -116,49 +106,9 @@ } -/* -// Override to support conditional editing of the table view. -- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { - // Return NO if you do not want the specified item to be editable. - return YES; -} -*/ - - -/* -// Override to support editing the table view. -- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { - - if (editingStyle == UITableViewCellEditingStyleDelete) { - // Delete the row from the data source - [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:YES]; - } - else if (editingStyle == UITableViewCellEditingStyleInsert) { - // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view - } -} -*/ - - -/* -// Override to support rearranging the table view. -- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { -} -*/ - - -/* -// Override to support conditional rearranging of the table view. -- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { - // Return NO if you do not want the item to be re-orderable. - return YES; -} -*/ - - #pragma mark - #pragma mark Table view delegate --(void) tableView:(UITableView *)atableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { +-(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { int newRow = [indexPath row]; int oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1; @@ -168,12 +118,15 @@ // tell our boss to write this new stuff on disk [[NSNotificationCenter defaultCenter] postNotificationName:@"setWriteNeedTeams" object:nil]; - [self.tableView reloadData]; - + + UITableViewCell *newCell = [aTableView cellForRowAtIndexPath:indexPath]; + newCell.accessoryType = UITableViewCellAccessoryCheckmark; + UITableViewCell *oldCell = [aTableView cellForRowAtIndexPath:lastIndexPath]; + oldCell.accessoryType = UITableViewCellAccessoryNone; self.lastIndexPath = indexPath; - [self.tableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone]; + [aTableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone]; } - [self.tableView deselectRowAtIndexPath:indexPath animated:YES]; + [aTableView deselectRowAtIndexPath:indexPath animated:YES]; [self.navigationController popViewControllerAnimated:YES]; } @@ -190,7 +143,7 @@ self.teamDictionary = nil; self.lastIndexPath = nil; self.fortArray = nil; - self.fortSprites = nil; +// self.fortSprites = nil; [super viewDidUnload]; } @@ -199,7 +152,7 @@ [teamDictionary release]; [lastIndexPath release]; [fortArray release]; - [fortSprites release]; +// [fortSprites release]; [super dealloc]; } diff -r c1ff724a5c34 -r 0d522416d97f cocoaTouch/GameConfigViewController.h --- a/cocoaTouch/GameConfigViewController.h Thu Apr 29 02:43:28 2010 +0000 +++ b/cocoaTouch/GameConfigViewController.h Thu Apr 29 17:19:06 2010 +0000 @@ -11,25 +11,12 @@ @class TeamConfigViewController; @class MapConfigViewController; -@interface GameConfigViewController : UIViewController { - UITableView *availableTeamsTableView; - UIButton *mapButton; - UIButton *randomButton; - UIButton *weaponsButton; - UIButton *schemesButton; - UIBarButtonItem *startButton; - +@interface GameConfigViewController : UIViewController { UIViewController *activeController; MapConfigViewController *mapConfigViewController; TeamConfigViewController *teamConfigViewController; } -@property (nonatomic,retain) IBOutlet UITableView *availableTeamsTableView; -@property (nonatomic,retain) IBOutlet UIButton *weaponsButton; -@property (nonatomic,retain) IBOutlet UIButton *schemesButton; -@property (nonatomic,retain) IBOutlet UIButton *mapButton; -@property (nonatomic,retain) IBOutlet UIButton *randomButton; -@property (nonatomic,retain) IBOutlet UIBarButtonItem *startButton; -(IBAction) buttonPressed:(id) sender; -(IBAction) segmentPressed:(id) sender; diff -r c1ff724a5c34 -r 0d522416d97f cocoaTouch/GameConfigViewController.m --- a/cocoaTouch/GameConfigViewController.m Thu Apr 29 02:43:28 2010 +0000 +++ b/cocoaTouch/GameConfigViewController.m Thu Apr 29 17:19:06 2010 +0000 @@ -13,7 +13,6 @@ #import "TeamConfigViewController.h" @implementation GameConfigViewController -@synthesize availableTeamsTableView, weaponsButton, schemesButton, mapButton, randomButton, startButton; -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { @@ -105,7 +104,14 @@ } -(void) viewDidLoad { - mapConfigViewController = [[MapConfigViewController alloc] initWithNibName:@"MapConfigViewController-iPhone" bundle:nil]; + if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { + mapConfigViewController = [[MapConfigViewController alloc] initWithNibName:@"MapConfigViewController-iPad" bundle:nil]; + teamConfigViewController = [[TeamConfigViewController alloc] initWithStyle:UITableViewStylePlain]; + teamConfigViewController.view.frame = CGRectMake(0, 224, 300, 500); + teamConfigViewController.view.backgroundColor = [UIColor clearColor]; + [mapConfigViewController.view addSubview:teamConfigViewController.view]; + } else + mapConfigViewController = [[MapConfigViewController alloc] initWithNibName:@"MapConfigViewController-iPhone" bundle:nil]; activeController = mapConfigViewController; [self.view addSubview:mapConfigViewController.view]; @@ -139,12 +145,6 @@ activeController = nil; mapConfigViewController = nil; teamConfigViewController = nil; - self.availableTeamsTableView = nil; - self.weaponsButton = nil; - self.schemesButton = nil; - self.mapButton = nil; - self.randomButton = nil; - self.startButton = nil; [super viewDidUnload]; } @@ -153,12 +153,6 @@ [activeController release]; [mapConfigViewController release]; [teamConfigViewController release]; - [availableTeamsTableView release]; - [weaponsButton release]; - [schemesButton release]; - [mapButton release]; - [randomButton release]; - [startButton release]; [super dealloc]; } diff -r c1ff724a5c34 -r 0d522416d97f cocoaTouch/GravesViewController.h --- a/cocoaTouch/GravesViewController.h Thu Apr 29 02:43:28 2010 +0000 +++ b/cocoaTouch/GravesViewController.h Thu Apr 29 17:19:06 2010 +0000 @@ -13,13 +13,11 @@ NSMutableDictionary *teamDictionary; NSArray *graveArray; - NSArray *graveSprites; NSIndexPath *lastIndexPath; } @property (nonatomic,retain) NSMutableDictionary *teamDictionary; @property (nonatomic,retain) NSArray *graveArray; -@property (nonatomic,retain) NSArray *graveSprites; @property (nonatomic,retain) NSIndexPath *lastIndexPath; @end diff -r c1ff724a5c34 -r 0d522416d97f cocoaTouch/GravesViewController.m --- a/cocoaTouch/GravesViewController.m Thu Apr 29 02:43:28 2010 +0000 +++ b/cocoaTouch/GravesViewController.m Thu Apr 29 17:19:06 2010 +0000 @@ -11,7 +11,7 @@ #import "UIImageExtra.h" @implementation GravesViewController -@synthesize teamDictionary, graveArray, graveSprites, lastIndexPath; +@synthesize teamDictionary, graveArray, lastIndexPath; -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation { @@ -21,50 +21,20 @@ #pragma mark - #pragma mark View lifecycle -- (void)viewDidLoad { +-(void) viewDidLoad { [super viewDidLoad]; - // load all the voices names and store them into voiceArray - NSArray *array = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:GRAVES_DIRECTORY() error:NULL]; - self.graveArray = array; - - NSMutableArray *sprites = [[NSMutableArray alloc] initWithCapacity:[graveArray count]]; - for (NSString *graveName in graveArray) { - NSString *gravePath = [[NSString alloc] initWithFormat:@"%@/%@",GRAVES_DIRECTORY(),graveName]; - // because we also have multi frame graves, let's take the first one only - UIImage *graveSprite = [[UIImage alloc] initWithContentsOfFile:gravePath andCutAt:CGRectMake(0, 0, 32, 32)]; - [gravePath release]; - - [sprites addObject:graveSprite]; - [graveSprite release]; - } - self.graveSprites = sprites; - [sprites release]; + // load all the grave names and store them into graveArray + self.graveArray = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:GRAVES_DIRECTORY() error:NULL]; } -- (void)viewWillAppear:(BOOL)animated { +-(void) viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; - + [self.tableView reloadData]; // this moves the tableview to the top [self.tableView setContentOffset:CGPointMake(0,0) animated:NO]; } -/* -- (void)viewDidAppear:(BOOL)animated { - [super viewDidAppear:animated]; -} -*/ -/* -- (void)viewWillDisappear:(BOOL)animated { - [super viewWillDisappear:animated]; -} -*/ -/* -- (void)viewDidDisappear:(BOOL)animated { - [super viewDidDisappear:animated]; -} -*/ - #pragma mark - #pragma mark Table view data source @@ -77,7 +47,7 @@ } // Customize the appearance of table view cells. -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { +-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; @@ -85,8 +55,8 @@ if (cell == nil) cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; - NSString *grave = [[graveArray objectAtIndex:[indexPath row]] stringByDeletingPathExtension]; - cell.textLabel.text = grave; + NSString *grave = [graveArray objectAtIndex:[indexPath row]]; + cell.textLabel.text = [grave stringByDeletingPathExtension]; if ([grave isEqualToString:[teamDictionary objectForKey:@"grave"]]) { cell.accessoryType = UITableViewCellAccessoryCheckmark; @@ -94,52 +64,18 @@ } else { cell.accessoryType = UITableViewCellAccessoryNone; } + + NSString *graveFilePath = [[NSString alloc] initWithFormat:@"%@/%@",GRAVES_DIRECTORY(),grave]; + // because we also have multi frame graves, let's take the first one only + UIImage *graveSprite = [[UIImage alloc] initWithContentsOfFile:graveFilePath andCutAt:CGRectMake(0, 0, 32, 32)]; + [graveFilePath release]; + cell.imageView.image = graveSprite; + [graveSprite release]; - cell.imageView.image = [graveSprites objectAtIndex:[indexPath row]]; return cell; } -/* -// Override to support conditional editing of the table view. -- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { - // Return NO if you do not want the specified item to be editable. - return YES; -} -*/ - - -/* -// Override to support editing the table view. -- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { - - if (editingStyle == UITableViewCellEditingStyleDelete) { - // Delete the row from the data source - [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:YES]; - } - else if (editingStyle == UITableViewCellEditingStyleInsert) { - // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view - } -} -*/ - - -/* -// Override to support rearranging the table view. -- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { -} -*/ - - -/* -// Override to support conditional rearranging of the table view. -- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { - // Return NO if you do not want the item to be re-orderable. - return YES; -} -*/ - - #pragma mark - #pragma mark Table view delegate -(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { @@ -151,12 +87,15 @@ // tell our boss to write this new stuff on disk [[NSNotificationCenter defaultCenter] postNotificationName:@"setWriteNeedTeams" object:nil]; - [self.tableView reloadData]; + UITableViewCell *newCell = [aTableView cellForRowAtIndexPath:indexPath]; + newCell.accessoryType = UITableViewCellAccessoryCheckmark; + UITableViewCell *oldCell = [aTableView cellForRowAtIndexPath:lastIndexPath]; + oldCell.accessoryType = UITableViewCellAccessoryNone; self.lastIndexPath = indexPath; - [self.tableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone]; + [aTableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone]; } - [self.tableView deselectRowAtIndexPath:indexPath animated:YES]; + [aTableView deselectRowAtIndexPath:indexPath animated:YES]; [self.navigationController popViewControllerAnimated:YES]; } @@ -174,11 +113,9 @@ self.lastIndexPath = nil; self.teamDictionary = nil; self.graveArray = nil; - self.graveSprites = nil; } - (void)dealloc { - [graveSprites release]; [graveArray release]; [teamDictionary release]; [lastIndexPath release]; diff -r c1ff724a5c34 -r 0d522416d97f cocoaTouch/HogHatViewController.h --- a/cocoaTouch/HogHatViewController.h Thu Apr 29 02:43:28 2010 +0000 +++ b/cocoaTouch/HogHatViewController.h Thu Apr 29 17:19:06 2010 +0000 @@ -14,14 +14,14 @@ NSInteger selectedHog; NSArray *hatArray; - NSArray *hatSprites; + UIImage *normalHogSprite; NSIndexPath *lastIndexPath; } @property (nonatomic,retain) NSDictionary *teamDictionary; @property (nonatomic) NSInteger selectedHog; @property (nonatomic,retain) NSArray *hatArray; -@property (nonatomic,retain) NSArray *hatSprites; +@property (nonatomic,retain) UIImage *normalHogSprite; @property (nonatomic,retain) NSIndexPath *lastIndexPath; @end diff -r c1ff724a5c34 -r 0d522416d97f cocoaTouch/HogHatViewController.m --- a/cocoaTouch/HogHatViewController.m Thu Apr 29 02:43:28 2010 +0000 +++ b/cocoaTouch/HogHatViewController.m Thu Apr 29 17:19:06 2010 +0000 @@ -11,7 +11,7 @@ #import "UIImageExtra.h" @implementation HogHatViewController -@synthesize teamDictionary, hatArray, hatSprites, lastIndexPath, selectedHog; +@synthesize teamDictionary, hatArray, normalHogSprite, lastIndexPath, selectedHog; -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation { @@ -29,22 +29,12 @@ NSArray *array = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:hatsDirectory error:NULL]; self.hatArray = array; + // load the base hog image, drawing will occure in cellForRow... NSString *normalHogFile = [[NSString alloc] initWithFormat:@"%@/Hedgehog.png",GRAPHICS_DIRECTORY()]; - UIImage *normalHogSprite = [[UIImage alloc] initWithContentsOfFile:normalHogFile andCutAt:CGRectMake(96, 0, 32, 32)]; + UIImage *hogSprite = [[UIImage alloc] initWithContentsOfFile:normalHogFile andCutAt:CGRectMake(96, 0, 32, 32)]; [normalHogFile release]; - - // load all the hat images from the previous array but save only the first sprite and store it in hatSprites - NSMutableArray *spriteArray = [[NSMutableArray alloc] initWithCapacity:[hatArray count]]; - for (NSString *hat in hatArray) { - NSString *hatFile = [[NSString alloc] initWithFormat:@"%@/%@", hatsDirectory,hat]; - UIImage *hatSprite = [[UIImage alloc] initWithContentsOfFile: hatFile andCutAt:CGRectMake(0, 0, 32, 32)]; - [hatFile release]; - [spriteArray addObject:[normalHogSprite mergeWith:hatSprite atPoint:CGPointMake(0, -5)]]; - [hatSprite release]; - } - [normalHogSprite release]; - self.hatSprites = spriteArray; - [spriteArray release]; + self.normalHogSprite = hogSprite; + [hogSprite release]; } - (void)viewWillAppear:(BOOL)animated { @@ -57,22 +47,6 @@ [self.tableView setContentOffset:CGPointMake(0,0) animated:NO]; } -/* -- (void)viewDidAppear:(BOOL)animated { - [super viewDidAppear:animated]; -} -*/ -/* -- (void)viewWillDisappear:(BOOL)animated { - [super viewWillDisappear:animated]; -} -*/ -/* -- (void)viewDidDisappear:(BOOL)animated { - [super viewDidDisappear:animated]; -} -*/ - #pragma mark - #pragma mark Table view data source @@ -90,16 +64,19 @@ static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; - if (cell == nil) { + if (cell == nil) cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; - } NSDictionary *hog = [[self.teamDictionary objectForKey:@"hedgehogs"] objectAtIndex:selectedHog]; + NSString *hat = [hatArray objectAtIndex:[indexPath row]]; + cell.textLabel.text = [hat stringByDeletingPathExtension]; - NSString *hat = [[hatArray objectAtIndex:[indexPath row]] stringByDeletingPathExtension]; - cell.textLabel.text = hat; - cell.imageView.image = [hatSprites objectAtIndex:[indexPath row]]; - + NSString *hatFile = [[NSString alloc] initWithFormat:@"%@/%@", HATS_DIRECTORY(), hat]; + UIImage *hatSprite = [[UIImage alloc] initWithContentsOfFile: hatFile andCutAt:CGRectMake(0, 0, 32, 32)]; + [hatFile release]; + cell.imageView.image = [self.normalHogSprite mergeWith:hatSprite atPoint:CGPointMake(0, -5)]; + [hatSprite release]; + if ([hat isEqualToString:[hog objectForKey:@"hat"]]) { cell.accessoryType = UITableViewCellAccessoryCheckmark; self.lastIndexPath = indexPath; @@ -111,46 +88,6 @@ } -/* -// Override to support conditional editing of the table view. -- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { - // Return NO if you do not want the specified item to be editable. - return YES; -} -*/ - - -/* -// Override to support editing the table view. -- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { - - if (editingStyle == UITableViewCellEditingStyleDelete) { - // Delete the row from the data source - [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:YES]; - } - else if (editingStyle == UITableViewCellEditingStyleInsert) { - // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view - } -} -*/ - - -/* -// Override to support rearranging the table view. -- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { -} -*/ - - -/* -// Override to support conditional rearranging of the table view. -- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { - // Return NO if you do not want the item to be re-orderable. - return YES; -} -*/ - - #pragma mark - #pragma mark Table view delegate - (void)tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { @@ -159,7 +96,7 @@ if (newRow != oldRow) { // if the two selected rows differ update data on the hog dictionary and reload table content - // TODO: maybe this section could be cleaned up + // TODO: maybe this section could be cleaned up NSDictionary *oldHog = [[teamDictionary objectForKey:@"hedgehogs"] objectAtIndex:selectedHog]; NSMutableDictionary *newHog = [[NSMutableDictionary alloc] initWithDictionary: oldHog]; @@ -169,12 +106,15 @@ // tell our boss to write this new stuff on disk [[NSNotificationCenter defaultCenter] postNotificationName:@"setWriteNeedTeams" object:nil]; - [self.tableView reloadData]; + UITableViewCell *newCell = [aTableView cellForRowAtIndexPath:indexPath]; + newCell.accessoryType = UITableViewCellAccessoryCheckmark; + UITableViewCell *oldCell = [aTableView cellForRowAtIndexPath:lastIndexPath]; + oldCell.accessoryType = UITableViewCellAccessoryNone; self.lastIndexPath = indexPath; - [self.tableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone]; + [aTableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone]; } - [self.tableView deselectRowAtIndexPath:indexPath animated:YES]; + [aTableView deselectRowAtIndexPath:indexPath animated:YES]; [self.navigationController popViewControllerAnimated:YES]; } @@ -190,7 +130,7 @@ - (void)viewDidUnload { [super viewDidUnload]; self.lastIndexPath = nil; - self.hatSprites = nil; + self.normalHogSprite = nil; self.teamDictionary = nil; self.hatArray = nil; } @@ -198,7 +138,7 @@ - (void)dealloc { [hatArray release]; [teamDictionary release]; - [hatSprites release]; + [normalHogSprite release]; [lastIndexPath release]; [super dealloc]; } diff -r c1ff724a5c34 -r 0d522416d97f cocoaTouch/LevelViewController.m --- a/cocoaTouch/LevelViewController.m Thu Apr 29 02:43:28 2010 +0000 +++ b/cocoaTouch/LevelViewController.m Thu Apr 29 17:19:06 2010 +0000 @@ -34,44 +34,15 @@ nil]; self.levelArray = array; [array release]; - - NSMutableArray *sprites = [[NSMutableArray alloc] initWithCapacity:[levelArray count]]; - for (int i = 0; i < [levelArray count]; i++) { - NSString *botlevelPath = [[NSString alloc] initWithFormat:@"%@/%d.png",BOTLEVELS_DIRECTORY(),i]; - UIImage *image = [[UIImage alloc] initWithContentsOfFile:botlevelPath]; - [botlevelPath release]; - [sprites addObject:image]; - [image release]; - } - self.levelSprites = sprites; - [sprites release]; - } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; - + [self.tableView reloadData]; // this moves the tableview to the top [self.tableView setContentOffset:CGPointMake(0,0) animated:NO]; } -/* -- (void)viewDidAppear:(BOOL)animated { - [super viewDidAppear:animated]; -} -*/ -/* -- (void)viewWillDisappear:(BOOL)animated { - [super viewWillDisappear:animated]; -} -*/ -/* -- (void)viewDidDisappear:(BOOL)animated { - [super viewDidDisappear:animated]; -} -*/ - - #pragma mark - #pragma mark Table view data source -(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView { @@ -101,7 +72,12 @@ cell.accessoryType = UITableViewCellAccessoryNone; } - cell.imageView.image = [levelSprites objectAtIndex:row]; + NSString *botlevelPath = [[NSString alloc] initWithFormat:@"%@/%d.png",BOTLEVELS_DIRECTORY(),row]; + UIImage *levelImage = [[UIImage alloc] initWithContentsOfFile:botlevelPath]; + [botlevelPath release]; + cell.imageView.image = levelImage; + [levelImage release]; + return cell; } diff -r c1ff724a5c34 -r 0d522416d97f cocoaTouch/MainMenuViewController.m --- a/cocoaTouch/MainMenuViewController.m Thu Apr 29 02:43:28 2010 +0000 +++ b/cocoaTouch/MainMenuViewController.m Thu Apr 29 17:19:06 2010 +0000 @@ -131,7 +131,7 @@ switch (button.tag) { case 0: - if (nil == gameConfigViewController) { + if (1) { // bug in UIModalTransitionStylePartialCurl? if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) configNibName = @"GameConfigViewController-iPad"; else @@ -145,7 +145,7 @@ #endif } - [self presentModalViewController:gameConfigViewController animated:YES]; + [self presentModalViewController:gameConfigViewController animated:YES]; break; case 2: if (nil == splitRootViewController) { diff -r c1ff724a5c34 -r 0d522416d97f cocoaTouch/MapConfigViewController.m --- a/cocoaTouch/MapConfigViewController.m Thu Apr 29 02:43:28 2010 +0000 +++ b/cocoaTouch/MapConfigViewController.m Thu Apr 29 17:19:06 2010 +0000 @@ -35,10 +35,8 @@ -(void) engineProtocol:(NSInteger) port { IPaddress ip; - BOOL clientQuit, serverQuit; - - serverQuit = NO; - clientQuit =NO; + BOOL serverQuit = NO; + if (SDLNet_Init() < 0) { NSLog(@"SDLNet_Init: %s", SDLNet_GetError()); serverQuit = YES; @@ -94,7 +92,7 @@ // draw the buffer (1 pixel per component, 0= transparent 1= color) int xc = 0; - int yc = 0; + int yc = -1; UIGraphicsBeginImageContext(CGSizeMake(256,128)); CGContextRef context = UIGraphicsGetCurrentContext(); UIGraphicsPushContext(context); @@ -407,14 +405,15 @@ self.mapGenCommand = mapgen; [self updatePreview]; - // nice animation for updating the table when needed - if (((oldPage == 0 || oldPage == 2) && newPage == 1) || - (oldPage == 1 && (newPage == 0 || newPage == 2))) { - [UIView beginAnimations:@"moving out table" context:NULL]; - self.tableView.frame = CGRectMake(480, 0, 185, 276); - [UIView commitAnimations]; - [self performSelector:@selector(moveTable) withObject:nil afterDelay:0.2]; - } + // nice animation for updating the table when appropriate (on iphone) + if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) + if (((oldPage == 0 || oldPage == 2) && newPage == 1) || + (oldPage == 1 && (newPage == 0 || newPage == 2))) { + [UIView beginAnimations:@"moving out table" context:NULL]; + self.tableView.frame = CGRectMake(480, 0, 185, 276); + [UIView commitAnimations]; + [self performSelector:@selector(moveTable) withObject:nil afterDelay:0.2]; + } oldPage = newPage; } @@ -457,6 +456,7 @@ self.templateFilterCommand = @"e$template_filter 0"; self.mazeSizeCommand = @"e$maze_size 0"; self.mapGenCommand = @"e$mapgen 0"; + self.lastIndexPath = [NSIndexPath indexPathForRow:0 inSection:0]; oldValue = 5; oldPage = 0; diff -r c1ff724a5c34 -r 0d522416d97f cocoaTouch/SDLOverrides/SDL_uikitappdelegate.h --- a/cocoaTouch/SDLOverrides/SDL_uikitappdelegate.h Thu Apr 29 02:43:28 2010 +0000 +++ b/cocoaTouch/SDLOverrides/SDL_uikitappdelegate.h Thu Apr 29 17:19:06 2010 +0000 @@ -42,13 +42,3 @@ @end -#ifndef __IPHONE_3_2 // if iPhoneOS is 3.2 or greater then __IPHONE_3_2 will be defined - -typedef enum { - UIUserInterfaceIdiomPhone, // iPhone and iPod touch style UI - UIUserInterfaceIdiomPad, // iPad style UI -} UIUserInterfaceIdiom; - -#define UI_USER_INTERFACE_IDIOM() UIUserInterfaceIdiomPhone - -#endif // ifndef __IPHONE_3_2 diff -r c1ff724a5c34 -r 0d522416d97f cocoaTouch/SDLOverrides/SDL_uikitappdelegate.m --- a/cocoaTouch/SDLOverrides/SDL_uikitappdelegate.m Thu Apr 29 02:43:28 2010 +0000 +++ b/cocoaTouch/SDLOverrides/SDL_uikitappdelegate.m Thu Apr 29 17:19:06 2010 +0000 @@ -30,6 +30,7 @@ #import "PascalImports.h" #import "MainMenuViewController.h" #import "OverlayViewController.h" +#import "CommodityFunctions.h" #ifdef main #undef main @@ -121,7 +122,7 @@ else viewController = [[MainMenuViewController alloc] initWithNibName:@"MainMenuViewController-iPhone" bundle:nil]; [uiwindow addSubview:viewController.view]; - + // Set working directory to resource path [[NSFileManager defaultManager] changeCurrentDirectoryPath:[[NSBundle mainBundle] resourcePath]]; diff -r c1ff724a5c34 -r 0d522416d97f cocoaTouch/SingleTeamViewController.h --- a/cocoaTouch/SingleTeamViewController.h Thu Apr 29 02:43:28 2010 +0000 +++ b/cocoaTouch/SingleTeamViewController.h Thu Apr 29 17:19:06 2010 +0000 @@ -19,7 +19,7 @@ UITextField *textFieldBeingEdited; NSString *teamName; - NSArray *hatArray; + UIImage *normalHogSprite; NSArray *secondaryItems; BOOL isWriteNeeded; @@ -35,7 +35,7 @@ @property (nonatomic,retain) NSMutableDictionary *teamDictionary; @property (nonatomic,retain) UITextField *textFieldBeingEdited; @property (nonatomic,retain) NSString *teamName; -@property (nonatomic,retain) NSArray *hatArray; +@property (nonatomic,retain) UIImage *normalHogSprite; @property (nonatomic,retain) NSArray *secondaryItems; -(void) writeFile; diff -r c1ff724a5c34 -r 0d522416d97f cocoaTouch/SingleTeamViewController.m --- a/cocoaTouch/SingleTeamViewController.m Thu Apr 29 02:43:28 2010 +0000 +++ b/cocoaTouch/SingleTeamViewController.m Thu Apr 29 17:19:06 2010 +0000 @@ -19,7 +19,7 @@ #define TEAMNAME_TAG 1234 @implementation SingleTeamViewController -@synthesize teamDictionary, hatArray, secondaryItems, textFieldBeingEdited, teamName; +@synthesize teamDictionary, normalHogSprite, secondaryItems, textFieldBeingEdited, teamName; -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation { @@ -106,6 +106,13 @@ self.secondaryItems = array; [array release]; + // load the base hog image, drawing will occure in cellForRow... + NSString *normalHogFile = [[NSString alloc] initWithFormat:@"%@/Hedgehog.png",GRAPHICS_DIRECTORY()]; + UIImage *hogSprite = [[UIImage alloc] initWithContentsOfFile:normalHogFile andCutAt:CGRectMake(96, 0, 32, 32)]; + [normalHogFile release]; + self.normalHogSprite = hogSprite; + [hogSprite release]; + // listen if any childController modifies the plist and write it if needed [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setWriteNeeded) name:@"setWriteNeedTeams" object:nil]; isWriteNeeded = NO; @@ -126,26 +133,6 @@ self.teamName = self.title; - // load the images of the hat for aach hog - NSString *normalHogFile = [[NSString alloc] initWithFormat:@"%@/Hedgehog.png",GRAPHICS_DIRECTORY()]; - UIImage *normalHogSprite = [[UIImage alloc] initWithContentsOfFile:normalHogFile andCutAt:CGRectMake(96, 0, 32, 32)]; - [normalHogFile release]; - - NSArray *hogArray = [self.teamDictionary objectForKey:@"hedgehogs"]; - NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:[hogArray count]]; - for (NSDictionary *hog in hogArray) { - NSString *hatFile = [[NSString alloc] initWithFormat:@"%@/%@.png",HATS_DIRECTORY(),[hog objectForKey:@"hat"]]; - - UIImage *hatSprite = [[UIImage alloc] initWithContentsOfFile:hatFile andCutAt:CGRectMake(0, 0, 32, 32)]; - [hatFile release]; - - [array addObject:[normalHogSprite mergeWith:hatSprite atPoint:CGPointMake(0, -5)]]; - [hatSprite release]; - } - [normalHogSprite release]; - self.hatArray = array; - [array release]; - [self.tableView reloadData]; } @@ -276,8 +263,12 @@ hogArray = [self.teamDictionary objectForKey:@"hedgehogs"]; - cell.imageView.image = [self.hatArray objectAtIndex:row]; - + NSString *hatFile = [[NSString alloc] initWithFormat:@"%@/%@.png", HATS_DIRECTORY(), [[hogArray objectAtIndex:row] objectForKey:@"hat"]]; + UIImage *hatSprite = [[UIImage alloc] initWithContentsOfFile: hatFile andCutAt:CGRectMake(0, 0, 32, 32)]; + [hatFile release]; + cell.imageView.image = [self.normalHogSprite mergeWith:hatSprite atPoint:CGPointMake(0, -5)]; + [hatSprite release]; + for (UIView *oneView in cell.contentView.subviews) { if ([oneView isMemberOfClass:[UITextField class]]) { // we find the uitextfied and we'll use its tag to understand which one is being edited @@ -421,7 +412,7 @@ self.teamDictionary = nil; self.textFieldBeingEdited = nil; self.teamName = nil; - self.hatArray = nil; + self.normalHogSprite = nil; self.secondaryItems = nil; hogHatViewController = nil; flagsViewController = nil; @@ -435,7 +426,7 @@ [teamDictionary release]; [textFieldBeingEdited release]; [teamName release]; - [hatArray release]; + [normalHogSprite release]; [secondaryItems release]; [hogHatViewController release]; [fortsViewController release]; diff -r c1ff724a5c34 -r 0d522416d97f cocoaTouch/SplitViewRootController.h --- a/cocoaTouch/SplitViewRootController.h Thu Apr 29 02:43:28 2010 +0000 +++ b/cocoaTouch/SplitViewRootController.h Thu Apr 29 17:19:06 2010 +0000 @@ -13,6 +13,4 @@ DetailViewController *detailViewController; } -@property (nonatomic,retain) DetailViewController *detailViewController; - @end diff -r c1ff724a5c34 -r 0d522416d97f cocoaTouch/SplitViewRootController.m --- a/cocoaTouch/SplitViewRootController.m Thu Apr 29 02:43:28 2010 +0000 +++ b/cocoaTouch/SplitViewRootController.m Thu Apr 29 17:19:06 2010 +0000 @@ -12,7 +12,6 @@ #import "CommodityFunctions.h" @implementation SplitViewRootController -@synthesize detailViewController; -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { @@ -28,24 +27,26 @@ // 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 { - self.detailViewController = [[DetailViewController alloc] initWithStyle:UITableViewStyleGrouped]; - [detailViewController release]; - UINavigationController *detailedNavController = [[UINavigationController alloc] initWithRootViewController:self.detailViewController]; + detailViewController = [[DetailViewController alloc] initWithStyle:UITableViewStyleGrouped]; + UINavigationController *detailedNavController = [[UINavigationController alloc] initWithRootViewController:detailViewController]; [detailViewController release]; + if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) + self.view.frame = CGRectMake(0, 0, 1024, 768); + id splitViewRootController; Class splitViewControllerClass = NSClassFromString(@"UISplitViewController"); if (splitViewControllerClass) { splitViewRootController = [[splitViewControllerClass alloc] init]; //[[splitViewRootController view] setAutoresizingMask: UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth]; - - [[splitViewRootController view] setFrame:CGRectMake(0, 0, 1024, 1024)]; // yeah it's funny + + [[splitViewRootController view] setFrame:CGRectMake(0, 0, 1024, 768)]; MasterViewController *masterViewController = [[MasterViewController alloc] initWithStyle:UITableViewStylePlain]; UINavigationController *mainNavController = [[UINavigationController alloc] initWithRootViewController:masterViewController]; - masterViewController.detailViewController = self.detailViewController; + masterViewController.detailViewController = detailViewController; [masterViewController release]; @@ -53,13 +54,11 @@ [mainNavController release]; [detailedNavController release]; - [splitViewRootController setDelegate:self.detailViewController]; + [splitViewRootController setDelegate:detailViewController]; [detailViewController release]; // add view to main controller [self.view addSubview:[splitViewRootController view]]; - //[splitViewRootController release]; - } else { [self.view addSubview:detailedNavController.view]; } @@ -68,9 +67,10 @@ } -(void) viewDidUnload { + detailViewController = nil; [super viewDidUnload]; - self.detailViewController = nil; } + -(void) dealloc { [detailViewController release]; [super dealloc]; diff -r c1ff724a5c34 -r 0d522416d97f cocoaTouch/TeamConfigViewController.h --- a/cocoaTouch/TeamConfigViewController.h Thu Apr 29 02:43:28 2010 +0000 +++ b/cocoaTouch/TeamConfigViewController.h Thu Apr 29 17:19:06 2010 +0000 @@ -16,6 +16,5 @@ @property (nonatomic, retain) NSMutableArray *listOfTeams; @property (nonatomic, retain) NSMutableArray *listOfSelectedTeams; -@property (nonatomic,retain) NSIndexPath *lastIndexPath; @end diff -r c1ff724a5c34 -r 0d522416d97f cocoaTouch/TeamConfigViewController.m --- a/cocoaTouch/TeamConfigViewController.m Thu Apr 29 02:43:28 2010 +0000 +++ b/cocoaTouch/TeamConfigViewController.m Thu Apr 29 17:19:06 2010 +0000 @@ -25,12 +25,14 @@ CGSize screenSize = [[UIScreen mainScreen] bounds].size; self.view.frame = CGRectMake(0, 0, screenSize.height, screenSize.width - 44); + self.tableView.backgroundColor = [UIColor redColor]; } -(void) viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; - unsigned int colors[6] = { 4421353, 4100897, 10632635, 16749353, 14483456, 7566195 }; + // integer representation of various color (defined in SquareButtonView) + NSUInteger colors[6] = { 4421353, 4100897, 10632635, 16749353, 14483456, 7566195 }; NSArray *contentsOfDir = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:TEAMS_DIRECTORY() error:NULL]; NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:[contentsOfDir count]]; for (int i = 0; i < [contentsOfDir count]; i++) { @@ -51,22 +53,6 @@ [self.tableView reloadData]; } -/* -- (void)viewDidAppear:(BOOL)animated { - [super viewDidAppear:animated]; -} -*/ -/* -- (void)viewWillDisappear:(BOOL)animated { - [super viewWillDisappear:animated]; -} -*/ -/* -- (void)viewDidDisappear:(BOOL)animated { - [super viewDidDisappear:animated]; -} -*/ - -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return rotationManager(interfaceOrientation); } @@ -93,14 +79,14 @@ } // Customize the appearance of table view cells. --(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { +-(UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier0 = @"Cell0"; static NSString *CellIdentifier1 = @"Cell1"; NSInteger section = [indexPath section]; UITableViewCell *cell; if (section == 0) { - cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier0]; + cell = [aTableView dequeueReusableCellWithIdentifier:CellIdentifier0]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier0] autorelease]; @@ -136,7 +122,7 @@ [squareButton selectColor:[[selectedRow objectForKey:@"color"] intValue]]; squareButton.ownerDictionary = selectedRow; } else { - cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier1]; + cell = [aTableView dequeueReusableCellWithIdentifier:CellIdentifier1]; if (cell == nil) cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier1] autorelease]; @@ -187,7 +173,7 @@ #pragma mark - #pragma mark Table view delegate --(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { +-(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSInteger row = [indexPath row]; NSInteger section = [indexPath section]; @@ -198,7 +184,7 @@ [self.listOfSelectedTeams addObject:[self.listOfTeams objectAtIndex:row]]; [self.listOfTeams removeObjectAtIndex:row]; } - [self.tableView reloadData]; + [aTableView reloadData]; } @@ -216,7 +202,7 @@ -(void) dealloc { - [listOfTeams release]; + [self.listOfTeams release]; [super dealloc]; } diff -r c1ff724a5c34 -r 0d522416d97f cocoaTouch/otherSrc/CommodityFunctions.h --- a/cocoaTouch/otherSrc/CommodityFunctions.h Thu Apr 29 02:43:28 2010 +0000 +++ b/cocoaTouch/otherSrc/CommodityFunctions.h Thu Apr 29 17:19:06 2010 +0000 @@ -34,3 +34,12 @@ NSInteger randomPort (); void popError (const char *title, const char *message); + +#ifndef __IPHONE_3_2 // if iPhoneOS is 3.2 or greater then __IPHONE_3_2 will be defined +typedef enum { + UIUserInterfaceIdiomPhone, // iPhone and iPod touch style UI + UIUserInterfaceIdiomPad, // iPad style UI +} UIUserInterfaceIdiom; +#define UI_USER_INTERFACE_IDIOM() UIUserInterfaceIdiomPhone +#endif // ifndef __IPHONE_3_2 + diff -r c1ff724a5c34 -r 0d522416d97f cocoaTouch/xib/GameConfigViewController-iPad.xib --- a/cocoaTouch/xib/GameConfigViewController-iPad.xib Thu Apr 29 02:43:28 2010 +0000 +++ b/cocoaTouch/xib/GameConfigViewController-iPad.xib Thu Apr 29 17:19:06 2010 +0000 @@ -42,52 +42,7 @@ 292 YES - - - 290 - {{754, 303}, {266, 216}} - - IBIPadFramework - YES - - - - 290 - {{754, 51}, {266, 216}} - - IBIPadFramework - YES - - - - 274 - {{20, 111}, {242, 396}} - - - 3 - MQA - - YES - IBIPadFramework - NO - 1 - 0 - YES - 44 - 22 - 22 - - - - 268 - {{300, 51}, {446, 456}} - - YES - YES - IBIPadFramework - NO - - + 266 {{0, 724}, {1024, 44}} @@ -97,30 +52,34 @@ IBIPadFramework YES - + Back IBIPadFramework 1 - + - + IBIPadFramework - + 5 - + 1 Start Game IBIPadFramework + 90 2 - + {1024, 768} - + + 3 + MQA + NO 3 @@ -142,18 +101,18 @@ buttonPressed: - + - 19 + 17 buttonPressed: - + - 22 + 23 @@ -181,59 +140,35 @@ YES - - - - - + - 10 - - - - - 12 - - - - - 13 - - - - - 14 - - - - 15 - + YES - - - + + + 16 - - - - - 17 - - + + 18 - - + + + + + 22 + + @@ -243,16 +178,12 @@ YES -1.CustomClassName -2.CustomClassName - 10.IBPluginDependency - 12.IBPluginDependency - 13.IBPluginDependency - 14.IBPluginDependency 15.IBPluginDependency 16.IBPluginDependency - 17.IBPluginDependency 18.IBPluginDependency 2.IBEditorWindowLastContentRect 2.IBPluginDependency + 22.IBPluginDependency YES @@ -261,13 +192,9 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin + {{252, 103}, {1024, 768}} com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - {{269, 237}, {1024, 768}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -286,7 +213,7 @@ - 22 + 29 @@ -295,28 +222,16 @@ GameConfigViewController UIViewController - buttonPressed: - id - - YES YES - availableTeamsTableView - mapButton - randomButton - schemesButton - startButton - weaponsButton + buttonPressed: + segmentPressed: YES - UITableView - UIButton - UIButton - UIButton - UIBarButtonItem - UIButton + id + id @@ -477,43 +392,11 @@ - UIButton - UIControl - - IBFrameworkSource - UIKit.framework/Headers/UIButton.h - - - - UIControl - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIControl.h - - - - UIPickerView - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIPickerView.h - - - UIResponder NSObject - UIScrollView - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIScrollView.h - - - UISearchBar UIView @@ -530,14 +413,6 @@ - UITableView - UIScrollView - - IBFrameworkSource - UIKit.framework/Headers/UITableView.h - - - UIToolbar UIView @@ -609,7 +484,7 @@ YES - ../../project_files/HedgewarsMobile/HedgewarsMobile.xcodeproj + ../../project_files/HedgewarsMobile/Hedgewars.xcodeproj 3 87 diff -r c1ff724a5c34 -r 0d522416d97f cocoaTouch/xib/MapConfigViewController-iPad.xib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cocoaTouch/xib/MapConfigViewController-iPad.xib Thu Apr 29 17:19:06 2010 +0000 @@ -0,0 +1,784 @@ + + + + 800 + 10D573 + 762 + 1038.29 + 460.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 87 + + + YES + + + + YES + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + YES + + YES + + + YES + + + + YES + + IBFilesOwner + IBIPadFramework + + + IBFirstResponder + IBIPadFramework + + + + 274 + + YES + + + 292 + {{756, 170}, {240, 30}} + + NO + IBIPadFramework + 2 + 3 + 0 + + YES + Random + Map + Maze + + + YES + + + + + + YES + + + + + + YES + {0, 0} + {0, 0} + {0, 0} + + + YES + + + + + + + + 292 + {{573, 37}, {149, 23}} + + NO + IBIPadFramework + 0 + 0 + 0.05000000074505806 + 0.05000000074505806 + + + + 292 + {{746, 20}, {256, 128}} + + NO + IBIPadFramework + 0 + 0 + + Helvetica-Bold + 15 + 16 + + 1 + + 3 + MQA + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + 3 + MC41AA + + + + + 292 + {{627, 110}, {42, 21}} + + NO + YES + 7 + NO + IBIPadFramework + ... + + 1 + MCAwIDAAA + + + 1 + 10 + 1 + + + + 292 + {{575, 67}, {145, 29}} + + NO + YES + 7 + NO + IBIPadFramework + Label + + Helvetica + 24 + 16 + + + + 1 + 10 + 1 + + + + 274 + {{724, 224}, {300, 500}} + + + 3 + MSAwAA + + YES + IBIPadFramework + NO + 1 + 0 + YES + 44 + 22 + 22 + + + + -2147483356 + {{0, 224}, {300, 500}} + + NO + IBIPadFramework + 0 + 0 + + 1 + teams section + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + + {1024, 724} + + + 2 + MC44MzkyMTU3NTU1IDAuODQ3MDU4ODkyMyAwLjg3MDU4ODMwMjYAA + + + + 3 + + IBIPadFramework + + + + + YES + + + view + + + + 3 + + + + updatePreview + + + 7 + + 12 + + + + previewButton + + + + 13 + + + + maxLabel + + + + 16 + + + + sizeLabel + + + + 18 + + + + sliderChanged: + + + 13 + + 19 + + + + sliderEndedChanging: + + + 7 + + 20 + + + + segmentedControl + + + + 21 + + + + segmentedControlChanged: + + + 13 + + 22 + + + + slider + + + + 23 + + + + dataSource + + + + 26 + + + + delegate + + + + 27 + + + + tableView + + + + 32 + + + + + YES + + 0 + + + + + + 1 + + + YES + + + + + + + + + + + + -1 + + + File's Owner + + + -2 + + + + + 7 + + + + + 8 + + + + + 11 + + + + + 17 + + + + + 25 + + + Table View (Themes) + + + 39 + + + + + 9 + + + + + + + YES + + YES + -1.CustomClassName + -2.CustomClassName + 1.IBEditorWindowLastContentRect + 1.IBPluginDependency + 11.IBPluginDependency + 17.IBPluginDependency + 25.IBPluginDependency + 39.IBPluginDependency + 7.IBPluginDependency + 8.IBPluginDependency + 9.IBPluginDependency + + + YES + MapConfigViewController + UIResponder + {{255, -206}, {1024, 768}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 48 + + + + YES + + MapConfigViewController + UIViewController + + YES + + YES + segmentedControlChanged: + sliderChanged: + sliderEndedChanging: + updatePreview + + + YES + id + id + id + id + + + + YES + + YES + maxLabel + previewButton + segmentedControl + sizeLabel + slider + tableView + + + YES + UILabel + UIButton + UISegmentedControl + UILabel + UISlider + UITableView + + + + IBProjectSource + ../../cocoaTouch/MapConfigViewController.h + + + + + YES + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSNetServices.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPort.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSStream.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSXMLParser.h + + + + NSObject + + IBFrameworkSource + QuartzCore.framework/Headers/CAAnimation.h + + + + NSObject + + IBFrameworkSource + QuartzCore.framework/Headers/CALayer.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UIAccessibility.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UINibLoading.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UIResponder.h + + + + UIButton + UIControl + + IBFrameworkSource + UIKit.framework/Headers/UIButton.h + + + + UIControl + UIView + + IBFrameworkSource + UIKit.framework/Headers/UIControl.h + + + + UILabel + UIView + + IBFrameworkSource + UIKit.framework/Headers/UILabel.h + + + + UIResponder + NSObject + + + + UIScrollView + UIView + + IBFrameworkSource + UIKit.framework/Headers/UIScrollView.h + + + + UISearchBar + UIView + + IBFrameworkSource + UIKit.framework/Headers/UISearchBar.h + + + + UISearchDisplayController + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UISearchDisplayController.h + + + + UISegmentedControl + UIControl + + IBFrameworkSource + UIKit.framework/Headers/UISegmentedControl.h + + + + UISlider + UIControl + + IBFrameworkSource + UIKit.framework/Headers/UISlider.h + + + + UITableView + UIScrollView + + IBFrameworkSource + UIKit.framework/Headers/UITableView.h + + + + UIView + + IBFrameworkSource + UIKit.framework/Headers/UITextField.h + + + + UIView + UIResponder + + IBFrameworkSource + UIKit.framework/Headers/UIView.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UINavigationController.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UIPopoverController.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UISplitViewController.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UITabBarController.h + + + + UIViewController + UIResponder + + IBFrameworkSource + UIKit.framework/Headers/UIViewController.h + + + + + 0 + IBIPadFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 + + + YES + ../../project_files/HedgewarsMobile/Hedgewars.xcodeproj + 3 + 87 + + diff -r c1ff724a5c34 -r 0d522416d97f project_files/HedgewarsMobile/HedgewarsMobile.xcodeproj/project.pbxproj --- a/project_files/HedgewarsMobile/HedgewarsMobile.xcodeproj/project.pbxproj Thu Apr 29 02:43:28 2010 +0000 +++ b/project_files/HedgewarsMobile/HedgewarsMobile.xcodeproj/project.pbxproj Thu Apr 29 17:19:06 2010 +0000 @@ -41,6 +41,7 @@ 6151347E116C2803001F16D1 /* Icon-iPad.png in Resources */ = {isa = PBXBuildFile; fileRef = 6151347D116C2803001F16D1 /* Icon-iPad.png */; }; 615134B1116C2C5F001F16D1 /* OverlayViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 615134B0116C2C5F001F16D1 /* OverlayViewController.xib */; }; 615A92911183E31C006CA772 /* MapConfigViewController-iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 615A92901183E31C006CA772 /* MapConfigViewController-iPhone.xib */; }; + 617814E8118947A200C6A535 /* MapConfigViewController-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 617814E7118947A200C6A535 /* MapConfigViewController-iPad.xib */; }; 61798816114AA34C00BA94A9 /* hwengine.pas in Sources */ = {isa = PBXBuildFile; fileRef = 617987E7114AA34C00BA94A9 /* hwengine.pas */; }; 61798818114AA34C00BA94A9 /* hwLibrary.pas in Sources */ = {isa = PBXBuildFile; fileRef = 617987E9114AA34C00BA94A9 /* hwLibrary.pas */; }; 6179881B114AA34C00BA94A9 /* PascalExports.pas in Sources */ = {isa = PBXBuildFile; fileRef = 617987EC114AA34C00BA94A9 /* PascalExports.pas */; }; @@ -245,6 +246,7 @@ 6151347D116C2803001F16D1 /* Icon-iPad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-iPad.png"; path = "../../cocoaTouch/resources/Icon-iPad.png"; sourceTree = SOURCE_ROOT; }; 615134B0116C2C5F001F16D1 /* OverlayViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = OverlayViewController.xib; path = ../../cocoaTouch/xib/OverlayViewController.xib; sourceTree = SOURCE_ROOT; }; 615A92901183E31C006CA772 /* MapConfigViewController-iPhone.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "MapConfigViewController-iPhone.xib"; path = "../../cocoaTouch/xib/MapConfigViewController-iPhone.xib"; sourceTree = SOURCE_ROOT; }; + 617814E7118947A200C6A535 /* MapConfigViewController-iPad.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "MapConfigViewController-iPad.xib"; path = "../../cocoaTouch/xib/MapConfigViewController-iPad.xib"; sourceTree = SOURCE_ROOT; }; 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; }; @@ -526,6 +528,7 @@ 6100DB1711544E8400F455E0 /* XIB */ = { isa = PBXGroup; children = ( + 617814E7118947A200C6A535 /* MapConfigViewController-iPad.xib */, 615A92901183E31C006CA772 /* MapConfigViewController-iPhone.xib */, 611E127C117BACC60044B62F /* GameConfigViewController-iPad.xib */, 61A118C911683C7600359010 /* MainMenuViewController-iPad.xib */, @@ -976,6 +979,7 @@ 611E127F117BACCD0044B62F /* GameConfigViewController-iPhone.xib in Resources */, 611E12FF117BBBDA0044B62F /* Entitlements-Development.plist in Resources */, 615A92911183E31C006CA772 /* MapConfigViewController-iPhone.xib in Resources */, + 617814E8118947A200C6A535 /* MapConfigViewController-iPad.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1149,6 +1153,7 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CODE_SIGN_ENTITLEMENTS = "Entitlements-Development.plist"; + CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -1159,6 +1164,7 @@ "\"$(SRCROOT)\"", ); PRODUCT_NAME = Hedgewars; + PROVISIONING_PROFILE = ""; "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -1412,8 +1418,8 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; - CODE_SIGN_IDENTITY = "iPhone Developer: Vittorio Giovara (DC2BRETXAC)"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Vittorio Giovara (DC2BRETXAC)"; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; FPC_COMMON_OPTIONS = "-dIPHONEOS -Cs2000000 -vwi -B -Sgix"; FPC_COMPILER_BINARY_DIR = /usr/local/lib/fpc/2.5.1; FPC_MAIN_FILE = "$(PROJECT_DIR)/../../hedgewars/hwLibrary.pas"; @@ -1442,8 +1448,8 @@ "-Wl,-no_order_inits", ); PREBINDING = NO; - PROVISIONING_PROFILE = "BD0C39CA-87BA-4276-A9A3-B3ABC838763E"; - "PROVISIONING_PROFILE[sdk=iphoneos*]" = "BD0C39CA-87BA-4276-A9A3-B3ABC838763E"; + PROVISIONING_PROFILE = ""; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; SDKROOT = iphoneos3.2; TARGETED_DEVICE_FAMILY = "1,2"; }; diff -r c1ff724a5c34 -r 0d522416d97f project_files/HedgewarsMobile/Info.plist --- a/project_files/HedgewarsMobile/Info.plist Thu Apr 29 02:43:28 2010 +0000 +++ b/project_files/HedgewarsMobile/Info.plist Thu Apr 29 17:19:06 2010 +0000 @@ -6,8 +6,6 @@ English CFBundleDisplayName ${PRODUCT_NAME} - CFBundleDocumentTypes - CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIconFiles @@ -16,7 +14,7 @@ Icon-iPad.png CFBundleIdentifier - org.hedgewars.${PRODUCT_NAME:identifier} + org.hedgewars.mobile CFBundleInfoDictionaryVersion 6.0 CFBundleName