project_files/HedgewarsMobile/Classes/OverlayViewController.m
changeset 6612 8fd6bb239a1e
parent 6268 d773867f93db
child 6615 65602f1ef0f8
--- 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