# HG changeset patch # User koda # Date 1327962028 -3600 # Node ID 65602f1ef0f89ccb7db4114ae5a8bb2cfa986707 # Parent f88f67a17a9dcecf339d410bb197b37b8c6bf623 more ios pages supporting rotaiton diff -r f88f67a17a9d -r 65602f1ef0f8 project_files/HedgewarsMobile/Classes/ExtraCategories.h --- a/project_files/HedgewarsMobile/Classes/ExtraCategories.h Mon Jan 30 07:51:30 2012 +0100 +++ b/project_files/HedgewarsMobile/Classes/ExtraCategories.h Mon Jan 30 23:20:28 2012 +0100 @@ -25,6 +25,7 @@ @interface UIScreen (safe) -(CGFloat) safeScale; +-(CGRect) safeBounds; @end diff -r f88f67a17a9d -r 65602f1ef0f8 project_files/HedgewarsMobile/Classes/ExtraCategories.m --- a/project_files/HedgewarsMobile/Classes/ExtraCategories.m Mon Jan 30 07:51:30 2012 +0100 +++ b/project_files/HedgewarsMobile/Classes/ExtraCategories.m Mon Jan 30 23:20:28 2012 +0100 @@ -34,6 +34,16 @@ return theScale; } +-(CGRect) safeBounds { + CGRect original = [self bounds]; + if (IS_IPAD() && + ([[UIApplication sharedApplication] statusBarOrientation] == UIInterfaceOrientationPortrait || + [[UIApplication sharedApplication] statusBarOrientation] == UIInterfaceOrientationPortraitUpsideDown) ) { + return original; + } else + return CGRectMake(original.origin.x, original.origin.y, original.size.height, original.size.width); +} + @end diff -r f88f67a17a9d -r 65602f1ef0f8 project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m --- a/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m Mon Jan 30 07:51:30 2012 +0100 +++ b/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m Mon Jan 30 23:20:28 2012 +0100 @@ -128,15 +128,9 @@ width = screenBounds.size.width; height = screenBounds.size.height; } else { - CGRect screenBounds = [[UIScreen mainScreen] bounds]; - 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; - } + CGRect screenBounds = [[UIScreen mainScreen] safeBounds]; + width = screenBounds.size.width; + height = screenBounds.size.height; } NSString *horizontalSize = [[NSString alloc] initWithFormat:@"%d", (int)(width * screenScale)]; diff -r f88f67a17a9d -r 65602f1ef0f8 project_files/HedgewarsMobile/Classes/MainMenuViewController-iPad.xib --- a/project_files/HedgewarsMobile/Classes/MainMenuViewController-iPad.xib Mon Jan 30 07:51:30 2012 +0100 +++ b/project_files/HedgewarsMobile/Classes/MainMenuViewController-iPad.xib Mon Jan 30 23:20:28 2012 +0100 @@ -39,7 +39,7 @@ - 292 + 294 YES @@ -56,8 +56,8 @@ - 292 - {{383, 389}, {263, 244}} + 301 + {{383, 389}, {271, 244}} NO IBIPadFramework @@ -91,10 +91,10 @@ - 292 - {{795, 317}, {18, 19}} + 289 + {{986, 19}, {18, 19}} - NO + YES 0.31690141558647156 3 IBIPadFramework @@ -112,7 +112,7 @@ - 292 + 265 {{940, 686}, {64, 64}} NO @@ -134,7 +134,7 @@ - 292 + 268 {{20, 686}, {64, 64}} NO @@ -156,7 +156,7 @@ - 292 + 301 {{242, 43}, {540, 300}} NO @@ -168,7 +168,7 @@ - 292 + 269 {{468, 686}, {89, 37}} NO @@ -272,11 +272,11 @@ YES - + @@ -354,13 +354,13 @@ YES MainMenuViewController UIResponder - {{267, 388}, {1024, 768}} + {{89, 260}, {1024, 768}} com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - P4AAAL+AAABERQAAw56AAA + P4AAAL+AAABERsAAw6cAAA com.apple.InterfaceBuilder.IBCocoaTouchPlugin diff -r f88f67a17a9d -r 65602f1ef0f8 project_files/HedgewarsMobile/Classes/MainMenuViewController.m --- a/project_files/HedgewarsMobile/Classes/MainMenuViewController.m Mon Jan 30 07:51:30 2012 +0100 +++ b/project_files/HedgewarsMobile/Classes/MainMenuViewController.m Mon Jan 30 23:20:28 2012 +0100 @@ -91,6 +91,7 @@ #pragma mark - -(void) viewDidLoad { + self.view.frame = [[UIScreen mainScreen] safeBounds]; [super viewDidLoad]; // get the app's version diff -r f88f67a17a9d -r 65602f1ef0f8 project_files/HedgewarsMobile/Classes/ObjcExports.m --- a/project_files/HedgewarsMobile/Classes/ObjcExports.m Mon Jan 30 07:51:30 2012 +0100 +++ b/project_files/HedgewarsMobile/Classes/ObjcExports.m Mon Jan 30 23:20:28 2012 +0100 @@ -69,6 +69,10 @@ overlay_instance.loadingIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; overlay_instance.loadingIndicator.hidesWhenStopped = YES; overlay_instance.loadingIndicator.center = loaderCenter; + overlay_instance.loadingIndicator.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | + UIViewAutoresizingFlexibleRightMargin | + UIViewAutoresizingFlexibleTopMargin | + UIViewAutoresizingFlexibleBottomMargin; [overlay_instance.loadingIndicator startAnimating]; [overlay_instance.view addSubview:overlay_instance.loadingIndicator]; [overlay_instance.loadingIndicator release]; diff -r f88f67a17a9d -r 65602f1ef0f8 project_files/HedgewarsMobile/Classes/OverlayViewController.m --- a/project_files/HedgewarsMobile/Classes/OverlayViewController.m Mon Jan 30 07:51:30 2012 +0100 +++ b/project_files/HedgewarsMobile/Classes/OverlayViewController.m Mon Jan 30 23:20:28 2012 +0100 @@ -65,13 +65,7 @@ -(void) viewDidLoad { // fill all the screen available as sdlview disables autoresizing - CGRect rect = [[UIScreen mainScreen] bounds]; - 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); - } + self.view.frame = [[UIScreen mainScreen] safeBounds]; // the timer used to dim the overlay dimTimer = [[NSTimer alloc] initWithFireDate:(IS_DUALHEAD()) ? HIDING_TIME_NEVER : [NSDate dateWithTimeIntervalSinceNow:6] interval:1000