project_files/HedgewarsMobile/Hedgewars_Prefix.pch
author sheepluva
Tue, 27 Sep 2011 00:46:15 +0200
changeset 6044 728ce9acbaf7
parent 6000 dbcebcd3d79f
child 6078 8c0cc07731e5
permissions -rw-r--r--
I must not use source files as clipboard. I must not use source files as clipboard. I must not use source files as clipboard. I must not use source files as clipboard. I must not use source files as clipboard. I must not use source fi
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3829
81db3c85784b headers ftw, also right project file
koda
parents: 3701
diff changeset
     1
/*
81db3c85784b headers ftw, also right project file
koda
parents: 3701
diff changeset
     2
 * Hedgewars-iOS, a Hedgewars port for iOS devices
81db3c85784b headers ftw, also right project file
koda
parents: 3701
diff changeset
     3
 * Copyright (c) 2009-2010 Vittorio Giovara <vittorio.giovara@gmail.com>
81db3c85784b headers ftw, also right project file
koda
parents: 3701
diff changeset
     4
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3701
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
81db3c85784b headers ftw, also right project file
koda
parents: 3701
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: 3701
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
81db3c85784b headers ftw, also right project file
koda
parents: 3701
diff changeset
     8
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3701
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
81db3c85784b headers ftw, also right project file
koda
parents: 3701
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
81db3c85784b headers ftw, also right project file
koda
parents: 3701
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
81db3c85784b headers ftw, also right project file
koda
parents: 3701
diff changeset
    12
 * GNU General Public License for more details.
81db3c85784b headers ftw, also right project file
koda
parents: 3701
diff changeset
    13
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3701
diff changeset
    14
 * You should have received a copy of the GNU General Public License
81db3c85784b headers ftw, also right project file
koda
parents: 3701
diff changeset
    15
 * along with this program; if not, write to the Free Software
81db3c85784b headers ftw, also right project file
koda
parents: 3701
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
81db3c85784b headers ftw, also right project file
koda
parents: 3701
diff changeset
    17
 */
3366
f0e5ff24fb72 rename the project from HedgewarsMobile to Hedgewars
koda
parents:
diff changeset
    18
5208
878e551f0b4a all together now! releaseAndNil ftw
koda
parents: 5002
diff changeset
    19
878e551f0b4a all together now! releaseAndNil ftw
koda
parents: 5002
diff changeset
    20
// some macros by http://www.cimgf.com/2010/05/02/my-current-prefix-pch-file/
878e551f0b4a all together now! releaseAndNil ftw
koda
parents: 5002
diff changeset
    21
// and http://blog.coriolis.ch/2009/01/05/macros-for-xcode/
878e551f0b4a all together now! releaseAndNil ftw
koda
parents: 5002
diff changeset
    22
3366
f0e5ff24fb72 rename the project from HedgewarsMobile to Hedgewars
koda
parents:
diff changeset
    23
#ifdef __OBJC__
f0e5ff24fb72 rename the project from HedgewarsMobile to Hedgewars
koda
parents:
diff changeset
    24
#import <Foundation/Foundation.h>
f0e5ff24fb72 rename the project from HedgewarsMobile to Hedgewars
koda
parents:
diff changeset
    25
#import <CoreGraphics/CoreGraphics.h>
f0e5ff24fb72 rename the project from HedgewarsMobile to Hedgewars
koda
parents:
diff changeset
    26
#import <UIKit/UIKit.h>
3701
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3663
diff changeset
    27
#import "PascalImports.h"
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3663
diff changeset
    28
#import "UIImageExtra.h"
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3663
diff changeset
    29
#import "CommodityFunctions.h"
5002
a9c44a8ffec8 we get our own AppDelegate, subclassing SDL_UikitAppDelegate so that we don't have to mess with sdl build system
koda
parents: 4028
diff changeset
    30
#import "HedgewarsAppDelegate.h"
6000
dbcebcd3d79f ios frontend: sounds and music have their own class now (with caching\!) instead of being spread here and there (exploiting class methods like a true oop pro)
koda
parents: 5208
diff changeset
    31
#import "AudioManagerController.h"
3366
f0e5ff24fb72 rename the project from HedgewarsMobile to Hedgewars
koda
parents:
diff changeset
    32
#endif
3487
b1d00f1950c8 add some memory aware code
koda
parents: 3366
diff changeset
    33
