mirror of
https://github.com/libretro/RetroArch
synced 2025-03-01 07:13:35 +00:00
(XMB) Move all file_list caching actions inside the xmb display driver
This commit is contained in:
parent
3099f59719
commit
9fe3f9409e
@ -624,6 +624,7 @@ menu_ctx_driver_t menu_ctx_glui = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
glui_init_core_info,
|
||||
glui_update_core_info,
|
||||
&menu_ctx_backend_common,
|
||||
|
@ -1338,6 +1338,7 @@ menu_ctx_driver_t menu_ctx_lakka = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
lakka_init_core_info,
|
||||
lakka_update_core_info,
|
||||
&menu_ctx_backend_lakka,
|
||||
|
@ -30,6 +30,7 @@ typedef struct menu_ctx_driver
|
||||
void (*list_insert)(void *, const char *, const char *, size_t);
|
||||
void (*list_delete)(void *, size_t, size_t);
|
||||
void (*list_clear)(void *);
|
||||
void (*list_cache)(bool, unsigned);
|
||||
void (*list_set_selection)(void *);
|
||||
void (*init_core_info)(void *);
|
||||
void (*update_core_info)(void *);
|
||||
|
@ -594,6 +594,7 @@ menu_ctx_driver_t menu_ctx_rgui = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
rgui_update_core_info,
|
||||
&menu_ctx_backend_common,
|
||||
"rgui",
|
||||
|
@ -1390,6 +1390,31 @@ static void xmb_list_clear(void *data)
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static void xmb_list_cache(bool horizontal, unsigned action)
|
||||
{
|
||||
file_list_copy(driver.menu->menu_list->selection_buf, driver.menu->menu_list->selection_buf_old);
|
||||
file_list_copy(driver.menu->menu_list->menu_stack, driver.menu->menu_list->menu_stack_old);
|
||||
driver.menu->selection_ptr_old = driver.menu->selection_ptr;
|
||||
|
||||
if(!horizontal)
|
||||
return;
|
||||
|
||||
driver.menu->cat_selection_ptr_old = driver.menu->cat_selection_ptr;
|
||||
driver.menu->cat_selection_ptr += action == MENU_ACTION_LEFT ? -1 : 1;
|
||||
|
||||
size_t stack_size = driver.menu->menu_list->menu_stack->size;
|
||||
if (driver.menu->cat_selection_ptr == 0)
|
||||
{
|
||||
strlcpy(driver.menu->menu_list->menu_stack->list[stack_size-1].label, "Main Menu", PATH_MAX);
|
||||
driver.menu->menu_list->menu_stack->list[stack_size-1].type = MENU_SETTINGS;
|
||||
}
|
||||
else
|
||||
{
|
||||
strlcpy(driver.menu->menu_list->menu_stack->list[stack_size-1].label, "Horizontal Menu", PATH_MAX);
|
||||
driver.menu->menu_list->menu_stack->list[stack_size-1].type = MENU_SETTING_HORIZONTAL_MENU;
|
||||
}
|
||||
}
|
||||
|
||||
static void xmb_list_set_selection(void *data)
|
||||
{
|
||||
(void)data;
|
||||
@ -1424,7 +1449,6 @@ static void xmb_context_destroy(void *data)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
menu_ctx_driver_t menu_ctx_xmb = {
|
||||
NULL,
|
||||
xmb_get_message,
|
||||
@ -1448,6 +1472,7 @@ menu_ctx_driver_t menu_ctx_xmb = {
|
||||
xmb_list_insert,
|
||||
xmb_list_delete,
|
||||
xmb_list_clear,
|
||||
xmb_list_cache,
|
||||
xmb_list_set_selection,
|
||||
xmb_init_core_info,
|
||||
xmb_update_core_info,
|
||||
|
@ -981,24 +981,8 @@ static int action_toggle_mainmenu(unsigned type, const char *label,
|
||||
switch (push_list)
|
||||
{
|
||||
case 1:
|
||||
file_list_copy(driver.menu->menu_list->selection_buf, driver.menu->menu_list->selection_buf_old);
|
||||
file_list_copy(driver.menu->menu_list->menu_stack, driver.menu->menu_list->menu_stack_old);
|
||||
driver.menu->selection_ptr_old = driver.menu->selection_ptr;
|
||||
driver.menu->cat_selection_ptr_old = driver.menu->cat_selection_ptr;
|
||||
driver.menu->cat_selection_ptr += action == MENU_ACTION_LEFT ? -1 : 1;
|
||||
driver.menu->selection_ptr = 0;
|
||||
|
||||
size_t stack_size = driver.menu->menu_list->menu_stack->size;
|
||||
if (driver.menu->cat_selection_ptr == 0)
|
||||
{
|
||||
strlcpy(driver.menu->menu_list->menu_stack->list[stack_size-1].label, "Main Menu", PATH_MAX);
|
||||
driver.menu->menu_list->menu_stack->list[stack_size-1].type = MENU_SETTINGS;
|
||||
}
|
||||
else
|
||||
{
|
||||
strlcpy(driver.menu->menu_list->menu_stack->list[stack_size-1].label, "Horizontal Menu", PATH_MAX);
|
||||
driver.menu->menu_list->menu_stack->list[stack_size-1].type = MENU_SETTING_HORIZONTAL_MENU;
|
||||
}
|
||||
if (driver.menu_ctx->list_cache)
|
||||
driver.menu_ctx->list_cache(true, action);
|
||||
|
||||
if (cbs && cbs->action_content_list_switch)
|
||||
return cbs->action_content_list_switch(
|
||||
|
@ -163,11 +163,9 @@ void menu_list_pop_stack(menu_list_t *list)
|
||||
|
||||
if (file_list_get_size(list->menu_stack) > 1)
|
||||
{
|
||||
#ifdef HAVE_XMB
|
||||
file_list_copy(driver.menu->menu_list->selection_buf, driver.menu->menu_list->selection_buf_old);
|
||||
file_list_copy(driver.menu->menu_list->menu_stack, driver.menu->menu_list->menu_stack_old);
|
||||
driver.menu->selection_ptr_old = driver.menu->selection_ptr;
|
||||
#endif
|
||||
if (driver.menu_ctx->list_cache)
|
||||
driver.menu_ctx->list_cache(false, 0);
|
||||
|
||||
menu_list_pop(list->menu_stack, &driver.menu->selection_ptr);
|
||||
driver.menu->need_refresh = true;
|
||||
}
|
||||
@ -278,11 +276,8 @@ void menu_list_push_stack_refresh(menu_list_t *list,
|
||||
if (!list)
|
||||
return;
|
||||
|
||||
#ifdef HAVE_XMB
|
||||
file_list_copy(driver.menu->menu_list->selection_buf, driver.menu->menu_list->selection_buf_old);
|
||||
file_list_copy(driver.menu->menu_list->menu_stack, driver.menu->menu_list->menu_stack_old);
|
||||
driver.menu->selection_ptr_old = driver.menu->selection_ptr;
|
||||
#endif
|
||||
if (driver.menu_ctx->list_cache)
|
||||
driver.menu_ctx->list_cache(false, 0);
|
||||
|
||||
menu_list_push_stack(list, path, label, type, directory_ptr);
|
||||
menu_navigation_clear(driver.menu, true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user