cocoaTouch/otherSrc/CommodityFunctions.h
author convert-repo
Wed, 16 Jun 2010 04:10:50 +0000
changeset 3504 6a28efdec1f5
parent 3490 016b3172b645
child 3513 f589230fa21b
permissions -rw-r--r--
update tags
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3325
652a8ebdf667 moved around team creation
koda
parents:
diff changeset
     1
//
652a8ebdf667 moved around team creation
koda
parents:
diff changeset
     2
//  CommodityFunctions.h
652a8ebdf667 moved around team creation
koda
parents:
diff changeset
     3
//  HedgewarsMobile
652a8ebdf667 moved around team creation
koda
parents:
diff changeset
     4
//
652a8ebdf667 moved around team creation
koda
parents:
diff changeset
     5
//  Created by Vittorio on 08/04/10.
652a8ebdf667 moved around team creation
koda
parents:
diff changeset
     6
//  Copyright 2010 __MyCompanyName__. All rights reserved.
652a8ebdf667 moved around team creation
koda
parents:
diff changeset
     7
//
652a8ebdf667 moved around team creation
koda
parents:
diff changeset
     8
652a8ebdf667 moved around team creation
koda
parents:
diff changeset
     9
#import <Foundation/Foundation.h>
652a8ebdf667 moved around team creation
koda
parents:
diff changeset
    10
652a8ebdf667 moved around team creation
koda
parents:
diff changeset
    11
#define MAX_HOGS 8
652a8ebdf667 moved around team creation
koda
parents:
diff changeset
    12
3339
d558bc5a73c5 lots of untested stuff for the ifrontend
koda
parents: 3335
diff changeset
    13
3335
2520ee7a5484 new manager for handling (future) rotations
koda
parents: 3330
diff changeset
    14
#define SETTINGS_FILE()         [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) \
2520ee7a5484 new manager for handling (future) rotations
koda
parents: 3330
diff changeset
    15
                                 objectAtIndex:0] stringByAppendingString:@"/settings.plist"]
3364
e5403e2bf02c no more hardcoded teams, team selection is real \o/
koda
parents: 3352
diff changeset
    16
#define GAMECONFIG_FILE()       [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) \
e5403e2bf02c no more hardcoded teams, team selection is real \o/
koda
parents: 3352
diff changeset
    17
                                 objectAtIndex:0] stringByAppendingString:@"/gameconfig.plist"]
3377
a3f0849f26bc add option to look at the previous debug log
koda
parents: 3374
diff changeset
    18
#define DEBUG_FILE()            [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) \
a3f0849f26bc add option to look at the previous debug log
koda
parents: 3374
diff changeset
    19
                                 objectAtIndex:0] stringByAppendingString:@"/debug.txt"]
3339
d558bc5a73c5 lots of untested stuff for the ifrontend
koda
parents: 3335
diff changeset
    20
3330
987ec27b6042 add support for modifying the name of the team
koda
parents: 3325
diff changeset
    21
#define TEAMS_DIRECTORY()       [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) \
987ec27b6042 add support for modifying the name of the team
koda
parents: 3325
diff changeset
    22
                                 objectAtIndex:0] stringByAppendingString:@"/Teams/"]
3479
972ae3ec178a initial support for game modifiers (schemes)
koda
parents: 3377
diff changeset
    23
#define SCHEMES_DIRECTORY()     [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) \
972ae3ec178a initial support for game modifiers (schemes)
koda
parents: 3377
diff changeset
    24
                                 objectAtIndex:0] stringByAppendingString:@"/Schemes/"]
3339
d558bc5a73c5 lots of untested stuff for the ifrontend
koda
parents: 3335
diff changeset
    25
3330
987ec27b6042 add support for modifying the name of the team
koda
parents: 3325
diff changeset
    26
#define GRAPHICS_DIRECTORY()    [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Graphics/"]
987ec27b6042 add support for modifying the name of the team
koda
parents: 3325
diff changeset
    27
#define HATS_DIRECTORY()        [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Graphics/Hats/"]
3352
ac5d14a35482 complete previews on the team settings
koda
parents: 3340
diff changeset
    28
