project_files/HedgewarsMobile/Hedgewars_Prefix.pch
author koda
Mon, 02 Aug 2010 00:55:24 +0200
changeset 3703 12d17c6e8855
parent 3701 8c449776ebe6
child 3829 81db3c85784b
permissions -rw-r--r--
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up

//
// Prefix header for all source files of the 'OpenGL ES app' target in the 'OpenGL ES app' project
//

#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import <CoreGraphics/CoreGraphics.h>
#import <UIKit/UIKit.h>
#import "PascalImports.h"
#import "UIImageExtra.h"
#import "CommodityFunctions.h"
#import "SDL.h"
#import "SDL_video.h"
#import "SDL_net.h"
#import "SDL_mixer.h"
#endif

// by http://www.cimgf.com/2010/05/02/my-current-prefix-pch-file/
#ifdef DEBUG
  #define DLog(...) NSLog(@"%s %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__])
  #define ALog(...) [[NSAssertionHandler currentHandler] handleFailureInFunction:[NSString stringWithCString:__PRETTY_FUNCTION__ encoding:NSUTF8StringEncoding] file:[NSString stringWithCString:__FILE__ encoding:NSUTF8StringEncoding] lineNumber:__LINE__ description:__VA_ARGS__]
#else
  #define DLog(...) do { } while (0)
  #ifndef NS_BLOCK_ASSERTIONS
    #define NS_BLOCK_ASSERTIONS
  #endif
  #define ALog(...) NSLog(@"%s %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__])
#endif

#define ZAssert(condition, ...) do { if (!(condition)) { ALog(__VA_ARGS__); }} while(0)

// by http://blog.coriolis.ch/2009/01/05/macros-for-xcode/
#define START_TIMER NSTimeInterval start = [NSDate timeIntervalSinceReferenceDate];
#define END_TIMER(msg) 	NSTimeInterval stop = [NSDate timeIntervalSinceReferenceDate]; CMLog([NSString stringWithFormat:@"%@ Time = %f", msg, stop-start]);

#define releaseAndNil(x) [x release], x = nil;


#if !__IPHONE_3_2
typedef enum {
    UIUserInterfaceIdiomPhone,           // iPhone and iPod touch style UI
    UIUserInterfaceIdiomPad,             // iPad style UI
} UIUserInterfaceIdiom;
#define UI_USER_INTERFACE_IDIOM() UIUserInterfaceIdiomPhone
#define UIPopoverController id
#endif // ifndef __IPHONE_3_2