From a34cfadff1fc28145a32f3d600fdb518202320f8 Mon Sep 17 00:00:00 2001 From: meancoot Date: Fri, 20 Sep 2013 15:14:38 -0400 Subject: [PATCH] (iOS) Fix hiding the status bar while the game is running on iOS 7. Enable all game orientations if .RetroArch/frontend.cfg is not present. --- apple/iOS/RetroArch-Info.plist | 2 ++ apple/iOS/platform.m | 40 +++++++++++++++++----------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/apple/iOS/RetroArch-Info.plist b/apple/iOS/RetroArch-Info.plist index a466763c29..f150d7fd46 100644 --- a/apple/iOS/RetroArch-Info.plist +++ b/apple/iOS/RetroArch-Info.plist @@ -2,6 +2,8 @@ + UIViewControllerBasedStatusBarAppearance + CFBundleDevelopmentRegion en CFBundleDisplayName diff --git a/apple/iOS/platform.m b/apple/iOS/platform.m index 06e0c349b8..0a489d24dc 100644 --- a/apple/iOS/platform.m +++ b/apple/iOS/platform.m @@ -262,28 +262,28 @@ static void handle_touch_event(NSArray* touches) // Read load time settings config_file_t* conf = config_file_new([self.systemConfigPath UTF8String]); + // Get enabled orientations + static const struct { const char* setting; uint32_t orientation; } orientationSettings[4] = + { + { "ios_allow_portrait", UIInterfaceOrientationMaskPortrait }, + { "ios_allow_portrait_upside_down", UIInterfaceOrientationMaskPortraitUpsideDown }, + { "ios_allow_landscape_left", UIInterfaceOrientationMaskLandscapeLeft }, + { "ios_allow_landscape_right", UIInterfaceOrientationMaskLandscapeRight } + }; + + _enabledOrientations = 0; + + for (int i = 0; i < 4; i ++) + { + bool enabled = false; + bool found = conf && config_get_bool(conf, orientationSettings[i].setting, &enabled); + + if (!found || enabled) + _enabledOrientations |= orientationSettings[i].orientation; + } + if (conf) { - // Get enabled orientations - static const struct { const char* setting; uint32_t orientation; } orientationSettings[4] = - { - { "ios_allow_portrait", UIInterfaceOrientationMaskPortrait }, - { "ios_allow_portrait_upside_down", UIInterfaceOrientationMaskPortraitUpsideDown }, - { "ios_allow_landscape_left", UIInterfaceOrientationMaskLandscapeLeft }, - { "ios_allow_landscape_right", UIInterfaceOrientationMaskLandscapeRight } - }; - - _enabledOrientations = 0; - - for (int i = 0; i < 4; i ++) - { - bool enabled = false; - bool found = config_get_bool(conf, orientationSettings[i].setting, &enabled); - - if (!found || enabled) - _enabledOrientations |= orientationSettings[i].orientation; - } - // Setup bluetooth mode ios_set_bluetooth_mode(objc_get_value_from_config(conf, @"ios_btmode", @"keyboard"));