diff -r db775bddf771 -r 4c9ae0f484da project_files/HedgewarsMobile/Classes/CommodityFunctions.h --- a/project_files/HedgewarsMobile/Classes/CommodityFunctions.h Wed May 11 01:26:38 2011 +0200 +++ b/project_files/HedgewarsMobile/Classes/CommodityFunctions.h Thu May 12 23:00:26 2011 +0200 @@ -54,23 +54,24 @@ #define UICOLOR_HW_YELLOW_TEXT [UIColor colorWithRed:(CGFloat)0xF0/255 green:(CGFloat)0xD0/255 blue:0 alpha:1] #define UICOLOR_HW_DARKBLUE [UIColor colorWithRed:(CGFloat)0x0F/255 green:0 blue:(CGFloat)0x42/255 alpha:1] #define UICOLOR_HW_ALPHABLUE [UIColor colorWithRed:(CGFloat)0x0F/255 green:0 blue:(CGFloat)0x42/255 alpha:0.58f] -#define UICOLOR_HW_ALMOSTBLACK (IS_NOT_POWERFUL()) ? [UIColor blackColor] : [UIColor colorWithRed:0 green:0 blue:0 alpha:0.6] +#define UICOLOR_HW_ALMOSTBLACK (IS_NOT_POWERFUL(getModelType())) ? [UIColor blackColor] : [UIColor colorWithRed:0 green:0 blue:0 alpha:0.6] #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"] || [modelType() hasPrefix:@"iPod3"] || [modelType() hasPrefix:@"iPod4"] ) -#define IS_VERY_POWERFUL() (IS_NOT_POWERFUL() == NO && IS_NOT_VERY_POWERFUL() == NO) +#define IS_NOT_POWERFUL(x) ([x hasPrefix:@"iPhone1"] || [x hasPrefix:@"iPod1,1"] || [x hasPrefix:@"iPod2,1"]) +#define IS_NOT_VERY_POWERFUL(x) ([x hasPrefix:@"iPad1"] || [x hasPrefix:@"iPhone2"] || [x hasPrefix:@"iPod3"] || [x hasPrefix:@"iPod4"]) +#define IS_VERY_POWERFUL(x) (IS_NOT_POWERFUL(x) == NO && IS_NOT_VERY_POWERFUL(x) == NO) +#define rotationManager(x) (x == UIInterfaceOrientationLandscapeRight) || (x == UIInterfaceOrientationLandscapeLeft) void print_free_memory (void); void playSound (NSString *snd); -void popError (const char *title, const char *message); -BOOL rotationManager (UIInterfaceOrientation interfaceOrientation); BOOL isApplePhone (void); NSInteger randomPort (void); -NSString *modelType (void); + +NSString *getModelType (void); NSArray *getAvailableColors (void); + UILabel *createBlueLabel (NSString *title, CGRect frame); UILabel *createLabelWithParams (NSString *title, CGRect frame, CGFloat borderWidth, UIColor *borderColor, UIColor *backgroundColor);