project_files/HedgewarsMobile/Classes/FortsViewController.m
changeset 6908 896ed2afcfb8
parent 6832 fae8fd118da9
child 10108 c68cf030eded
equal deleted inserted replaced
6907:a2f9a9a62dc5 6908:896ed2afcfb8
    37     [super viewDidLoad];
    37     [super viewDidLoad];
    38 
    38 
    39     NSArray *directoryContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:FORTS_DIRECTORY() error:NULL];
    39     NSArray *directoryContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:FORTS_DIRECTORY() error:NULL];
    40     NSMutableArray *filteredContents = [[NSMutableArray alloc] initWithCapacity:([directoryContents count] / IMGNUM_PER_FORT)];
    40     NSMutableArray *filteredContents = [[NSMutableArray alloc] initWithCapacity:([directoryContents count] / IMGNUM_PER_FORT)];
    41     // we need to remove the double entries and the L.png suffix
    41     // we need to remove the double entries and the L.png suffix
    42     for (int i = 0; i < [directoryContents count]; i++) {
    42     for (NSUInteger i = 0; i < [directoryContents count]; i++) {
    43         if (i % IMGNUM_PER_FORT == IMGNUM_PER_FORT-1) {
    43         if (i % IMGNUM_PER_FORT == IMGNUM_PER_FORT-1) {
    44             NSString *currentName = [directoryContents objectAtIndex:i];
    44             NSString *currentName = [directoryContents objectAtIndex:i];
    45             NSString *correctName = [currentName substringToIndex:([currentName length] - 5)];
    45             NSString *correctName = [currentName substringToIndex:([currentName length] - 5)];
    46             [filteredContents addObject:correctName];
    46             [filteredContents addObject:correctName];
    47         }
    47         }