Create RARCH_MENU_CTL_LIST_SET_SELECTION

This commit is contained in:
twinaphex 2016-02-03 17:15:00 +01:00
parent 03ddb7baa2
commit 32b9303a79
3 changed files with 14 additions and 7 deletions

View File

@ -305,12 +305,19 @@ void menu_driver_list_free(file_list_t *list, size_t idx, size_t list_size)
file_list_free_actiondata(list, idx);
}
void menu_driver_list_set_selection(file_list_t *list)
static bool menu_driver_list_set_selection(void *data)
{
file_list_t *list = (file_list_t*)data;
const menu_ctx_driver_t *driver = menu_driver_ctx;
if (driver && driver->list_set_selection)
driver->list_set_selection(menu_userdata ? menu_userdata : NULL, list);
if (!list)
return false;
if (!driver || !driver->list_set_selection)
return false;
driver->list_set_selection(menu_userdata ? menu_userdata : NULL, list);
return true;
}
size_t menu_driver_list_get_selection(void)
@ -760,6 +767,8 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
case RARCH_MENU_CTL_SHADER_MANAGER_INIT:
menu_shader_manager_init(menu_driver_data);
return true;
case RARCH_MENU_CTL_LIST_SET_SELECTION:
return menu_driver_list_set_selection(data);
default:
case RARCH_MENU_CTL_NONE:
break;

View File

@ -133,6 +133,7 @@ enum rarch_menu_ctl_state
RARCH_MENU_CTL_CONTEXT_RESET,
RARCH_MENU_CTL_CONTEXT_DESTROY,
RARCH_MENU_CTL_SHADER_MANAGER_INIT,
RARCH_MENU_CTL_LIST_SET_SELECTION,
RARCH_MENU_CTL_POPULATE_ENTRIES
};
@ -362,8 +363,6 @@ void menu_driver_list_free(file_list_t *list, size_t i, size_t list_size);
size_t menu_driver_list_get_size(menu_list_type_t type);
void menu_driver_list_set_selection(file_list_t *list);
void *menu_driver_list_get_entry(menu_list_type_t type, unsigned i);
bool menu_driver_list_push(menu_displaylist_info_t *info, unsigned type);

View File

@ -172,8 +172,7 @@ static bool menu_list_pop_stack(menu_list_t *list, size_t idx, size_t *directory
menu_driver_list_free(menu_list, menu_list->size - 1, menu_list->size - 1);
file_list_pop(menu_list, directory_ptr);
menu_driver_list_set_selection(menu_list);
menu_driver_ctl(RARCH_MENU_CTL_LIST_SET_SELECTION, menu_list);
menu_entries_ctl(MENU_ENTRIES_CTL_SET_REFRESH, &refresh);
return true;