author | unc0rr |
Fri, 09 Sep 2011 22:04:40 +0400 | |
changeset 5829 | 3ec95dc2b249 |
parent 5208 | 878e551f0b4a |
child 6000 | dbcebcd3d79f |
permissions | -rw-r--r-- |
3829 | 1 |
/* |
2 |
* Hedgewars-iOS, a Hedgewars port for iOS devices |
|
3 |
* Copyright (c) 2009-2010 Vittorio Giovara <vittorio.giovara@gmail.com> |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation; version 2 of the License |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
17 |
*/ |
|
3366 | 18 |
|
5208 | 19 |
|
20 |
// some macros by http://www.cimgf.com/2010/05/02/my-current-prefix-pch-file/ |
|
21 |
// and http://blog.coriolis.ch/2009/01/05/macros-for-xcode/ |
|
22 |
||
3366 | 23 |
#ifdef __OBJC__ |
24 |
#import <Foundation/Foundation.h> |
|
25 |
#import <CoreGraphics/CoreGraphics.h> |
|
26 |
#import <UIKit/UIKit.h> |
|
3701 | 27 |
#import "PascalImports.h" |
28 |
#import "UIImageExtra.h" |
|
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" |
3701 | 31 |
#import "SDL.h" |
32 |
#import "SDL_video.h" |
|
33 |
#import "SDL_net.h" |
|
34 |
#import "SDL_mixer.h" |
|
3366 | 35 |
#endif |
3487 | 36 |
|
5208 | 37 |
|
3487 | 38 |
#ifdef DEBUG |
39 |
#define DLog(...) NSLog(@"%s %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__]) |
|
40 |
#define ALog(...) [[NSAssertionHandler currentHandler] handleFailureInFunction:[NSString stringWithCString:__PRETTY_FUNCTION__ encoding:NSUTF8StringEncoding] file:[NSString stringWithCString:__FILE__ encoding:NSUTF8StringEncoding] lineNumber:__LINE__ description:__VA_ARGS__] |
|
5208 | 41 |
#define releaseAndNil(x) [x release] |
3487 | 42 |
#else |
43 |
#define DLog(...) do { } while (0) |
|
44 |
#ifndef NS_BLOCK_ASSERTIONS |
|
45 |
#define NS_BLOCK_ASSERTIONS |
|
46 |
#endif |
|
47 |
#define ALog(...) NSLog(@"%s %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__]) |
|
5208 | 48 |
#define releaseAndNil(x) [x release], x = nil |
3487 | 49 |
#endif |
3701 | 50 |
|
5208 | 51 |
|
3487 | 52 |
#define ZAssert(condition, ...) do { if (!(condition)) { ALog(__VA_ARGS__); }} while(0) |
5208 | 53 |
#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
|
54 |
|
3663
8c28abf427f5
reduce the number of keywords used and switch to BMP format for screenshots
koda
parents:
3513
diff
changeset
|
55 |
#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
|
56 |
#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
|
57 |
|
8c28abf427f5
reduce the number of keywords used and switch to BMP format for screenshots
koda
parents:
3513
diff
changeset
|
58 |
|
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
|
59 |
#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
|
60 |
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
|
61 |
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
|
62 |
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
|
63 |
} 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
|
64 |
#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
|
65 |
#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
|
66 |
#endif // ifndef __IPHONE_3_2 |