OSDN Git Service

IOSApplicationConfiguration updated: landscape/portrait update.
authorChristoph Aschwanden <contact@noblemaster.com>
Thu, 27 Sep 2012 11:52:57 +0000 (20:52 +0900)
committerChristoph Aschwanden <contact@noblemaster.com>
Thu, 27 Sep 2012 11:52:57 +0000 (20:52 +0900)
backends/gdx-backend-iosmonotouch/src/com/badlogic/gdx/backends/ios/IOSApplication.java
backends/gdx-backend-iosmonotouch/src/com/badlogic/gdx/backends/ios/IOSApplicationConfiguration.java

index 3f6b81b..ad675ad 100644 (file)
@@ -35,7 +35,6 @@ import com.badlogic.gdx.Gdx;
 import com.badlogic.gdx.Graphics;\r
 import com.badlogic.gdx.Input;\r
 import com.badlogic.gdx.Preferences;\r
-import com.badlogic.gdx.backends.ios.IOSApplicationConfiguration.SupportedOrientation;\r
 import com.badlogic.gdx.utils.Clipboard;\r
 \r
 public class IOSApplication extends UIApplicationDelegate implements Application {\r
@@ -58,7 +57,7 @@ public class IOSApplication extends UIApplicationDelegate implements Application
         */\r
        public IOSApplication(ApplicationListener listener, IOSApplicationConfiguration config) {\r
                this.listener = listener;\r
-               this.config = config;\r
+               this.config = config; \r
                Gdx.app = this;\r
        }\r
        \r
@@ -85,12 +84,10 @@ public class IOSApplication extends UIApplicationDelegate implements Application
                                switch (orientation.Value) { \r
                                        case UIInterfaceOrientation.LandscapeLeft: \r
                                        case UIInterfaceOrientation.LandscapeRight: \r
-                                          return config.supportedOrientation == SupportedOrientation.LANDSCAPE ||\r
-                                                 config.supportedOrientation == SupportedOrientation.BOTH;\r
+                                          return config.orientationLandscape;\r
                                        default: \r
                                                // assume portrait\r
-                                          return config.supportedOrientation == SupportedOrientation.PORTRAIT ||\r
-                                       config.supportedOrientation == SupportedOrientation.BOTH;\r
+                                          return config.orientationPortrait;\r
                                } \r
                        }\r
                };\r
index a01351f..3ab8b17 100644 (file)
@@ -2,18 +2,10 @@ package com.badlogic.gdx.backends.ios;
 
 public class IOSApplicationConfiguration {
        
-       /** The orientation the application/game is supporting. */
-       public enum SupportedOrientation {
-               /** Portrait only. */
-               PORTRAIT,
-               /** Landscape only. */
-               LANDSCAPE,
-               /** Both landscape & portrait. */
-               BOTH;
-       }
-       
-       /** The screen orientations the application supports. */
-       public SupportedOrientation supportedOrientation = SupportedOrientation.BOTH;
+       /** whether or not portrait orientation is supported. */
+       public boolean orientationPortrait = true;
+       /** whether or not landscape orientation is supported. */
+       public boolean orientationLandscape = true;
        /** whether to use the accelerometer **/
        public boolean useAccelerometer = true;
        /** the update interval to poll the accelerometer with, in seconds **/