(Menu) Add back get_load_content_animation_data

This commit is contained in:
twinaphex 2019-02-08 08:24:33 +01:00
parent 386657a366
commit 59ded50d59
9 changed files with 88 additions and 12 deletions

View File

@ -2773,8 +2773,9 @@ menu_ctx_driver_t menu_ctx_mui = {
NULL,
NULL,
menu_display_osk_ptr_at_pos,
NULL,
NULL,
NULL, /* update_savestate_thumbnail_path */
NULL, /* update_savestate_thumbnail_image */
materialui_pointer_down,
materialui_pointer_up,
NULL /* get_load_content_animation_data */
};

View File

@ -96,4 +96,7 @@ menu_ctx_driver_t menu_ctx_null = {
NULL, /* osk_ptr_at_pos */
NULL, /* update_savestate_thumbnail_path */
NULL, /* update_savestate_thumbnail_image */
NULL, /* pointer_down */
NULL, /* pointer_up */
NULL, /* get_load_content_animation_data */
};

View File

@ -1854,6 +1854,28 @@ static int ozone_list_bind_init(menu_file_list_cbs_t *cbs,
return -1;
}
#ifdef HAVE_MENU_WIDGETS
static bool ozone_get_load_content_animation_data(void *userdata, menu_texture_item *icon, char **playlist_name)
{
ozone_handle_t *ozone = (ozone_handle_t*) userdata;
if (ozone->categories_selection_ptr > ozone->system_tab_end)
{
ozone_node_t *node = file_list_get_userdata_at_offset(ozone->horizontal_list, ozone->categories_selection_ptr - ozone->system_tab_end-1);
*icon = node->icon;
*playlist_name = node->console_name;
}
else
{
*icon = ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_QUICKMENU];
*playlist_name = "RetroArch";
}
return true;
}
#endif
menu_ctx_driver_t menu_ctx_ozone = {
NULL, /* set_texture */
ozone_messagebox,
@ -1896,6 +1918,11 @@ menu_ctx_driver_t menu_ctx_ozone = {
menu_display_osk_ptr_at_pos,
NULL, /* update_savestate_thumbnail_path */
NULL, /* update_savestate_thumbnail_image */
NULL,
NULL, /* pointer_down */
NULL, /* pointer_up */
#ifdef HAVE_MENU_WIDGETS
ozone_get_load_content_animation_data
#else
NULL
#endif
};

View File

@ -2288,11 +2288,14 @@ menu_ctx_driver_t menu_ctx_rgui = {
"rgui",
rgui_environ,
rgui_pointer_tap,
NULL,
NULL, /* update_thumbnail_path */
rgui_update_thumbnail_image,
rgui_set_thumbnail_system,
NULL,
NULL,
NULL,
NULL
NULL, /* set_thumbnail_content */
NULL, /* osk_ptr_at_pos */
NULL, /* update_savestate_thumbnail_path */
NULL, /* update_savestate_thumbnail_image */
NULL, /* pointer_down */
NULL, /* pointer_up */
NULL, /* get_load_content_animation_data */
};

View File

@ -4457,5 +4457,8 @@ menu_ctx_driver_t menu_ctx_stripes = {
stripes_set_thumbnail_content,
stripes_osk_ptr_at_pos,
stripes_update_savestate_thumbnail_path,
stripes_update_savestate_thumbnail_image
stripes_update_savestate_thumbnail_image,
NULL, /* pointer_down */
NULL, /* pointer_up */
NULL /* get_load_content_animation_data */
};

View File

@ -3070,7 +3070,7 @@ static void xmb_draw_items(
menu_display_ctx_rotate_draw_t rotate_draw;
xmb_node_t *core_node = NULL;
size_t end = 0;
uint64_t frame_count = xmb ? xmb->frame_count : 0;
uint64_t frame_count = xmb->frame_count;
const char *thumb_ident = xmb_thumbnails_ident('R');
const char *left_thumb_ident= xmb_thumbnails_ident('L');
@ -5771,6 +5771,28 @@ static int xmb_pointer_tap(void *userdata,
return 0;
}
#ifdef HAVE_MENU_WIDGETS
static bool xmb_get_load_content_animation_data(void *userdata, menu_texture_item *icon, char **playlist_name)
{
xmb_handle_t *xmb = (xmb_handle_t*) userdata;
if (xmb->categories_selection_ptr > xmb->system_tab_end)
{
xmb_node_t *node = file_list_get_userdata_at_offset(xmb->horizontal_list, xmb->categories_selection_ptr - xmb->system_tab_end-1);
*icon = node->icon;
*playlist_name = xmb->title_name;
}
else
{
*icon = xmb->textures.list[XMB_TEXTURE_QUICKMENU];
*playlist_name = "RetroArch";
}
return true;
}
#endif
menu_ctx_driver_t menu_ctx_xmb = {
NULL,
xmb_messagebox,
@ -5813,6 +5835,11 @@ menu_ctx_driver_t menu_ctx_xmb = {
menu_display_osk_ptr_at_pos,
xmb_update_savestate_thumbnail_path,
xmb_update_savestate_thumbnail_image,
NULL,
NULL, /* pointer_down */
NULL, /* pointer_up */
#ifdef HAVE_MENU_WIDGETS
xmb_get_load_content_animation_data
#else
NULL
#endif
};

View File

@ -747,5 +747,8 @@ menu_ctx_driver_t menu_ctx_xui = {
NULL, /* set_thumbnail_content */
NULL, /* osk_ptr_at_pos */
NULL, /* update_savestate_thumbnail_path */
NULL /* update_savestate_thumbnail_image */
NULL, /* update_savestate_thumbnail_image */
NULL, /* pointer_down */
NULL, /* pointer_up */
NULL /* get_load_content_animation_data */
};

View File

@ -1907,6 +1907,12 @@ void menu_driver_frame(video_frame_info_t *video_info)
menu_driver_ctx->frame(menu_userdata, video_info);
}
bool menu_driver_get_load_content_animation_data(menu_texture_item *icon, char **playlist_name)
{
return menu_driver_ctx && menu_driver_ctx->get_load_content_animation_data
&& menu_driver_ctx->get_load_content_animation_data(menu_userdata, icon, playlist_name);
}
bool menu_driver_render(bool is_idle, bool rarch_is_inited,
bool rarch_is_dummy_core)
{

View File

@ -388,6 +388,7 @@ typedef struct menu_ctx_driver
int (*pointer_up)(void *data, unsigned x, unsigned y, unsigned ptr,
menu_file_list_cbs_t *cbs,
menu_entry_t *entry, unsigned action);
bool (*get_load_content_animation_data)(void *userdata, menu_texture_item *icon, char **playlist_name);
} menu_ctx_driver_t;
typedef struct menu_ctx_displaylist
@ -493,6 +494,8 @@ void menu_driver_set_binding_state(bool on);
void menu_driver_frame(video_frame_info_t *video_info);
bool menu_driver_get_load_content_animation_data(menu_texture_item *icon, char **playlist_name);
/* Is a background texture set for the current menu driver? Should
* return true for RGUI, for instance. */
bool menu_driver_is_texture_set(void);