5208
878e551f0b4a all together now! releaseAndNil ftw
koda
parents: 5002
diff changeset
    34
3487
b1d00f1950c8 add some memory aware code
koda
parents: 3366
diff changeset
    35
#ifdef DEBUG
b1d00f1950c8 add some memory aware code
koda
parents: 3366
diff changeset
    36
  #define DLog(...) NSLog(@"%s %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__])
b1d00f1950c8 add some memory aware code
koda
parents: 3366
diff changeset
    37
  #define ALog(...) [[NSAssertionHandler currentHandler] handleFailureInFunction:[NSString stringWithCString:__PRETTY_FUNCTION__ encoding:NSUTF8StringEncoding] file:[NSString stringWithCString:__FILE__ encoding:NSUTF8StringEncoding] lineNumber:__LINE__ description:__VA_ARGS__]
5208
878e551f0b4a all together now! releaseAndNil ftw
koda
parents: 5002
diff changeset
    38
  #define releaseAndNil(x) [x release]
3487
b1d00f1950c8 add some memory aware code
koda
parents: 3366
diff changeset
    39
#else
b1d00f1950c8 add some memory aware code
koda
parents: 3366
diff changeset
    40
  #define DLog(...) do { } while (0)
b1d00f1950c8 add some memory aware code
koda
parents: 3366
diff changeset
    41
  #ifndef NS_BLOCK_ASSERTIONS
b1d00f1950c8 add some memory aware code
koda
parents: 3366
diff changeset
    42
    #define NS_BLOCK_ASSERTIONS
b1d00f1950c8 add some memory aware code
koda
parents: 3366
diff changeset
    43
  #endif
b1d00f1950c8 add some memory aware code
koda
parents: 3366
diff changeset
    44
  #define ALog(...) NSLog(@"%s %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__])
5208
878e551f0b4a all together now! releaseAndNil ftw
koda
parents: 5002
diff changeset
    45
  #define releaseAndNil(x) [x release], x = nil
3487
b1d00f1950c8 add some memory aware code
koda
parents: 3366
diff changeset
    46
#endif
3701
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3663
diff changeset
    47
5208
878e551f0b4a all together now! releaseAndNil ftw
koda
parents: 5002
diff changeset
    48
3487
b1d00f1950c8 add some memory aware code
koda
parents: 3366
diff changeset
    49
#define ZAssert(condition, ...) do { if (!(condition)) { ALog(__VA_ARGS__); }} while(0)
5208
878e551f0b4a all together now! releaseAndNil ftw
koda
parents: 5002
diff changeset
    50
#define rotationManager(x) (x == UIInterfaceOrientationLandscapeRight) || (x == UIInterfaceOrientationLandscapeLeft)
3513
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3487
diff changeset
    51
3663
8c28abf427f5 reduce the number of keywords used and switch to BMP format for screenshots
koda
parents: 3513
diff changeset
    52
#define START_TIMER NSTimeInterval start = [NSDate timeIntervalSinceReferenceDate];
8c28abf427f5 reduce the number of keywords used and switch to BMP format for screenshots
koda
parents: 3513
diff changeset
    53
#define END_TIMER(msg) 	NSTimeInterval stop = [NSDate timeIntervalSinceReferenceDate]; CMLog([NSString stringWithFormat:@"%@ Time = %f", msg, stop-start]);
8c28abf427f5 reduce the number of keywords used and switch to BMP format for screenshots
koda
parents: 3513
diff changeset
    54
8c28abf427f5 reduce the number of keywords used and switch to BMP format for screenshots
koda
parents: 3513
diff changeset
    55
3513
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3487
diff changeset
    56
#if !__IPHONE_3_2
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3487
diff changeset
    57
typedef enum {
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3487
diff changeset
    58
    UIUserInterfaceIdiomPhone,           // iPhone and iPod touch style UI
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3487
diff changeset
    59
    UIUserInterfaceIdiomPad,             // iPad style UI
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3487
diff changeset
    60
} UIUserInterfaceIdiom;
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3487
diff changeset
    61
#define UI_USER_INTERFACE_IDIOM() UIUserInterfaceIdiomPhone
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3487
diff changeset
    62
#define UIPopoverController id
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3487
diff changeset
    63
#endif // ifndef __IPHONE_3_2