diff --git a/configuration.c b/configuration.c index d5513be3bd..90dd11b989 100644 --- a/configuration.c +++ b/configuration.c @@ -3227,3 +3227,15 @@ bool config_replace(char *path) return true; } + +const char *config_get_active_path(void) +{ + settings_t *settings = config_get_ptr(); + global_t *global = global_get_ptr(); + if (!string_is_empty(global->path.core_specific_config) + && settings->core_specific_config) + return global->path.core_specific_config; + else if (!string_is_empty(global->path.config)) + return global->path.config; + return NULL; +} diff --git a/configuration.h b/configuration.h index 138c5e3f4a..572d3aa441 100644 --- a/configuration.h +++ b/configuration.h @@ -596,6 +596,8 @@ bool config_init(void); void config_free(void); +const char *config_get_active_path(void); + settings_t *config_get_ptr(void); RETRO_END_DECLS diff --git a/menu/menu_shader.c b/menu/menu_shader.c index 04986ba77b..f5d5947da3 100644 --- a/menu/menu_shader.c +++ b/menu/menu_shader.c @@ -38,9 +38,8 @@ void menu_shader_manager_init(menu_handle_t *menu) #ifdef HAVE_SHADER_MANAGER struct video_shader *shader = NULL; config_file_t *conf = NULL; - const char *config_path = NULL; settings_t *settings = config_get_ptr(); - global_t *global = global_get_ptr(); + const char *config_path = config_get_active_path(); if (!menu) return; @@ -48,15 +47,6 @@ void menu_shader_manager_init(menu_handle_t *menu) menu_driver_ctl(RARCH_MENU_CTL_SHADER_GET, &shader); - if (global) - { - if (!string_is_empty(global->path.core_specific_config) - && settings->core_specific_config) - config_path = global->path.core_specific_config; - else if (!string_is_empty(global->path.config)) - config_path = global->path.config; - } - /* In a multi-config setting, we can't have * conflicts on menu.cgp/menu.glslp. */ if (config_path)