# HG changeset patch # User koda # Date 1292031003 -3600 # Node ID 4a8f87eb67cba7643669fa7e8505c05d2d208864 # Parent 8906b2409d9752eda06b06713d3bfde7b42907e4 disable large maps also on iphone3gs and ipodtouch3g, they fail to load sometimes diff -r 8906b2409d97 -r 4a8f87eb67cb project_files/HedgewarsMobile/Classes/CommodityFunctions.h --- a/project_files/HedgewarsMobile/Classes/CommodityFunctions.h Sat Dec 11 01:55:16 2010 +0100 +++ b/project_files/HedgewarsMobile/Classes/CommodityFunctions.h Sat Dec 11 02:30:03 2010 +0100 @@ -58,6 +58,7 @@ #define IS_DUALHEAD() ([[UIScreen class] respondsToSelector:@selector(screens)] && [[UIScreen screens] count] > 1) #define IS_IPAD() (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) #define IS_NOT_POWERFUL() ([modelType() hasPrefix:@"iPhone1"] || [modelType() hasPrefix:@"iPod1,1"] || [modelType() hasPrefix:@"iPod2,1"]) +#define IS_NOT_VERY_POWERFUL() ([modelType() hasPrefix:@"iPad1"] || [modelType() hasPrefix:@"iPhone2"] || [modelId hasPrefix:@"iPod3"]) #define DEFAULT_NETGAME_PORT 46631 diff -r 8906b2409d97 -r 4a8f87eb67cb project_files/HedgewarsMobile/Classes/MapConfigViewController.m --- a/project_files/HedgewarsMobile/Classes/MapConfigViewController.m Sat Dec 11 01:55:16 2010 +0100 +++ b/project_files/HedgewarsMobile/Classes/MapConfigViewController.m Sat Dec 11 02:30:03 2010 +0100 @@ -386,14 +386,15 @@ [string release]; // remove a trailing "" element [themeArray removeLastObject]; + + // remove images that are too big for certain devices without loading the whole image NSArray *mapArrayFull = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:MAPS_DIRECTORY() error:NULL]; NSMutableArray *mapArray = [[NSMutableArray alloc] init]; for (NSString *str in mapArrayFull) { CGSize imgSize = PSPNGSizeFromMetaData([MAPS_DIRECTORY() stringByAppendingFormat:@"%@/map.png",str]); - // remove images that are too big for certain devices if (IS_NOT_POWERFUL() && imgSize.height > 1024.0f) continue; - if ([modelType() hasPrefix:@"iPad1"] && imgSize.height > 1280.0f) + if (IS_NOT_VERY_POWERFUL() && imgSize.height > 1280.0f) continue; [mapArray addObject:str]; } @@ -402,10 +403,9 @@ NSMutableArray *missionArray = [[NSMutableArray alloc] init]; for (NSString *str in missionArrayFull) { CGSize imgSize = PSPNGSizeFromMetaData([MISSIONS_DIRECTORY() stringByAppendingFormat:@"%@/map.png",str]); - // remove images that are too big for certain devices if (IS_NOT_POWERFUL() && imgSize.height > 1024.0f) continue; - if ([modelType() hasPrefix:@"iPad1"] && imgSize.height > 1280.0f) + if (IS_NOT_VERY_POWERFUL() && imgSize.height > 1280.0f) continue; [missionArray addObject:str]; } diff -r 8906b2409d97 -r 4a8f87eb67cb project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj --- a/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj Sat Dec 11 01:55:16 2010 +0100 +++ b/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj Sat Dec 11 02:30:03 2010 +0100 @@ -1560,7 +1560,7 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 1D6058900D05DD3D006BFB54 /* Hedgewars */ = { + 1D6058900D05DD3D006BFB54 /* Test Lua */ = { isa = PBXNativeTarget; buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "Hedgewars" */; buildPhases = ( @@ -1651,7 +1651,7 @@ ); projectRoot = ""; targets = ( - 1D6058900D05DD3D006BFB54 /* Hedgewars */, + 1D6058900D05DD3D006BFB54 /* Test Lua */, 928301160F10CAFC00CC5A3C /* fpc */, 6179928B114AE0C800BA94A9 /* UpdateDataFolder */, );