project_files/HedgewarsMobile/Classes/CommodityFunctions.h
author koda
Mon, 27 Sep 2010 01:51:12 +0200
changeset 3911 46d7a5cf8ac6
parent 3891 f8f0d0ceb19c
child 3916 e7d665a4ef42
permissions -rw-r--r--
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3829
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
     1
/*
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
     2
 * Hedgewars-iOS, a Hedgewars port for iOS devices
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
     3
 * Copyright (c) 2009-2010 Vittorio Giovara <vittorio.giovara@gmail.com>
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
     4
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
     8
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
    12
 * GNU General Public License for more details.
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
    13
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
    14
 * You should have received a copy of the GNU General Public License
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
    15
 * along with this program; if not, write to the Free Software
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
    17
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
    18
 * File created on 08/04/2010.
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
    19
 */
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
    20
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    21
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    22
#import <Foundation/Foundation.h>
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    23
3911
46d7a5cf8ac6 further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents: 3891
diff changeset
    24
#define MAX_HOGS                8
46d7a5cf8ac6 further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents: 3891
diff changeset
    25
#define CURRENT_AMMOSIZE        48      // also add a line in SingleWeaponViewController array
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    26
3737
2ba6ac8a114b reworked the initialization functions, now it should be safe to update and no more need of spinning wheel at first launch
koda
parents: 3703
diff changeset
    27
#define DOCUMENTS_FOLDER()      [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    28
3737
2ba6ac8a114b reworked the initialization functions, now it should be safe to update and no more need of spinning wheel at first launch
koda
parents: 3703
diff changeset
    29
#define SETTINGS_FILE()         [DOCUMENTS_FOLDER() stringByAppendingString:@"/settings.plist"]
2ba6ac8a114b reworked the initialization functions, now it should be safe to update and no more need of spinning wheel at first launch
koda
parents: 3703
diff changeset
    30
#define DEBUG_FILE()            [DOCUMENTS_FOLDER() stringByAppendingString:@"/debug.txt"]
2ba6ac8a114b reworked the initialization functions, now it should be safe to update and no more need of spinning wheel at first launch
koda
parents: 3703
diff changeset
    31
2ba6ac8a114b reworked the initialization functions, now it should be safe to update and no more need of spinning wheel at first launch
koda
parents: 3703
diff changeset
    32
#define TEAMS_DIRECTORY()       [DOCUMENTS_FOLDER() stringByAppendingString:@"/Teams/"]
2ba6ac8a114b reworked the initialization functions, now it should be safe to update and no more need of spinning wheel at first launch
koda
parents: 3703
diff changeset
    33
#define WEAPONS_DIRECTORY()     [DOCUMENTS_FOLDER() stringByAppendingString:@"/Weapons/"]
2ba6ac8a114b reworked the initialization functions, now it should be safe to update and no more need of spinning wheel at first launch
koda
parents: 3703
diff changeset
    34
#define SCHEMES_DIRECTORY()     [DOCUMENTS_FOLDER() stringByAppendingString:@"/Schemes/"]
3891
f8f0d0ceb19c initial support for savegames
koda
parents: 3829
diff changeset
    35
#define SAVES_DIRECTORY()       [DOCUMENTS_FOLDER() stringByAppendingString:@"/Saves/"]
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    36
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    37
#define GRAPHICS_DIRECTORY()    [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Graphics/"]
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    38
#define HATS_DIRECTORY()        [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Graphics/Hats/"]
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    39
#define GRAVES_DIRECTORY()      [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Graphics/Graves/"]
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    40
#define BOTLEVELS_DIRECTORY()   [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Graphics/Hedgehog/botlevels"]
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    41
#define BTN_DIRECTORY()         [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Graphics/Btn"]
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    42
#define FLAGS_DIRECTORY()       [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Graphics/Flags/"]
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    43
#define FORTS_DIRECTORY()       [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Forts/"]
3911
46d7a5cf8ac6 further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents: 3891
diff changeset
    44
#define VOICES_DIRECTORY()      [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Sounds/voices/"]
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    45
#define THEMES_DIRECTORY()      [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Themes/"]
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    46
#define MAPS_DIRECTORY()        [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Maps/"]
3911
46d7a5cf8ac6 further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents: 3891
diff changeset
    47
#define MISSIONS_DIRECTORY()    [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Missions/Maps/"]
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    48
3548
4d220ee7c75f server somewhat simplified and correct sporadic crasher
koda
parents: 3547
diff changeset
    49
#define MSG_MEMCLEAN()          DLog(@"has cleaned up some memory");
4d220ee7c75f server somewhat simplified and correct sporadic crasher
koda
parents: 3547
diff changeset
    50
#define MSG_DIDUNLOAD()         DLog(@"unloaded");
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    51
3703
12d17c6e8855 halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents: 3670
diff changeset
    52
#define UICOLOR_HW_YELLOW_BODER [UIColor colorWithRed:(CGFloat)0xFE/255 green:(CGFloat)0xC0/255 blue:0 alpha:1]
12d17c6e8855 halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents: 3670
diff changeset
    53
#define UICOLOR_HW_YELLOW_TEXT  [UIColor colorWithRed:(CGFloat)0xF0/255 green:(CGFloat)0xD0/255 blue:0 alpha:1]
3780
7c704e69242e fade in when returning from game, labels rewritten so that they are drawn at runtime (more flexibility with i18n and iphone support)
koda
parents: 3737
diff changeset
    54
#define UICOLOR_HW_DARKBLUE     [UIColor colorWithRed:(CGFloat)0x0F/255 green:0 blue:(CGFloat)0x42/255 alpha:1]
3703
12d17c6e8855 halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents: 3670
diff changeset
    55
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    56
void createTeamNamed (NSString *nameWithoutExt);
3737
2ba6ac8a114b reworked the initialization functions, now it should be safe to update and no more need of spinning wheel at first launch
koda
parents: 3703
diff changeset
    57
void createWeaponNamed (NSString *nameWithoutExt, int type);
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    58
void createSchemeNamed (NSString *nameWithoutExt);
3911
46d7a5cf8ac6 further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents: 3891
diff changeset
    59
void print_free_memory ();
46d7a5cf8ac6 further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents: 3891
diff changeset
    60
void playSound (NSString *snd);
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    61
void popError (const char *title, const char *message);
3911
46d7a5cf8ac6 further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents: 3891
diff changeset
    62
BOOL rotationManager (UIInterfaceOrientation interfaceOrientation);
3670
4c673e57f0d7 use llvm to compile, don't preview map on wimpier devices, merge vsync, fix iphone launch image
koda
parents: 3621
diff changeset
    63
BOOL isPhone ();
3911
46d7a5cf8ac6 further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents: 3891
diff changeset
    64
NSInteger randomPort ();
3670
4c673e57f0d7 use llvm to compile, don't preview map on wimpier devices, merge vsync, fix iphone launch image
koda
parents: 3621
diff changeset
    65
NSString *modelType ();