mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Add menu_driver_load_image
This commit is contained in:
parent
076a83a62b
commit
575095c8e6
@ -951,7 +951,7 @@ void menu_display_handle_thumbnail_upload(void *task_data,
|
||||
load_image_info.data = img;
|
||||
load_image_info.type = MENU_IMAGE_THUMBNAIL;
|
||||
|
||||
menu_driver_ctl(RARCH_MENU_CTL_LOAD_IMAGE, &load_image_info);
|
||||
menu_driver_load_image(&load_image_info);
|
||||
|
||||
image_texture_free(img);
|
||||
free(img);
|
||||
@ -967,7 +967,7 @@ void menu_display_handle_savestate_thumbnail_upload(void *task_data,
|
||||
load_image_info.data = img;
|
||||
load_image_info.type = MENU_IMAGE_SAVESTATE_THUMBNAIL;
|
||||
|
||||
menu_driver_ctl(RARCH_MENU_CTL_LOAD_IMAGE, &load_image_info);
|
||||
menu_driver_load_image(&load_image_info);
|
||||
|
||||
image_texture_free(img);
|
||||
free(img);
|
||||
@ -983,7 +983,7 @@ void menu_display_handle_wallpaper_upload(void *task_data,
|
||||
load_image_info.data = img;
|
||||
load_image_info.type = MENU_IMAGE_WALLPAPER;
|
||||
|
||||
menu_driver_ctl(RARCH_MENU_CTL_LOAD_IMAGE, &load_image_info);
|
||||
menu_driver_load_image(&load_image_info);
|
||||
image_texture_free(img);
|
||||
free(img);
|
||||
free(user_data);
|
||||
|
@ -519,6 +519,14 @@ void menu_driver_populate_entries(menu_displaylist_info_t *info)
|
||||
info->label, info->type);
|
||||
}
|
||||
|
||||
bool menu_driver_load_image(menu_ctx_load_image_t *load_image_info)
|
||||
{
|
||||
if (menu_driver_ctx && menu_driver_ctx->load_image)
|
||||
return menu_driver_ctx->load_image(menu_userdata,
|
||||
load_image_info->data, load_image_info->type);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
|
||||
{
|
||||
switch (state)
|
||||
@ -845,15 +853,6 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
|
||||
list->label, list->idx);
|
||||
}
|
||||
break;
|
||||
case RARCH_MENU_CTL_LOAD_IMAGE:
|
||||
{
|
||||
menu_ctx_load_image_t *load_image_info =
|
||||
(menu_ctx_load_image_t*)data;
|
||||
if (!menu_driver_ctx || !menu_driver_ctx->load_image)
|
||||
return false;
|
||||
return menu_driver_ctx->load_image(menu_userdata,
|
||||
load_image_info->data, load_image_info->type);
|
||||
}
|
||||
case RARCH_MENU_CTL_ENVIRONMENT:
|
||||
{
|
||||
menu_ctx_environment_t *menu_environ =
|
||||
|
@ -110,7 +110,6 @@ enum rarch_menu_ctl_state
|
||||
RARCH_MENU_CTL_PLAYLIST_INIT,
|
||||
RARCH_MENU_CTL_PLAYLIST_GET,
|
||||
RARCH_MENU_CTL_FIND_DRIVER,
|
||||
RARCH_MENU_CTL_LOAD_IMAGE,
|
||||
RARCH_MENU_CTL_LIST_FREE,
|
||||
RARCH_MENU_CTL_LIST_SET_SELECTION,
|
||||
RARCH_MENU_CTL_LIST_GET_SELECTION,
|
||||
@ -401,6 +400,8 @@ void menu_driver_navigation_set(bool scroll);
|
||||
|
||||
void menu_driver_populate_entries(menu_displaylist_info_t *info);
|
||||
|
||||
bool menu_driver_load_image(menu_ctx_load_image_t *load_image_info);
|
||||
|
||||
bool menu_driver_init(bool video_is_threaded);
|
||||
|
||||
extern menu_ctx_driver_t menu_ctx_xui;
|
||||
|
Loading…
x
Reference in New Issue
Block a user