project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m
changeset 6612 8fd6bb239a1e
parent 6527 d19c6af9fa48
child 6615 65602f1ef0f8
--- 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)];