mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-24 00:20:01 +00:00
Merge pull request #9700 from jdgleaver/glui-dual-thumbs
(GLUI) Add dual thumbnail support
This commit is contained in:
commit
c62af7dc49
14
config.def.h
14
config.def.h
@ -132,9 +132,9 @@
|
||||
/* Adjust menu padding etc. to better fit the
|
||||
* screen when using landscape layouts */
|
||||
#if defined(RARCH_MOBILE)
|
||||
#define DEFAULT_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT false
|
||||
#define DEFAULT_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION_DISABLED
|
||||
#else
|
||||
#define DEFAULT_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT true
|
||||
#define DEFAULT_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION_ALWAYS
|
||||
#endif
|
||||
|
||||
/* Reposition navigation bar to make better use
|
||||
@ -146,6 +146,16 @@
|
||||
#define DEFAULT_MATERIALUI_THUMBNAIL_VIEW_PORTRAIT MATERIALUI_THUMBNAIL_VIEW_PORTRAIT_LIST_SMALL
|
||||
#define DEFAULT_MATERIALUI_THUMBNAIL_VIEW_LANDSCAPE MATERIALUI_THUMBNAIL_VIEW_LANDSCAPE_LIST_MEDIUM
|
||||
|
||||
/* Enable second thumbnail when using 'list view'
|
||||
* thumbnail views
|
||||
* Note: Second thumbnail will only be drawn if
|
||||
* display has sufficient horizontal real estate */
|
||||
#if defined(RARCH_MOBILE)
|
||||
#define DEFAULT_MATERIALUI_DUAL_THUMBNAIL_LIST_VIEW_ENABLE false
|
||||
#else
|
||||
#define DEFAULT_MATERIALUI_DUAL_THUMBNAIL_LIST_VIEW_ENABLE true
|
||||
#endif
|
||||
|
||||
#define DEFAULT_CRT_SWITCH_RESOLUTION CRT_SWITCH_NONE
|
||||
|
||||
#define DEFAULT_CRT_SWITCH_RESOLUTION_SUPER 2560
|
||||
|
@ -1556,8 +1556,8 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
SETTING_BOOL("menu_show_advanced_settings", &settings->bools.menu_show_advanced_settings, true, DEFAULT_SHOW_ADVANCED_SETTINGS, false);
|
||||
#ifdef HAVE_MATERIALUI
|
||||
SETTING_BOOL("materialui_icons_enable", &settings->bools.menu_materialui_icons_enable, true, DEFAULT_MATERIALUI_ICONS_ENABLE, false);
|
||||
SETTING_BOOL("materialui_optimize_landscape_layout", &settings->bools.menu_materialui_optimize_landscape_layout, true, DEFAULT_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT, false);
|
||||
SETTING_BOOL("materialui_auto_rotate_nav_bar", &settings->bools.menu_materialui_auto_rotate_nav_bar, true, DEFAULT_MATERIALUI_AUTO_ROTATE_NAV_BAR, false);
|
||||
SETTING_BOOL("materialui_dual_thumbnail_list_view_enable", &settings->bools.menu_materialui_dual_thumbnail_list_view_enable, true, DEFAULT_MATERIALUI_DUAL_THUMBNAIL_LIST_VIEW_ENABLE, false);
|
||||
#endif
|
||||
#ifdef HAVE_RGUI
|
||||
SETTING_BOOL("rgui_background_filler_thickness_enable", &settings->bools.menu_rgui_background_filler_thickness_enable, true, true, false);
|
||||
@ -1814,6 +1814,7 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
|
||||
SETTING_UINT("materialui_menu_transition_animation", &settings->uints.menu_materialui_transition_animation, true, DEFAULT_MATERIALUI_TRANSITION_ANIM, false);
|
||||
SETTING_UINT("materialui_thumbnail_view_portrait", &settings->uints.menu_materialui_thumbnail_view_portrait, true, DEFAULT_MATERIALUI_THUMBNAIL_VIEW_PORTRAIT, false);
|
||||
SETTING_UINT("materialui_thumbnail_view_landscape", &settings->uints.menu_materialui_thumbnail_view_landscape, true, DEFAULT_MATERIALUI_THUMBNAIL_VIEW_LANDSCAPE, false);
|
||||
SETTING_UINT("materialui_landscape_layout_optimization", &settings->uints.menu_materialui_landscape_layout_optimization, true, DEFAULT_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION, false);
|
||||
SETTING_UINT("menu_shader_pipeline", &settings->uints.menu_xmb_shader_pipeline, true, DEFAULT_MENU_SHADER_PIPELINE, false);
|
||||
#ifdef HAVE_OZONE
|
||||
SETTING_UINT("ozone_menu_color_theme", &settings->uints.menu_ozone_color_theme, true, 1, false);
|
||||
|
@ -186,8 +186,8 @@ typedef struct settings
|
||||
bool menu_show_video_layout;
|
||||
#endif
|
||||
bool menu_materialui_icons_enable;
|
||||
bool menu_materialui_optimize_landscape_layout;
|
||||
bool menu_materialui_auto_rotate_nav_bar;
|
||||
bool menu_materialui_dual_thumbnail_list_view_enable;
|
||||
bool menu_rgui_background_filler_thickness_enable;
|
||||
bool menu_rgui_border_filler_thickness_enable;
|
||||
bool menu_rgui_border_filler_enable;
|
||||
@ -537,6 +537,7 @@ typedef struct settings
|
||||
unsigned menu_materialui_transition_animation;
|
||||
unsigned menu_materialui_thumbnail_view_portrait;
|
||||
unsigned menu_materialui_thumbnail_view_landscape;
|
||||
unsigned menu_materialui_landscape_layout_optimization;
|
||||
unsigned menu_ozone_color_theme;
|
||||
unsigned menu_font_color_red;
|
||||
unsigned menu_font_color_green;
|
||||
|
@ -7026,11 +7026,11 @@ MSG_HASH(
|
||||
"Muestra iconos a la izquierda de las entradas del menú."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT,
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION,
|
||||
"Optimizar disposición en modo horizontal"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT,
|
||||
MENU_ENUM_SUBLABEL_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION,
|
||||
"Ajusta automáticamente la disposición del menú para que se adapte a la pantalla con la orientación horizontal."
|
||||
)
|
||||
MSG_HASH(
|
||||
|
@ -6945,11 +6945,11 @@ MSG_HASH(
|
||||
"Affiche les icônes à gauche des entrées du menu."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT,
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION,
|
||||
"Optimiser pour l'affichage en mode paysage"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT,
|
||||
MENU_ENUM_SUBLABEL_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION,
|
||||
"Ajuste automatiquement la disposition du menu pour être mieux adapté à l'utilisation d'une orientation d'écran en mode paysage."
|
||||
)
|
||||
MSG_HASH(
|
||||
|
@ -1669,10 +1669,12 @@ MSG_HASH(MENU_ENUM_LABEL_GOTO_VIDEO,
|
||||
"goto_video")
|
||||
MSG_HASH(MENU_ENUM_LABEL_MATERIALUI_ICONS_ENABLE,
|
||||
"materialui_icons_enable")
|
||||
MSG_HASH(MENU_ENUM_LABEL_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT,
|
||||
"materialui_optimize_landscape_layout")
|
||||
MSG_HASH(MENU_ENUM_LABEL_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION,
|
||||
"materialui_landscape_layout_optimization")
|
||||
MSG_HASH(MENU_ENUM_LABEL_MATERIALUI_AUTO_ROTATE_NAV_BAR,
|
||||
"materialui_auto_rotate_nav_bar")
|
||||
MSG_HASH(MENU_ENUM_LABEL_MATERIALUI_DUAL_THUMBNAIL_LIST_VIEW_ENABLE,
|
||||
"materialui_dual_thumbnail_list_view_enable")
|
||||
MSG_HASH(MENU_ENUM_LABEL_RENAME_ENTRY,
|
||||
"rename_entry")
|
||||
MSG_HASH(MENU_ENUM_LABEL_MENU_SHOW_LOAD_CORE,
|
||||
|
@ -7033,11 +7033,11 @@ MSG_HASH(
|
||||
"Exibe ícones à esquerda das entradas do menu."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT,
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION,
|
||||
"Otimizar o Esquema no Modo Paisagem"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT,
|
||||
MENU_ENUM_SUBLABEL_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION,
|
||||
"Ajusta automaticamente o esquema do menu para se adequar a tela com orientação de paisagem."
|
||||
)
|
||||
MSG_HASH(
|
||||
|
@ -1851,6 +1851,10 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_THUMBNAIL_VIEW_PORTRAIT_LIST_MEDIUM,
|
||||
"List (Medium)"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_THUMBNAIL_VIEW_PORTRAIT_DUAL_ICON,
|
||||
"Dual Icon"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_THUMBNAIL_VIEW_LANDSCAPE_DISABLED,
|
||||
"OFF"
|
||||
@ -3321,6 +3325,10 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_THUMBNAILS_RGUI,
|
||||
"Top Thumbnail"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_THUMBNAILS_MATERIALUI,
|
||||
"Primary Thumbnail"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS,
|
||||
"Left Thumbnails"
|
||||
@ -3333,6 +3341,10 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS_OZONE,
|
||||
"Second Thumbnail"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS_MATERIALUI,
|
||||
"Secondary Thumbnail"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_XMB_VERTICAL_THUMBNAILS,
|
||||
"Thumbnails Vertical Disposition"
|
||||
@ -6321,6 +6333,10 @@ MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_THUMBNAILS_RGUI,
|
||||
"Type of thumbnail to display at the top right of playlists. This thumbnail may be toggled fullscreen by pressing RetroPad Y."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_THUMBNAILS_MATERIALUI,
|
||||
"Main type of thumbnail to associate with each playlist entry. Typically serves as content icon."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_LEFT_THUMBNAILS,
|
||||
"Type of thumbnail to display at the left."
|
||||
@ -6333,6 +6349,10 @@ MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_LEFT_THUMBNAILS_OZONE,
|
||||
"Replace the content metadata panel by another thumbnail."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_LEFT_THUMBNAILS_MATERIALUI,
|
||||
"Auxiliary type of thumbnail to associate with each playlist entry. Usage depends upon current playlist thumbnail view mode."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_XMB_VERTICAL_THUMBNAILS,
|
||||
"Display the left thumbnail under the right one, on the right side of the screen."
|
||||
@ -7025,13 +7045,25 @@ MSG_HASH(
|
||||
"Show icons at the left of the menu entries."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT,
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION,
|
||||
"Optimize Landscape Layout"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT,
|
||||
MENU_ENUM_SUBLABEL_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION,
|
||||
"Automatically adjust menu layout to better fit the screen when using landscape display orientations."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION_DISABLED,
|
||||
"OFF"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION_ALWAYS,
|
||||
"ON"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION_EXCLUDE_THUMBNAIL_VIEWS,
|
||||
"Exclude Thumbnail Views"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_AUTO_ROTATE_NAV_BAR,
|
||||
"Auto-Rotate Navigation Bar"
|
||||
@ -7040,6 +7072,14 @@ MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_MATERIALUI_AUTO_ROTATE_NAV_BAR,
|
||||
"Automatically move the navigation bar to the right hand side of the screen when using landscape display orientations."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_DUAL_THUMBNAIL_LIST_VIEW_ENABLE,
|
||||
"Show Secondary Thumbnail In List Views"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_MATERIALUI_DUAL_THUMBNAIL_LIST_VIEW_ENABLE,
|
||||
"Enables display of secondary thumbnail when using 'List'-type playlist thumbnail view modes. Note that this setting only applies when the screen has sufficient physical width to show two thumbnails."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_XMB_MAIN_MENU_ENABLE_SETTINGS,
|
||||
"Settings Tab"
|
||||
|
@ -198,8 +198,9 @@ default_sublabel_macro(action_bind_sublabel_netplay_settings, MENU_
|
||||
default_sublabel_macro(action_bind_sublabel_user_bind_settings, MENU_ENUM_SUBLABEL_INPUT_USER_BINDS)
|
||||
default_sublabel_macro(action_bind_sublabel_input_hotkey_settings, MENU_ENUM_SUBLABEL_INPUT_HOTKEY_BINDS)
|
||||
default_sublabel_macro(action_bind_sublabel_materialui_icons_enable, MENU_ENUM_SUBLABEL_MATERIALUI_ICONS_ENABLE)
|
||||
default_sublabel_macro(action_bind_sublabel_materialui_optimize_landscape_layout, MENU_ENUM_SUBLABEL_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT)
|
||||
default_sublabel_macro(action_bind_sublabel_materialui_landscape_layout_optimization, MENU_ENUM_SUBLABEL_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION)
|
||||
default_sublabel_macro(action_bind_sublabel_materialui_auto_rotate_nav_bar, MENU_ENUM_SUBLABEL_MATERIALUI_AUTO_ROTATE_NAV_BAR)
|
||||
default_sublabel_macro(action_bind_sublabel_materialui_dual_thumbnail_list_view_enable, MENU_ENUM_SUBLABEL_MATERIALUI_DUAL_THUMBNAIL_LIST_VIEW_ENABLE)
|
||||
default_sublabel_macro(action_bind_sublabel_add_content_list, MENU_ENUM_SUBLABEL_ADD_CONTENT_LIST)
|
||||
default_sublabel_macro(action_bind_sublabel_video_frame_delay, MENU_ENUM_SUBLABEL_VIDEO_FRAME_DELAY)
|
||||
default_sublabel_macro(action_bind_sublabel_video_shader_delay, MENU_ENUM_SUBLABEL_VIDEO_SHADER_DELAY)
|
||||
@ -400,9 +401,11 @@ default_sublabel_macro(action_bind_sublabel_mouse_enable, MENU_
|
||||
default_sublabel_macro(action_bind_sublabel_pointer_enable, MENU_ENUM_SUBLABEL_POINTER_ENABLE)
|
||||
default_sublabel_macro(action_bind_sublabel_thumbnails, MENU_ENUM_SUBLABEL_THUMBNAILS)
|
||||
default_sublabel_macro(action_bind_sublabel_thumbnails_rgui, MENU_ENUM_SUBLABEL_THUMBNAILS_RGUI)
|
||||
default_sublabel_macro(action_bind_sublabel_thumbnails_materialui, MENU_ENUM_SUBLABEL_THUMBNAILS_MATERIALUI)
|
||||
default_sublabel_macro(action_bind_sublabel_left_thumbnails, MENU_ENUM_SUBLABEL_LEFT_THUMBNAILS)
|
||||
default_sublabel_macro(action_bind_sublabel_left_thumbnails_rgui, MENU_ENUM_SUBLABEL_LEFT_THUMBNAILS_RGUI)
|
||||
default_sublabel_macro(action_bind_sublabel_left_thumbnails_ozone, MENU_ENUM_SUBLABEL_LEFT_THUMBNAILS_OZONE)
|
||||
default_sublabel_macro(action_bind_sublabel_left_thumbnails_materialui, MENU_ENUM_SUBLABEL_LEFT_THUMBNAILS_MATERIALUI)
|
||||
default_sublabel_macro(action_bind_sublabel_menu_thumbnail_upscale_threshold, MENU_ENUM_SUBLABEL_MENU_THUMBNAIL_UPSCALE_THRESHOLD)
|
||||
default_sublabel_macro(action_bind_sublabel_timedate_enable, MENU_ENUM_SUBLABEL_TIMEDATE_ENABLE)
|
||||
default_sublabel_macro(action_bind_sublabel_timedate_style, MENU_ENUM_SUBLABEL_TIMEDATE_STYLE)
|
||||
@ -1255,12 +1258,15 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
|
||||
case MENU_ENUM_LABEL_MATERIALUI_ICONS_ENABLE:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_materialui_icons_enable);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_materialui_optimize_landscape_layout);
|
||||
case MENU_ENUM_LABEL_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_materialui_landscape_layout_optimization);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_MATERIALUI_AUTO_ROTATE_NAV_BAR:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_materialui_auto_rotate_nav_bar);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_MATERIALUI_DUAL_THUMBNAIL_LIST_VIEW_ENABLE:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_materialui_dual_thumbnail_list_view_enable);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_VIDEO_VIEWPORT_CUSTOM_HEIGHT:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_viewport_custom_height);
|
||||
break;
|
||||
@ -1976,6 +1982,10 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
|
||||
{
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails_rgui);
|
||||
}
|
||||
else if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||
{
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails_materialui);
|
||||
}
|
||||
else
|
||||
{
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails);
|
||||
@ -1991,6 +2001,10 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
|
||||
{
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_ozone);
|
||||
}
|
||||
else if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||
{
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_materialui);
|
||||
}
|
||||
else
|
||||
{
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails);
|
||||
@ -2710,6 +2724,10 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
|
||||
{
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails_rgui);
|
||||
}
|
||||
else if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||
{
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails_materialui);
|
||||
}
|
||||
else
|
||||
{
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails);
|
||||
@ -2726,6 +2744,10 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
|
||||
{
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_ozone);
|
||||
}
|
||||
else if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||
{
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_materialui);
|
||||
}
|
||||
else
|
||||
{
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails);
|
||||
|
@ -85,6 +85,8 @@ static int action_get_title_thumbnails(
|
||||
/* Get label value */
|
||||
if (string_is_equal(settings->arrays.menu_driver, "rgui"))
|
||||
label_value = MENU_ENUM_LABEL_VALUE_THUMBNAILS_RGUI;
|
||||
else if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||
label_value = MENU_ENUM_LABEL_VALUE_THUMBNAILS_MATERIALUI;
|
||||
else
|
||||
label_value = MENU_ENUM_LABEL_VALUE_THUMBNAILS;
|
||||
|
||||
@ -111,6 +113,8 @@ static int action_get_title_left_thumbnails(
|
||||
label_value = MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS_RGUI;
|
||||
else if (string_is_equal(settings->arrays.menu_driver, "ozone"))
|
||||
label_value = MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS_OZONE;
|
||||
else if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||
label_value = MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS_MATERIALUI;
|
||||
else
|
||||
label_value = MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS;
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -371,6 +371,14 @@ static void menu_display_gl_scissor_begin(
|
||||
glScissor(x, video_info->height - y - height, width, height);
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
#ifdef MALI_BUG
|
||||
/* TODO/FIXME: If video width/height changes between
|
||||
* a call of menu_display_gl_scissor_begin() and the
|
||||
* next call of menu_display_gl_draw() (or if
|
||||
* menu_display_gl_scissor_begin() is called before the
|
||||
* first call of menu_display_gl_draw()), the scissor
|
||||
* rectangle set here will be overwritten by the initialisation
|
||||
* procedure inside menu_display_gl_discard_draw_rectangle(),
|
||||
* causing the next frame to render glitched content */
|
||||
scissor_set_rectangle(x, x + width - 1, y, y + height - 1, 1);
|
||||
#endif
|
||||
}
|
||||
|
@ -182,6 +182,7 @@ enum materialui_thumbnail_view_portrait
|
||||
MATERIALUI_THUMBNAIL_VIEW_PORTRAIT_DISABLED = 0,
|
||||
MATERIALUI_THUMBNAIL_VIEW_PORTRAIT_LIST_SMALL,
|
||||
MATERIALUI_THUMBNAIL_VIEW_PORTRAIT_LIST_MEDIUM,
|
||||
MATERIALUI_THUMBNAIL_VIEW_PORTRAIT_DUAL_ICON,
|
||||
MATERIALUI_THUMBNAIL_VIEW_PORTRAIT_LAST
|
||||
};
|
||||
|
||||
@ -194,6 +195,14 @@ enum materialui_thumbnail_view_landscape
|
||||
MATERIALUI_THUMBNAIL_VIEW_LANDSCAPE_LAST
|
||||
};
|
||||
|
||||
enum materialui_landscape_layout_optimization_type
|
||||
{
|
||||
MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION_DISABLED = 0,
|
||||
MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION_ALWAYS,
|
||||
MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION_EXCLUDE_THUMBNAIL_VIEWS,
|
||||
MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION_LAST
|
||||
};
|
||||
|
||||
enum xmb_color_theme
|
||||
{
|
||||
XMB_THEME_LEGACY_RED = 0,
|
||||
|
@ -2812,17 +2812,22 @@ static bool menu_displaylist_parse_playlist_manager_settings(
|
||||
if (string_is_equal(settings->arrays.menu_driver, "rgui"))
|
||||
{
|
||||
right_thumbnail_label_value = MENU_ENUM_LABEL_VALUE_THUMBNAILS_RGUI;
|
||||
left_thumbnail_label_value = MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS_RGUI;
|
||||
left_thumbnail_label_value = MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS_RGUI;
|
||||
}
|
||||
else if (string_is_equal(settings->arrays.menu_driver, "ozone"))
|
||||
{
|
||||
right_thumbnail_label_value = MENU_ENUM_LABEL_VALUE_THUMBNAILS;
|
||||
left_thumbnail_label_value = MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS_OZONE;
|
||||
left_thumbnail_label_value = MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS_OZONE;
|
||||
}
|
||||
else if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||
{
|
||||
right_thumbnail_label_value = MENU_ENUM_LABEL_VALUE_THUMBNAILS_MATERIALUI;
|
||||
left_thumbnail_label_value = MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS_MATERIALUI;
|
||||
}
|
||||
else
|
||||
{
|
||||
right_thumbnail_label_value = MENU_ENUM_LABEL_VALUE_THUMBNAILS;
|
||||
left_thumbnail_label_value = MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS;
|
||||
left_thumbnail_label_value = MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS;
|
||||
}
|
||||
|
||||
/* > Right thumbnail mode */
|
||||
@ -2833,12 +2838,11 @@ static bool menu_displaylist_parse_playlist_manager_settings(
|
||||
MENU_SETTING_PLAYLIST_MANAGER_RIGHT_THUMBNAIL_MODE, 0, 0);
|
||||
|
||||
/* > Left thumbnail mode */
|
||||
if (!string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||
menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(left_thumbnail_label_value),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_PLAYLIST_MANAGER_LEFT_THUMBNAIL_MODE),
|
||||
MENU_ENUM_LABEL_PLAYLIST_MANAGER_LEFT_THUMBNAIL_MODE,
|
||||
MENU_SETTING_PLAYLIST_MANAGER_LEFT_THUMBNAIL_MODE, 0, 0);
|
||||
menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(left_thumbnail_label_value),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_PLAYLIST_MANAGER_LEFT_THUMBNAIL_MODE),
|
||||
MENU_ENUM_LABEL_PLAYLIST_MANAGER_LEFT_THUMBNAIL_MODE,
|
||||
MENU_SETTING_PLAYLIST_MANAGER_LEFT_THUMBNAIL_MODE, 0, 0);
|
||||
|
||||
/* TODO - Add:
|
||||
* - Remove invalid entries */
|
||||
@ -5449,7 +5453,7 @@ unsigned menu_displaylist_build_list(file_list_t *list, enum menu_displaylist_ct
|
||||
{MENU_ENUM_LABEL_OZONE_COLLAPSE_SIDEBAR, PARSE_ONLY_BOOL},
|
||||
{MENU_ENUM_LABEL_OZONE_TRUNCATE_PLAYLIST_NAME, PARSE_ONLY_BOOL},
|
||||
{MENU_ENUM_LABEL_MATERIALUI_ICONS_ENABLE, PARSE_ONLY_BOOL},
|
||||
{MENU_ENUM_LABEL_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT, PARSE_ONLY_BOOL},
|
||||
{MENU_ENUM_LABEL_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION, PARSE_ONLY_UINT},
|
||||
{MENU_ENUM_LABEL_MATERIALUI_AUTO_ROTATE_NAV_BAR, PARSE_ONLY_BOOL},
|
||||
{MENU_ENUM_LABEL_MATERIALUI_MENU_COLOR_THEME, PARSE_ONLY_UINT},
|
||||
{MENU_ENUM_LABEL_MATERIALUI_MENU_TRANSITION_ANIMATION, PARSE_ONLY_UINT},
|
||||
@ -5459,6 +5463,7 @@ unsigned menu_displaylist_build_list(file_list_t *list, enum menu_displaylist_ct
|
||||
{MENU_ENUM_LABEL_MENU_RGUI_INLINE_THUMBNAILS, PARSE_ONLY_BOOL },
|
||||
{MENU_ENUM_LABEL_MATERIALUI_MENU_THUMBNAIL_VIEW_PORTRAIT, PARSE_ONLY_UINT },
|
||||
{MENU_ENUM_LABEL_MATERIALUI_MENU_THUMBNAIL_VIEW_LANDSCAPE, PARSE_ONLY_UINT },
|
||||
{MENU_ENUM_LABEL_MATERIALUI_DUAL_THUMBNAIL_LIST_VIEW_ENABLE, PARSE_ONLY_BOOL },
|
||||
{MENU_ENUM_LABEL_THUMBNAILS, PARSE_ONLY_UINT },
|
||||
{MENU_ENUM_LABEL_LEFT_THUMBNAILS, PARSE_ONLY_UINT },
|
||||
{MENU_ENUM_LABEL_XMB_VERTICAL_THUMBNAILS, PARSE_ONLY_BOOL },
|
||||
|
@ -3986,6 +3986,11 @@ static void setting_get_string_representation_uint_materialui_menu_thumbnail_vie
|
||||
msg_hash_to_str(
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_THUMBNAIL_VIEW_PORTRAIT_LIST_MEDIUM), len);
|
||||
break;
|
||||
case MATERIALUI_THUMBNAIL_VIEW_PORTRAIT_DUAL_ICON:
|
||||
strlcpy(s,
|
||||
msg_hash_to_str(
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_THUMBNAIL_VIEW_PORTRAIT_DUAL_ICON), len);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -4024,6 +4029,35 @@ static void setting_get_string_representation_uint_materialui_menu_thumbnail_vie
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void setting_get_string_representation_uint_materialui_landscape_layout_optimization(
|
||||
rarch_setting_t *setting,
|
||||
char *s, size_t len)
|
||||
{
|
||||
if (!setting)
|
||||
return;
|
||||
|
||||
switch (*setting->value.target.unsigned_integer)
|
||||
{
|
||||
case MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION_DISABLED:
|
||||
strlcpy(s,
|
||||
msg_hash_to_str(
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION_DISABLED), len);
|
||||
break;
|
||||
case MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION_ALWAYS:
|
||||
strlcpy(s,
|
||||
msg_hash_to_str(
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION_ALWAYS), len);
|
||||
break;
|
||||
case MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION_EXCLUDE_THUMBNAIL_VIEWS:
|
||||
strlcpy(s,
|
||||
msg_hash_to_str(
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION_EXCLUDE_THUMBNAIL_VIEWS), len);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_XMB
|
||||
@ -13051,20 +13085,22 @@ static bool setting_append_list(
|
||||
menu_settings_list_current_add_range(list, list_info, 0, MATERIALUI_TRANSITION_ANIM_LAST-1, 1, true, true);
|
||||
(*list)[list_info->index - 1].ui_type = ST_UI_TYPE_UINT_COMBOBOX;
|
||||
|
||||
CONFIG_BOOL(
|
||||
CONFIG_UINT(
|
||||
list, list_info,
|
||||
&settings->bools.menu_materialui_optimize_landscape_layout,
|
||||
MENU_ENUM_LABEL_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT,
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT,
|
||||
DEFAULT_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT,
|
||||
MENU_ENUM_LABEL_VALUE_OFF,
|
||||
MENU_ENUM_LABEL_VALUE_ON,
|
||||
&settings->uints.menu_materialui_landscape_layout_optimization,
|
||||
MENU_ENUM_LABEL_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION,
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION,
|
||||
DEFAULT_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION,
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler,
|
||||
SD_FLAG_NONE);
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
(*list)[list_info->index - 1].get_string_representation =
|
||||
&setting_get_string_representation_uint_materialui_landscape_layout_optimization;
|
||||
menu_settings_list_current_add_range(list, list_info, 0, MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION_LAST-1, 1, true, true);
|
||||
(*list)[list_info->index - 1].ui_type = ST_UI_TYPE_UINT_COMBOBOX;
|
||||
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
@ -13115,6 +13151,21 @@ static bool setting_append_list(
|
||||
menu_settings_list_current_add_range(list, list_info, 0, MATERIALUI_THUMBNAIL_VIEW_LANDSCAPE_LAST-1, 1, true, true);
|
||||
(*list)[list_info->index - 1].ui_type = ST_UI_TYPE_UINT_COMBOBOX;
|
||||
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
&settings->bools.menu_materialui_dual_thumbnail_list_view_enable,
|
||||
MENU_ENUM_LABEL_MATERIALUI_DUAL_THUMBNAIL_LIST_VIEW_ENABLE,
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_DUAL_THUMBNAIL_LIST_VIEW_ENABLE,
|
||||
DEFAULT_MATERIALUI_DUAL_THUMBNAIL_LIST_VIEW_ENABLE,
|
||||
MENU_ENUM_LABEL_VALUE_OFF,
|
||||
MENU_ENUM_LABEL_VALUE_ON,
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler,
|
||||
SD_FLAG_NONE);
|
||||
|
||||
/* TODO: These should be removed entirely, but just
|
||||
* comment out for now in case users complain...
|
||||
CONFIG_FLOAT(
|
||||
@ -13270,6 +13321,11 @@ static bool setting_append_list(
|
||||
thumbnails_label_value = MENU_ENUM_LABEL_VALUE_THUMBNAILS;
|
||||
left_thumbnails_label_value = MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS_OZONE;
|
||||
}
|
||||
else if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||
{
|
||||
thumbnails_label_value = MENU_ENUM_LABEL_VALUE_THUMBNAILS_MATERIALUI;
|
||||
left_thumbnails_label_value = MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS_MATERIALUI;
|
||||
}
|
||||
else
|
||||
{
|
||||
thumbnails_label_value = MENU_ENUM_LABEL_VALUE_THUMBNAILS;
|
||||
@ -13293,26 +13349,22 @@ static bool setting_append_list(
|
||||
menu_settings_list_current_add_range(list, list_info, 0, 3, 1, true, true);
|
||||
(*list)[list_info->index - 1].ui_type = ST_UI_TYPE_UINT_RADIO_BUTTONS;
|
||||
|
||||
/* Material UI does not use left thumbnails (yet...) */
|
||||
if (!string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||
{
|
||||
CONFIG_UINT(
|
||||
list, list_info,
|
||||
&settings->uints.menu_left_thumbnails,
|
||||
MENU_ENUM_LABEL_LEFT_THUMBNAILS,
|
||||
left_thumbnails_label_value,
|
||||
menu_left_thumbnails_default,
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
(*list)[list_info->index - 1].get_string_representation =
|
||||
&setting_get_string_representation_uint_menu_left_thumbnails;
|
||||
menu_settings_list_current_add_range(list, list_info, 0, 3, 1, true, true);
|
||||
(*list)[list_info->index - 1].ui_type = ST_UI_TYPE_UINT_RADIO_BUTTONS;
|
||||
}
|
||||
CONFIG_UINT(
|
||||
list, list_info,
|
||||
&settings->uints.menu_left_thumbnails,
|
||||
MENU_ENUM_LABEL_LEFT_THUMBNAILS,
|
||||
left_thumbnails_label_value,
|
||||
menu_left_thumbnails_default,
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
(*list)[list_info->index - 1].get_string_representation =
|
||||
&setting_get_string_representation_uint_menu_left_thumbnails;
|
||||
menu_settings_list_current_add_range(list, list_info, 0, 3, 1, true, true);
|
||||
(*list)[list_info->index - 1].ui_type = ST_UI_TYPE_UINT_RADIO_BUTTONS;
|
||||
}
|
||||
|
||||
if (string_is_equal(settings->arrays.menu_driver, "xmb"))
|
||||
|
@ -27,11 +27,13 @@
|
||||
|
||||
#include <features/features_cpu.h>
|
||||
#include <file/file_path.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "../retroarch.h"
|
||||
#include "../configuration.h"
|
||||
#include "../tasks/tasks_internal.h"
|
||||
#include "menu_animation.h"
|
||||
#include "menu_driver.h"
|
||||
|
||||
#include "menu_thumbnail.h"
|
||||
|
||||
@ -138,12 +140,13 @@ static void menu_thumbnail_handle_upload(
|
||||
if (!img)
|
||||
goto end;
|
||||
|
||||
if (img->width < 1 || img->height < 1)
|
||||
if ((img->width < 1) || (img->height < 1))
|
||||
goto end;
|
||||
|
||||
/* Upload texture to GPU */
|
||||
video_driver_texture_load(
|
||||
img, TEXTURE_FILTER_MIPMAP_LINEAR, &thumbnail_tag->thumbnail->texture);
|
||||
if (!video_driver_texture_load(
|
||||
img, TEXTURE_FILTER_MIPMAP_LINEAR, &thumbnail_tag->thumbnail->texture))
|
||||
goto end;
|
||||
|
||||
/* Cache dimensions */
|
||||
thumbnail_tag->thumbnail->width = img->width;
|
||||
@ -250,12 +253,42 @@ void menu_thumbnail_request(
|
||||
/* Handle on demand thumbnail downloads */
|
||||
else if (settings->bools.network_on_demand_thumbnails)
|
||||
{
|
||||
const char *system = NULL;
|
||||
const char *system = NULL;
|
||||
const char *img_name = NULL;
|
||||
static char last_img_name[PATH_MAX_LENGTH] = {0};
|
||||
|
||||
if (menu_thumbnail_get_system(path_data, &system))
|
||||
task_push_pl_entry_thumbnail_download(
|
||||
system, playlist_get_cached(), (unsigned)idx,
|
||||
false, true);
|
||||
if (!playlist)
|
||||
return;
|
||||
|
||||
/* Get current image name */
|
||||
if (!menu_thumbnail_get_img_name(path_data, &img_name))
|
||||
return;
|
||||
|
||||
/* Only trigger a thumbnail download if image
|
||||
* name has changed since the last call of
|
||||
* menu_thumbnail_request()
|
||||
* > Allows menu_thumbnail_request() to be used
|
||||
* for successive right/left thumbnail requests
|
||||
* with minimal duplication of effort
|
||||
* (i.e. task_push_pl_entry_thumbnail_download()
|
||||
* will automatically cancel if a download for the
|
||||
* existing playlist entry is pending, but the
|
||||
* checks required for this involve significant
|
||||
* overheads. We can avoid this entirely with
|
||||
* a simple string comparison) */
|
||||
if (string_is_equal(img_name, last_img_name))
|
||||
return;
|
||||
|
||||
strlcpy(last_img_name, img_name, sizeof(last_img_name));
|
||||
|
||||
/* Get system name */
|
||||
if (!menu_thumbnail_get_system(path_data, &system))
|
||||
return;
|
||||
|
||||
/* Trigger thumbnail download */
|
||||
task_push_pl_entry_thumbnail_download(
|
||||
system, playlist, (unsigned)idx,
|
||||
false, true);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -294,16 +327,14 @@ void menu_thumbnail_reset(menu_thumbnail_t *thumbnail)
|
||||
* on/off screen
|
||||
* - Must be called each frame for every on-screen entry
|
||||
* - Must be called once for each entry as it moves off-screen
|
||||
* (or can be called each frame - overheads are small)
|
||||
* NOTE 1: Must be called *after* menu_thumbnail_set_system()
|
||||
* NOTE 2: This function calls menu_thumbnail_set_content*()
|
||||
* > It is therefore intended for use in situations
|
||||
* where each entry has a *single* thumbnail
|
||||
* > Since I can't think of any view mode that needs
|
||||
* two thumbnails, this should be fine (i.e. we might
|
||||
* want one additional image to go with the currently
|
||||
* selected item, but this is not a streaming thing -
|
||||
* the auxiliary image can just be loaded via a normal
|
||||
* menu_thumbnail_request() */
|
||||
* NOTE 3: This function is intended for use in situations
|
||||
* where each menu entry has a *single* thumbnail.
|
||||
* If each entry has two thumbnails, use
|
||||
* menu_thumbnail_process_streams() for improved
|
||||
* performance */
|
||||
void menu_thumbnail_process_stream(
|
||||
menu_thumbnail_path_data_t *path_data, enum menu_thumbnail_id thumbnail_id,
|
||||
playlist_t *playlist, size_t idx, menu_thumbnail_t *thumbnail, bool on_screen)
|
||||
@ -353,3 +384,220 @@ void menu_thumbnail_process_stream(
|
||||
menu_thumbnail_reset(thumbnail);
|
||||
}
|
||||
}
|
||||
|
||||
/* Handles streaming of the specified thumbnails as they move
|
||||
* on/off screen
|
||||
* - Must be called each frame for every on-screen entry
|
||||
* - Must be called once for each entry as it moves off-screen
|
||||
* (or can be called each frame - overheads are small)
|
||||
* NOTE 1: Must be called *after* menu_thumbnail_set_system()
|
||||
* NOTE 2: This function calls menu_thumbnail_set_content*()
|
||||
* NOTE 3: This function is intended for use in situations
|
||||
* where each menu entry has *two* thumbnails.
|
||||
* If each entry only has a single thumbnail, use
|
||||
* menu_thumbnail_process_stream() for improved
|
||||
* performance */
|
||||
void menu_thumbnail_process_streams(
|
||||
menu_thumbnail_path_data_t *path_data,
|
||||
playlist_t *playlist, size_t idx,
|
||||
menu_thumbnail_t *right_thumbnail, menu_thumbnail_t *left_thumbnail,
|
||||
bool on_screen)
|
||||
{
|
||||
if (!right_thumbnail || !left_thumbnail)
|
||||
return;
|
||||
|
||||
if (on_screen)
|
||||
{
|
||||
/* Entry is on-screen
|
||||
* > Only process if current status is
|
||||
* MENU_THUMBNAIL_STATUS_UNKNOWN */
|
||||
bool process_right = (right_thumbnail->status == MENU_THUMBNAIL_STATUS_UNKNOWN);
|
||||
bool process_left = (left_thumbnail->status == MENU_THUMBNAIL_STATUS_UNKNOWN);
|
||||
|
||||
if (process_right || process_left)
|
||||
{
|
||||
/* Check if stream delay timer has elapsed */
|
||||
float delta_time = menu_animation_get_delta_time();
|
||||
bool request_right = false;
|
||||
bool request_left = false;
|
||||
|
||||
if (process_right)
|
||||
{
|
||||
right_thumbnail->delay_timer += delta_time;
|
||||
request_right =
|
||||
(right_thumbnail->delay_timer > menu_thumbnail_stream_delay);
|
||||
}
|
||||
|
||||
if (process_left)
|
||||
{
|
||||
left_thumbnail->delay_timer += delta_time;
|
||||
request_left =
|
||||
(left_thumbnail->delay_timer > menu_thumbnail_stream_delay);
|
||||
}
|
||||
|
||||
/* Check if one or more thumbnails should be requested */
|
||||
if (request_right || request_left)
|
||||
{
|
||||
/* Sanity check */
|
||||
if (!path_data || !playlist)
|
||||
return;
|
||||
|
||||
/* Update thumbnail content */
|
||||
if (!menu_thumbnail_set_content_playlist(path_data, playlist, idx))
|
||||
{
|
||||
/* Content is invalid
|
||||
* > Reset thumbnail and set missing status */
|
||||
if (request_right)
|
||||
{
|
||||
menu_thumbnail_reset(right_thumbnail);
|
||||
right_thumbnail->status = MENU_THUMBNAIL_STATUS_MISSING;
|
||||
}
|
||||
|
||||
if (request_left)
|
||||
{
|
||||
menu_thumbnail_reset(left_thumbnail);
|
||||
left_thumbnail->status = MENU_THUMBNAIL_STATUS_MISSING;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* Request image load */
|
||||
if (request_right)
|
||||
menu_thumbnail_request(
|
||||
path_data, MENU_THUMBNAIL_RIGHT, playlist, idx, right_thumbnail);
|
||||
|
||||
if (request_left)
|
||||
menu_thumbnail_request(
|
||||
path_data, MENU_THUMBNAIL_LEFT, playlist, idx, left_thumbnail);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Entry is off-screen
|
||||
* > If status is MENU_THUMBNAIL_STATUS_UNKNOWN,
|
||||
* thumbnail is already in a blank state - do nothing
|
||||
* In all other cases, reset thumbnail */
|
||||
if (right_thumbnail->status != MENU_THUMBNAIL_STATUS_UNKNOWN)
|
||||
menu_thumbnail_reset(right_thumbnail);
|
||||
|
||||
if (left_thumbnail->status != MENU_THUMBNAIL_STATUS_UNKNOWN)
|
||||
menu_thumbnail_reset(left_thumbnail);
|
||||
}
|
||||
}
|
||||
|
||||
/* Thumbnail rendering */
|
||||
|
||||
/* Draws specified thumbnail centred (with aspect correct
|
||||
* scaling) within a rectangle of (width x height)
|
||||
* NOTE: Setting scale_factor > 1.0f will increase the
|
||||
* size of the thumbnail beyond the limits of the
|
||||
* (width x height) rectangle (centring + aspect
|
||||
* correct scaling is preserved). Use with caution */
|
||||
void menu_thumbnail_draw(
|
||||
video_frame_info_t *video_info, menu_thumbnail_t *thumbnail,
|
||||
float x, float y, unsigned width, unsigned height,
|
||||
float alpha, float scale_factor)
|
||||
{
|
||||
/* Sanity check */
|
||||
if (!video_info || !thumbnail ||
|
||||
(width < 1) || (height < 1) || (alpha <= 0.0f) || (scale_factor <= 0.0f))
|
||||
return;
|
||||
|
||||
/* Only draw thumbnail if it is available... */
|
||||
if (thumbnail->status == MENU_THUMBNAIL_STATUS_AVAILABLE)
|
||||
{
|
||||
menu_display_ctx_rotate_draw_t rotate_draw;
|
||||
menu_display_ctx_draw_t draw;
|
||||
struct video_coords coords;
|
||||
math_matrix_4x4 mymat;
|
||||
float draw_width;
|
||||
float draw_height;
|
||||
float display_aspect;
|
||||
float thumbnail_aspect;
|
||||
float thumbnail_alpha = thumbnail->alpha * alpha;
|
||||
float thumbnail_color[16] = {
|
||||
1.0f, 1.0f, 1.0f, 1.0f,
|
||||
1.0f, 1.0f, 1.0f, 1.0f,
|
||||
1.0f, 1.0f, 1.0f, 1.0f,
|
||||
1.0f, 1.0f, 1.0f, 1.0f
|
||||
};
|
||||
|
||||
/* Set thumbnail opacity */
|
||||
if (thumbnail_alpha <= 0.0f)
|
||||
return;
|
||||
else if (thumbnail_alpha < 1.0f)
|
||||
menu_display_set_alpha(thumbnail_color, thumbnail_alpha);
|
||||
|
||||
/* Get thumbnail dimensions */
|
||||
display_aspect = (float)width / (float)height;
|
||||
thumbnail_aspect = (float)thumbnail->width / (float)thumbnail->height;
|
||||
|
||||
if (thumbnail_aspect > display_aspect)
|
||||
{
|
||||
draw_width = (float)width;
|
||||
draw_height = (float)thumbnail->height * (draw_width / (float)thumbnail->width);
|
||||
}
|
||||
else
|
||||
{
|
||||
draw_height = (float)height;
|
||||
draw_width = (float)thumbnail->width * (draw_height / (float)thumbnail->height);
|
||||
}
|
||||
|
||||
/* Account for scale factor
|
||||
* > We have to do it like this rather than using the
|
||||
* draw.scale_factor parameter, because the latter
|
||||
* clips off any part of the expanded image that
|
||||
* extends beyond the bounding box... */
|
||||
draw_width *= scale_factor;
|
||||
draw_height *= scale_factor;
|
||||
|
||||
menu_display_blend_begin(video_info);
|
||||
|
||||
/* Perform 'rotation' step
|
||||
* > Note that rotation does not actually work...
|
||||
* > It rotates the image all right, but distorts it
|
||||
* to fit the aspect of the bounding box while clipping
|
||||
* off any 'corners' that extend beyond the bounding box
|
||||
* > Since the result is visual garbage, we disable
|
||||
* rotation entirely
|
||||
* > But we still have to call menu_display_rotate_z(),
|
||||
* or nothing will be drawn...
|
||||
* Note that we also disable scaling here (scale_enable),
|
||||
* since we handle scaling internally... */
|
||||
rotate_draw.matrix = &mymat;
|
||||
rotate_draw.rotation = 0.0f;
|
||||
rotate_draw.scale_x = 1.0f;
|
||||
rotate_draw.scale_y = 1.0f;
|
||||
rotate_draw.scale_z = 1.0f;
|
||||
rotate_draw.scale_enable = false;
|
||||
|
||||
menu_display_rotate_z(&rotate_draw, video_info);
|
||||
|
||||
/* Configure draw object */
|
||||
coords.vertices = 4;
|
||||
coords.vertex = NULL;
|
||||
coords.tex_coord = NULL;
|
||||
coords.lut_tex_coord = NULL;
|
||||
coords.color = (const float*)thumbnail_color;
|
||||
|
||||
draw.width = (unsigned)draw_width;
|
||||
draw.height = (unsigned)draw_height;
|
||||
draw.scale_factor = 1.0f;
|
||||
draw.rotation = 0.0f;
|
||||
draw.coords = &coords;
|
||||
draw.matrix_data = &mymat;
|
||||
draw.texture = thumbnail->texture;
|
||||
draw.prim_type = MENU_DISPLAY_PRIM_TRIANGLESTRIP;
|
||||
draw.pipeline.id = 0;
|
||||
|
||||
/* > Ensure thumbnail is centred */
|
||||
draw.x = x + ((float)width - draw_width) / 2.0f;
|
||||
draw.y = (float)video_info->height - y - draw_height - ((float)height - draw_height) / 2.0f;
|
||||
|
||||
/* Draw thumbnail */
|
||||
menu_display_draw(&draw, video_info);
|
||||
menu_display_blend_end(video_info);
|
||||
}
|
||||
}
|
||||
|
@ -109,20 +109,49 @@ void menu_thumbnail_reset(menu_thumbnail_t *thumbnail);
|
||||
* on/off screen
|
||||
* - Must be called each frame for every on-screen entry
|
||||
* - Must be called once for each entry as it moves off-screen
|
||||
* (or can be called each frame - overheads are small)
|
||||
* NOTE 1: Must be called *after* menu_thumbnail_set_system()
|
||||
* NOTE 2: This function calls menu_thumbnail_set_content*()
|
||||
* > It is therefore intended for use in situations
|
||||
* where each entry has a *single* thumbnail
|
||||
* > Since I can't think of any view mode that needs
|
||||
* two thumbnails, this should be fine (i.e. we might
|
||||
* want one additional image to go with the currently
|
||||
* selected item, but this is not a streaming thing -
|
||||
* the auxiliary image can just be loaded via a normal
|
||||
* menu_thumbnail_request() */
|
||||
* NOTE 3: This function is intended for use in situations
|
||||
* where each menu entry has a *single* thumbnail.
|
||||
* If each entry has two thumbnails, use
|
||||
* menu_thumbnail_process_streams() for improved
|
||||
* performance */
|
||||
void menu_thumbnail_process_stream(
|
||||
menu_thumbnail_path_data_t *path_data, enum menu_thumbnail_id thumbnail_id,
|
||||
playlist_t *playlist, size_t idx, menu_thumbnail_t *thumbnail, bool on_screen);
|
||||
|
||||
/* Handles streaming of the specified thumbnails as they move
|
||||
* on/off screen
|
||||
* - Must be called each frame for every on-screen entry
|
||||
* - Must be called once for each entry as it moves off-screen
|
||||
* (or can be called each frame - overheads are small)
|
||||
* NOTE 1: Must be called *after* menu_thumbnail_set_system()
|
||||
* NOTE 2: This function calls menu_thumbnail_set_content*()
|
||||
* NOTE 3: This function is intended for use in situations
|
||||
* where each menu entry has *two* thumbnails.
|
||||
* If each entry only has a single thumbnail, use
|
||||
* menu_thumbnail_process_stream() for improved
|
||||
* performance */
|
||||
void menu_thumbnail_process_streams(
|
||||
menu_thumbnail_path_data_t *path_data,
|
||||
playlist_t *playlist, size_t idx,
|
||||
menu_thumbnail_t *right_thumbnail, menu_thumbnail_t *left_thumbnail,
|
||||
bool on_screen);
|
||||
|
||||
/* Thumbnail rendering */
|
||||
|
||||
/* Draws specified thumbnail centred (with aspect correct
|
||||
* scaling) within a rectangle of (width x height)
|
||||
* NOTE: Setting scale_factor > 1.0f will increase the
|
||||
* size of the thumbnail beyond the limits of the
|
||||
* (width x height) rectangle (centring + aspect
|
||||
* correct scaling is preserved). Use with caution */
|
||||
void menu_thumbnail_draw(
|
||||
video_frame_info_t *video_info, menu_thumbnail_t *thumbnail,
|
||||
float x, float y, unsigned width, unsigned height,
|
||||
float alpha, float scale_factor);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
|
10
msg_hash.h
10
msg_hash.h
@ -517,8 +517,8 @@ enum msg_hash_enums
|
||||
MENU_ENUM_LABEL_VALUE_AUTO,
|
||||
|
||||
MENU_LABEL(MATERIALUI_ICONS_ENABLE),
|
||||
MENU_LABEL(MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT),
|
||||
MENU_LABEL(MATERIALUI_AUTO_ROTATE_NAV_BAR),
|
||||
MENU_LABEL(MATERIALUI_DUAL_THUMBNAIL_LIST_VIEW_ENABLE),
|
||||
|
||||
MENU_ENUM_LABEL_VALUE_RGUI_MENU_COLOR_THEME_CUSTOM,
|
||||
MENU_ENUM_LABEL_VALUE_RGUI_MENU_COLOR_THEME_CLASSIC_RED,
|
||||
@ -629,12 +629,18 @@ enum msg_hash_enums
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_THUMBNAIL_VIEW_PORTRAIT_DISABLED,
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_THUMBNAIL_VIEW_PORTRAIT_LIST_SMALL,
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_THUMBNAIL_VIEW_PORTRAIT_LIST_MEDIUM,
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_THUMBNAIL_VIEW_PORTRAIT_DUAL_ICON,
|
||||
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_THUMBNAIL_VIEW_LANDSCAPE_DISABLED,
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_THUMBNAIL_VIEW_LANDSCAPE_LIST_SMALL,
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_THUMBNAIL_VIEW_LANDSCAPE_LIST_MEDIUM,
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_THUMBNAIL_VIEW_LANDSCAPE_LIST_LARGE,
|
||||
|
||||
MENU_LABEL(MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION),
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION_DISABLED,
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION_ALWAYS,
|
||||
MENU_ENUM_LABEL_VALUE_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION_EXCLUDE_THUMBNAIL_VIEWS,
|
||||
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_POLL_TYPE_BEHAVIOR_LATE,
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_POLL_TYPE_BEHAVIOR_NORMAL,
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_POLL_TYPE_BEHAVIOR_EARLY,
|
||||
@ -991,9 +997,11 @@ enum msg_hash_enums
|
||||
MENU_LABEL(XMB_RIBBON_ENABLE),
|
||||
MENU_LABEL(THUMBNAILS),
|
||||
MENU_LABEL(THUMBNAILS_RGUI),
|
||||
MENU_LABEL(THUMBNAILS_MATERIALUI),
|
||||
MENU_LABEL(LEFT_THUMBNAILS),
|
||||
MENU_LABEL(LEFT_THUMBNAILS_RGUI),
|
||||
MENU_LABEL(LEFT_THUMBNAILS_OZONE),
|
||||
MENU_LABEL(LEFT_THUMBNAILS_MATERIALUI),
|
||||
MENU_LABEL(XMB_VERTICAL_THUMBNAILS),
|
||||
MENU_LABEL(MENU_XMB_THUMBNAIL_SCALE_FACTOR),
|
||||
MENU_LABEL(MENU_THUMBNAIL_UPSCALE_THRESHOLD),
|
||||
|
Loading…
Reference in New Issue
Block a user