From 362d8025d89af0f708b41ab6a04b1758d215d97d Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 4 Jul 2015 04:47:14 +0200 Subject: [PATCH] Add g_defaults.core_assets_dir --- configuration.c | 3 +++ frontend/drivers/platform_android.c | 2 ++ frontend/drivers/platform_ctr.c | 2 ++ frontend/drivers/platform_darwin.m | 1 + frontend/frontend.c | 4 ++++ general.h | 1 + 6 files changed, 13 insertions(+) diff --git a/configuration.c b/configuration.c index f75c9a88af..e00b1b11e3 100644 --- a/configuration.c +++ b/configuration.c @@ -740,6 +740,9 @@ static void config_set_defaults(void) if (*g_defaults.assets_dir) strlcpy(settings->assets_directory, g_defaults.assets_dir, sizeof(settings->assets_directory)); + if (*g_defaults.core_assets_dir) + strlcpy(settings->core_assets_directory, + g_defaults.core_assets_dir, sizeof(settings->core_assets_directory)); if (*g_defaults.playlist_dir) strlcpy(settings->playlist_directory, g_defaults.playlist_dir, sizeof(settings->playlist_directory)); diff --git a/frontend/drivers/platform_android.c b/frontend/drivers/platform_android.c index 3e0317757a..15db5ce47b 100644 --- a/frontend/drivers/platform_android.c +++ b/frontend/drivers/platform_android.c @@ -627,6 +627,8 @@ static void frontend_android_get_environment_settings(int *argc, path, "remaps", sizeof(g_defaults.remap_dir)); fill_pathname_join(g_defaults.wallpapers_dir, path, "wallpapers", sizeof(g_defaults.wallpapers_dir)); + fill_pathname_join(g_defaults.core_assets_dir, + path, "core_assets", sizeof(g_defaults.wallpapers_dir)); } } } diff --git a/frontend/drivers/platform_ctr.c b/frontend/drivers/platform_ctr.c index b20a45586f..c1b85d47b2 100644 --- a/frontend/drivers/platform_ctr.c +++ b/frontend/drivers/platform_ctr.c @@ -59,6 +59,8 @@ static void frontend_ctr_get_environment_settings(int *argc, char *argv[], fill_pathname_basedir(g_defaults.port_dir, elf_path_cst, sizeof(g_defaults.port_dir)); RARCH_LOG("port dir: [%s]\n", g_defaults.port_dir); + fill_pathname_join(g_defaults.core_assets_dir, g_defaults.port_dir, + "core_assets", sizeof(g_defaults.core_assets_dir)); fill_pathname_join(g_defaults.assets_dir, g_defaults.port_dir, "media", sizeof(g_defaults.assets_dir)); fill_pathname_join(g_defaults.core_dir, g_defaults.port_dir, diff --git a/frontend/drivers/platform_darwin.m b/frontend/drivers/platform_darwin.m index 0d127c8edf..2be035f048 100644 --- a/frontend/drivers/platform_darwin.m +++ b/frontend/drivers/platform_darwin.m @@ -337,6 +337,7 @@ static void frontend_darwin_get_environment_settings(int *argc, char *argv[], fill_pathname_join(g_defaults.core_info_dir, home_dir_buf, "info", sizeof(g_defaults.core_info_dir)); fill_pathname_join(g_defaults.overlay_dir, home_dir_buf, "overlays", sizeof(g_defaults.overlay_dir)); fill_pathname_join(g_defaults.autoconfig_dir, home_dir_buf, "autoconfig/hid", sizeof(g_defaults.autoconfig_dir)); + fill_pathname_join(g_defaults.core_assets_dir, home_dir_buf, "core_assets", sizeof(g_defaults.core_assets_dir)); fill_pathname_join(g_defaults.assets_dir, home_dir_buf, "assets", sizeof(g_defaults.assets_dir)); fill_pathname_join(g_defaults.system_dir, home_dir_buf, ".RetroArch", sizeof(g_defaults.system_dir)); strlcpy(g_defaults.menu_config_dir, g_defaults.system_dir, sizeof(g_defaults.menu_config_dir)); diff --git a/frontend/frontend.c b/frontend/frontend.c index 66766e2118..993b193806 100644 --- a/frontend/frontend.c +++ b/frontend/frontend.c @@ -124,6 +124,10 @@ void main_exit(void *args) static void check_defaults_dirs(void) { + if (*g_defaults.core_assets_dir) + path_mkdir(g_defaults.core_assets_dir); + if (*g_defaults.remap_dir) + path_mkdir(g_defaults.remap_dir); if (*g_defaults.autoconfig_dir) path_mkdir(g_defaults.autoconfig_dir); if (*g_defaults.audio_filter_dir) diff --git a/general.h b/general.h index a803820865..fcde39d9e0 100644 --- a/general.h +++ b/general.h @@ -71,6 +71,7 @@ enum sound_mode_enums struct defaults { + char core_assets_dir[PATH_MAX_LENGTH]; char menu_config_dir[PATH_MAX_LENGTH]; char config_path[PATH_MAX_LENGTH]; char core_path[PATH_MAX_LENGTH];