#define GRAVES_DIRECTORY()      [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Graphics/Graves/"]
ac5d14a35482 complete previews on the team settings
koda
parents: 3340
diff changeset
    29
#define BOTLEVELS_DIRECTORY()   [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Graphics/Hedgehog/botlevels"]
3479
972ae3ec178a initial support for game modifiers (schemes)
koda
parents: 3377
diff changeset
    30
#define BTN_DIRECTORY()         [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Graphics/Btn"]
3373
c1ff724a5c34 use a proper bundle identifier
koda
parents: 3365
diff changeset
    31
#define FLAGS_DIRECTORY()       [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Graphics/Flags/"]
3352
ac5d14a35482 complete previews on the team settings
koda
parents: 3340
diff changeset
    32
#define FORTS_DIRECTORY()       [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Forts/"]
3373
c1ff724a5c34 use a proper bundle identifier
koda
parents: 3365
diff changeset
    33
#define THEMES_DIRECTORY()      [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Themes/"]
c1ff724a5c34 use a proper bundle identifier
koda
parents: 3365
diff changeset
    34
#define MAPS_DIRECTORY()        [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Maps/"]
3352
ac5d14a35482 complete previews on the team settings
koda
parents: 3340
diff changeset
    35
#define VOICES_DIRECTORY()      [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Sounds/voices/"]
3325
652a8ebdf667 moved around team creation
koda
parents:
diff changeset
    36
3490
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
    37
#define MSG_MEMCLEAN()          DLog(@"has cleaned up some memory"); print_free_memory()
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
    38
#define MSG_DIDUNLOAD()         DLog(@"did unload");
3487
b1d00f1950c8 add some memory aware code
koda
parents: 3479
diff changeset
    39
3325
652a8ebdf667 moved around team creation
koda
parents:
diff changeset
    40
void createTeamNamed (NSString *nameWithoutExt);
3479
972ae3ec178a initial support for game modifiers (schemes)
koda
parents: 3377
diff changeset
    41
void createSchemeNamed (NSString *nameWithoutExt);
3335
2520ee7a5484 new manager for handling (future) rotations
koda
parents: 3330
diff changeset
    42
BOOL rotationManager (UIInterfaceOrientation interfaceOrientation);
3373
c1ff724a5c34 use a proper bundle identifier
koda
parents: 3365
diff changeset
    43
NSInteger randomPort ();
c1ff724a5c34 use a proper bundle identifier
koda
parents: 3365
diff changeset
    44
void popError (const char *title, const char *message);
3490
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
    45
void print_free_memory ();
3374
0d522416d97f lazy loading for all the tables with images (might affect performance but ui feels much more responsive)
koda
parents: 3373
diff changeset
    46
3490
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
    47
#if __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_3_2
3374
0d522416d97f lazy loading for all the tables with images (might affect performance but ui feels much more responsive)
koda
parents: 3373
diff changeset
    48
typedef enum {
0d522416d97f lazy loading for all the tables with images (might affect performance but ui feels much more responsive)
koda
parents: 3373
diff changeset
    49
    UIUserInterfaceIdiomPhone,           // iPhone and iPod touch style UI
0d522416d97f lazy loading for all the tables with images (might affect performance but ui feels much more responsive)
koda
parents: 3373
diff changeset
    50
    UIUserInterfaceIdiomPad,             // iPad style UI
0d522416d97f lazy loading for all the tables with images (might affect performance but ui feels much more responsive)
koda
parents: 3373
diff changeset
    51
} UIUserInterfaceIdiom;
0d522416d97f lazy loading for all the tables with images (might affect performance but ui feels much more responsive)
koda
parents: 3373
diff changeset
    52
#define UI_USER_INTERFACE_IDIOM() UIUserInterfaceIdiomPhone
0d522416d97f lazy loading for all the tables with images (might affect performance but ui feels much more responsive)
koda
parents: 3373
diff changeset
    53
#endif // ifndef __IPHONE_3_2
0d522416d97f lazy loading for all the tables with images (might affect performance but ui feels much more responsive)
koda
parents: 3373
diff changeset
    54