# HG changeset patch # User koda # Date 1327801683 -3600 # Node ID 8fd6bb239a1e11a269440638124cdbaafb9e7f50 # Parent d9d00e537010b18ef0e615843ab0d8292e8085b8 starting to convert the ipad interface to support all ortientations... diff -r d9d00e537010 -r 8fd6bb239a1e project_files/HedgewarsMobile/Classes/DefinesAndMacros.h --- a/project_files/HedgewarsMobile/Classes/DefinesAndMacros.h Sun Jan 29 02:45:12 2012 +0100 +++ b/project_files/HedgewarsMobile/Classes/DefinesAndMacros.h Sun Jan 29 02:48:03 2012 +0100 @@ -38,7 +38,7 @@ #define ZAssert(condition, ...) do { if (!(condition)) { ALog(__VA_ARGS__); }} while(0) -#define rotationManager(x) (x == UIInterfaceOrientationLandscapeRight) || (x == UIInterfaceOrientationLandscapeLeft) +#define rotationManager(x) (IS_IPAD() ? YES : (x == UIInterfaceOrientationLandscapeRight) || (x == UIInterfaceOrientationLandscapeLeft)) #define START_TIMER NSTimeInterval start = [NSDate timeIntervalSinceReferenceDate]; #define END_TIMER(msg) NSTimeInterval stop = [NSDate timeIntervalSinceReferenceDate]; CMLog([NSString stringWithFormat:@"%@ Time = %f", msg, stop-start]); diff -r d9d00e537010 -r 8fd6bb239a1e project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m --- a/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m Sun Jan 29 02:45:12 2012 +0100 +++ b/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m Sun Jan 29 02:48:03 2012 +0100 @@ -129,8 +129,14 @@ height = screenBounds.size.height; } else { CGRect screenBounds = [[UIScreen mainScreen] bounds]; - width = screenBounds.size.height; - height = screenBounds.size.width; + UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; + if ((orientation == UIInterfaceOrientationLandscapeLeft) || (orientation == UIInterfaceOrientationLandscapeRight)) { + width = screenBounds.size.height; + height = screenBounds.size.width; + } else { + width = screenBounds.size.width; + height = screenBounds.size.height; + } } NSString *horizontalSize = [[NSString alloc] initWithFormat:@"%d", (int)(width * screenScale)]; diff -r d9d00e537010 -r 8fd6bb239a1e project_files/HedgewarsMobile/Classes/OverlayViewController.m --- a/project_files/HedgewarsMobile/Classes/OverlayViewController.m Sun Jan 29 02:45:12 2012 +0100 +++ b/project_files/HedgewarsMobile/Classes/OverlayViewController.m Sun Jan 29 02:48:03 2012 +0100 @@ -66,8 +66,12 @@ -(void) viewDidLoad { // fill all the screen available as sdlview disables autoresizing CGRect rect = [[UIScreen mainScreen] bounds]; - self.view.frame = CGRectMake(0, 0, rect.size.height, rect.size.width); - + UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; + if ((orientation == UIInterfaceOrientationLandscapeLeft) || (orientation == UIInterfaceOrientationLandscapeRight)) { + self.view.frame = CGRectMake(0, 0, rect.size.height, rect.size.width); + } else { + self.view.frame = CGRectMake(0, 0, rect.size.width, rect.size.height); + } // the timer used to dim the overlay dimTimer = [[NSTimer alloc] initWithFireDate:(IS_DUALHEAD()) ? HIDING_TIME_NEVER : [NSDate dateWithTimeIntervalSinceNow:6] interval:1000 diff -r d9d00e537010 -r 8fd6bb239a1e project_files/HedgewarsMobile/Info.plist --- a/project_files/HedgewarsMobile/Info.plist Sun Jan 29 02:45:12 2012 +0100 +++ b/project_files/HedgewarsMobile/Info.plist Sun Jan 29 02:48:03 2012 +0100 @@ -37,10 +37,17 @@ UILaunchImageFile~ipad Default-ipad - UISupportedInterfaceOrientations + UISupportedInterfaceOrientations~iphone UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight +