From 29b13676c5682639cf618c67838f95331c7c0714 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 27 Jul 2013 17:45:56 +0200 Subject: [PATCH] (Apple) Implement environment_get in Apple frontend context driver --- frontend/frontend.c | 10 ---------- frontend/platform/platform_apple.c | 18 +++++++++++++++--- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/frontend/frontend.c b/frontend/frontend.c index 8c3ab8ab8f..39a092d28b 100644 --- a/frontend/frontend.c +++ b/frontend/frontend.c @@ -150,11 +150,8 @@ int rarch_main(int argc, char *argv[]) if (frontend_ctx && frontend_ctx->init) frontend_ctx->init(); -#if !defined(__APPLE__) rarch_main_clear_state(); rarch_get_environment(argc, argv); -#endif - #if !defined(RARCH_CONSOLE) #if defined(__APPLE__) @@ -176,13 +173,6 @@ int rarch_main(int argc, char *argv[]) #endif #ifdef HAVE_MENU -#ifdef IOS - char* system_directory = ios_get_rarch_system_directory(); - strlcpy(g_extern.savestate_dir, system_directory, sizeof(g_extern.savestate_dir)); - strlcpy(g_extern.savefile_dir, system_directory, sizeof(g_extern.savefile_dir)); - free(system_directory); -#endif - menu_init(); if (frontend_ctx && frontend_ctx->process_args) diff --git a/frontend/platform/platform_apple.c b/frontend/platform/platform_apple.c index 49f0b418c7..d3f1381c6c 100644 --- a/frontend/platform/platform_apple.c +++ b/frontend/platform/platform_apple.c @@ -9,8 +9,7 @@ * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with RetroArch. + * * You should have received a copy of the GNU General Public License along with RetroArch. * If not, see . */ @@ -82,8 +81,21 @@ static void system_shutdown(bool force) dispatch_async_f(dispatch_get_main_queue(), 0, apple_rarch_exited); } +static void environment_get(int argc, char *argv[]) +{ + (void)argc; + (void)argv; + +#ifdef IOS + char* system_directory = ios_get_rarch_system_directory(); + strlcpy(g_extern.savestate_dir, system_directory, sizeof(g_extern.savestate_dir)); + strlcpy(g_extern.savefile_dir, system_directory, sizeof(g_extern.savefile_dir)); + free(system_directory); +#endif +} + const frontend_ctx_driver_t frontend_ctx_apple = { - NULL, /* get_environment_settings */ + environment_get, /* environment_get */ NULL, /* init */ NULL, /* deinit */ NULL, /* exitspawn */