diff --git a/menu/menu_entries.c b/menu/menu_entries.c index ae4137fd7a..22179388ea 100644 --- a/menu/menu_entries.c +++ b/menu/menu_entries.c @@ -355,15 +355,6 @@ void menu_entries_refresh(file_list_t *list) } } -rarch_setting_t *menu_setting_get_ptr(void) -{ - menu_entries_t *entries = menu_entries_data; - - if (!entries) - return NULL; - return entries->list_settings; -} - /* Sets the starting index of the menu entry list. */ void menu_entries_set_start(size_t i) { @@ -726,6 +717,14 @@ bool menu_entries_ctl(enum menu_entries_ctl_state state, void *data) *list = entries->menu_list; } return true; + case MENU_ENTRIES_CTL_SETTINGS_GET: + { + rarch_setting_t **settings = (rarch_setting_t**)data; + if (!settings || !entries) + return false; + *settings = entries->list_settings; + } + return true; case MENU_ENTRIES_CTL_INIT: return menu_entries_init(); case MENU_ENTRIES_CTL_SHOW_BACK: diff --git a/menu/menu_entries.h b/menu/menu_entries.h index 90f0b5d336..4314877307 100644 --- a/menu/menu_entries.h +++ b/menu/menu_entries.h @@ -107,6 +107,7 @@ enum menu_entries_ctl_state MENU_ENTRIES_CTL_DEINIT, MENU_ENTRIES_CTL_INIT, MENU_ENTRIES_CTL_LIST_GET, + MENU_ENTRIES_CTL_SETTINGS_GET, MENU_ENTRIES_CTL_NEEDS_REFRESH, MENU_ENTRIES_CTL_SHOW_BACK }; @@ -125,8 +126,6 @@ int menu_entries_get_title(char *title, size_t title_len); int menu_entries_get_core_title(char *title_msg, size_t title_msg_len); -rarch_setting_t *menu_setting_get_ptr(void); - void menu_entries_set_refresh(bool nonblocking); void menu_entries_unset_refresh(bool nonblocking); diff --git a/menu/menu_setting.c b/menu/menu_setting.c index c4dfb05488..b937b580b5 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -1856,8 +1856,10 @@ uint32_t menu_setting_get_index(rarch_setting_t *setting) **/ rarch_setting_t *menu_setting_find(const char *label) { - rarch_setting_t *setting = menu_setting_get_ptr(); - uint32_t needle = 0; + rarch_setting_t *setting = NULL; + uint32_t needle = 0; + + menu_entries_ctl(MENU_ENTRIES_CTL_SETTINGS_GET, &setting); if (!setting || !label) return NULL;