cocoaTouch/otherSrc/CommodityFunctions.h
changeset 3516 a8c673657b79
parent 3510 23145a950eae
parent 3515 3e8635f43972
child 3529 0e968ba12a84
equal deleted inserted replaced
3510:23145a950eae 3516:a8c673657b79
     1 //
       
     2 //  CommodityFunctions.h
       
     3 //  HedgewarsMobile
       
     4 //
       
     5 //  Created by Vittorio on 08/04/10.
       
     6 //  Copyright 2010 __MyCompanyName__. All rights reserved.
       
     7 //
       
     8 
       
     9 #import <Foundation/Foundation.h>
       
    10 
       
    11 #define MAX_HOGS 8
       
    12 
       
    13 
       
    14 #define SETTINGS_FILE()         [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) \
       
    15                                  objectAtIndex:0] stringByAppendingString:@"/settings.plist"]
       
    16 #define GAMECONFIG_FILE()       [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) \
       
    17                                  objectAtIndex:0] stringByAppendingString:@"/gameconfig.plist"]
       
    18 #define DEBUG_FILE()            [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) \
       
    19                                  objectAtIndex:0] stringByAppendingString:@"/debug.txt"]
       
    20 
       
    21 #define TEAMS_DIRECTORY()       [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) \
       
    22                                  objectAtIndex:0] stringByAppendingString:@"/Teams/"]
       
    23 #define SCHEMES_DIRECTORY()     [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) \
       
    24                                  objectAtIndex:0] stringByAppendingString:@"/Schemes/"]
       
    25 
       
    26 #define GRAPHICS_DIRECTORY()    [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Graphics/"]
       
    27 #define HATS_DIRECTORY()        [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Graphics/Hats/"]
       
    28 #define GRAVES_DIRECTORY()      [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Graphics/Graves/"]
       
    29 #define BOTLEVELS_DIRECTORY()   [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Graphics/Hedgehog/botlevels"]
       
    30 #define BTN_DIRECTORY()         [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Graphics/Btn"]
       
    31 #define FLAGS_DIRECTORY()       [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Graphics/Flags/"]
       
    32 #define FORTS_DIRECTORY()       [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Forts/"]
       
    33 #define THEMES_DIRECTORY()      [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Themes/"]
       
    34 #define MAPS_DIRECTORY()        [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Maps/"]
       
    35 #define VOICES_DIRECTORY()      [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Sounds/voices/"]
       
    36 
       
    37 #define MSG_MEMCLEAN()          DLog(@"has cleaned up some memory"); print_free_memory()
       
    38 #define MSG_DIDUNLOAD()         DLog(@"did unload");
       
    39 
       
    40 void createTeamNamed (NSString *nameWithoutExt);
       
    41 void createSchemeNamed (NSString *nameWithoutExt);
       
    42 BOOL rotationManager (UIInterfaceOrientation interfaceOrientation);
       
    43 NSInteger randomPort ();
       
    44 void popError (const char *title, const char *message);
       
    45 void print_free_memory ();
       
    46 
       
    47 #if __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_3_2
       
    48 typedef enum {
       
    49     UIUserInterfaceIdiomPhone,           // iPhone and iPod touch style UI
       
    50     UIUserInterfaceIdiomPad,             // iPad style UI
       
    51 } UIUserInterfaceIdiom;
       
    52 #define UI_USER_INTERFACE_IDIOM() UIUserInterfaceIdiomPhone
       
    53 #endif // ifndef __IPHONE_3_2
       
    54