Create MENU_ENTRIES_CTL_SETTINGS_GET

This commit is contained in:
twinaphex 2015-12-11 22:30:19 +01:00
parent 7942328e39
commit ee312b346b
3 changed files with 13 additions and 13 deletions

View File

@ -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:

View File

@ -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);

View File

@ -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;