equal
deleted
inserted
replaced
1 // |
1 /* |
2 // FortsViewController.m |
2 * Hedgewars-iOS, a Hedgewars port for iOS devices |
3 // HedgewarsMobile |
3 * Copyright (c) 2009-2010 Vittorio Giovara <vittorio.giovara@gmail.com> |
4 // |
4 * |
5 // Created by Vittorio on 08/04/10. |
5 * This program is free software; you can redistribute it and/or modify |
6 // Copyright 2010 __MyCompanyName__. All rights reserved. |
6 * it under the terms of the GNU General Public License as published by |
7 // |
7 * the Free Software Foundation; version 2 of the License |
|
8 * |
|
9 * This program is distributed in the hope that it will be useful, |
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 * GNU General Public License for more details. |
|
13 * |
|
14 * You should have received a copy of the GNU General Public License |
|
15 * along with this program; if not, write to the Free Software |
|
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
17 * |
|
18 * File created on 08/04/2010. |
|
19 */ |
|
20 |
8 |
21 |
9 #import "FortsViewController.h" |
22 #import "FortsViewController.h" |
10 #import "CommodityFunctions.h" |
23 #import "CommodityFunctions.h" |
11 #import "UIImageExtra.h" |
24 #import "UIImageExtra.h" |
12 |
25 |
34 [filteredContents addObject:correctName]; |
47 [filteredContents addObject:correctName]; |
35 } |
48 } |
36 } |
49 } |
37 self.fortArray = filteredContents; |
50 self.fortArray = filteredContents; |
38 [filteredContents release]; |
51 [filteredContents release]; |
39 |
|
40 /* |
|
41 // this creates a scaled down version of the image |
|
42 NSMutableArray *spriteArray = [[NSMutableArray alloc] initWithCapacity:[fortArray count]]; |
|
43 for (NSString *fortName in fortArray) { |
|
44 NSString *fortFile = [[NSString alloc] initWithFormat:@"%@/%@L.png", fortsDirectory, fortName]; |
|
45 UIImage *fortSprite = [[UIImage alloc] initWithContentsOfFile:fortFile]; |
|
46 [fortFile release]; |
|
47 [spriteArray addObject:[fortSprite scaleToSize:CGSizeMake(196,196)]]; |
|
48 [fortSprite release]; |
|
49 } |
|
50 self.fortSprites = spriteArray; |
|
51 [spriteArray release]; |
|
52 */ |
|
53 |
52 |
54 // statically set row height instead of using delegate method for performance reasons |
53 // statically set row height instead of using delegate method for performance reasons |
55 self.tableView.rowHeight = 200; |
54 self.tableView.rowHeight = 200; |
56 |
55 |
57 self.title = NSLocalizedString(@"Choose team fort",@""); |
56 self.title = NSLocalizedString(@"Choose team fort",@""); |