From 292418492e87b12cb5c6d880ee23e329fc47b01e Mon Sep 17 00:00:00 2001 From: meancoot Date: Sat, 7 Dec 2013 18:49:03 -0500 Subject: [PATCH] (iOS) Make keeping the frontend settings updated more efficient --- apple/iOS/menu.m | 5 +---- apple/iOS/platform.m | 13 ++++++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apple/iOS/menu.m b/apple/iOS/menu.m index aa8024c1af..357efd651f 100644 --- a/apple/iOS/menu.m +++ b/apple/iOS/menu.m @@ -656,9 +656,7 @@ static const void* const associated_core_key = &associated_core_key; const rarch_setting_t* frontend_setting_data = apple_get_frontend_settings(); if ((self = [super initWithGroup:frontend_setting_data])) - { - [[RetroArch_iOS get] refreshSystemConfig]; - + { RAFrontendSettingsMenu* __weak weakSelf = self; self.title = @"Frontend Settings"; @@ -688,7 +686,6 @@ static const void* const associated_core_key = &associated_core_key; - (void)dealloc { setting_data_save_config_path(apple_get_frontend_settings(), [RetroArch_iOS get].systemConfigPath.UTF8String); - [[RetroArch_iOS get] refreshSystemConfig]; } - (void)showCoreConfigFor:(NSString*)core diff --git a/apple/iOS/platform.m b/apple/iOS/platform.m index 653283248d..c8a3320524 100644 --- a/apple/iOS/platform.m +++ b/apple/iOS/platform.m @@ -234,6 +234,11 @@ static void handle_touch_event(NSArray* touches) if (!core_list || core_list->count == 0) apple_display_alert(@"No libretro cores were found. You will not be able to run any content.", 0); + + // Load system config + const rarch_setting_t* frontend_settings = apple_get_frontend_settings(); + setting_data_reset(frontend_settings); + setting_data_load_config_path(frontend_settings, self.systemConfigPath.UTF8String); } - (void)applicationDidBecomeActive:(UIApplication *)application @@ -273,6 +278,9 @@ static void handle_touch_event(NSArray* touches) [self setNavigationBarHidden:_isGameTop animated:!_isGameTop]; [self setToolbarHidden:!viewController.toolbarItems.count animated:YES]; + + // Workaround to keep frontend settings fresh + [self refreshSystemConfig]; } // NOTE: This version only runs on iOS6 @@ -324,11 +332,6 @@ static void handle_touch_event(NSArray* touches) #pragma mark FRONTEND CONFIG - (void)refreshSystemConfig { - const rarch_setting_t* frontend_settings = apple_get_frontend_settings(); - - setting_data_reset(frontend_settings); - setting_data_load_config_path(frontend_settings, self.systemConfigPath.UTF8String); - // Get enabled orientations _enabledOrientations = UIInterfaceOrientationMaskAll;