(Menu) Cache video_info->width/video_info->height into local

variables
This commit is contained in:
twinaphex 2020-03-07 21:42:29 +01:00
parent f9c81f358a
commit a8a2294f27
5 changed files with 168 additions and 127 deletions

View File

@ -1491,6 +1491,8 @@ static void ozone_draw_header(ozone_handle_t *ozone, video_frame_info_t *video_i
unsigned seperator_margin = 30 * scale_factor;
enum gfx_animation_ticker_type
menu_ticker_type = (enum gfx_animation_ticker_type)settings->uints.menu_ticker_type;
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
/* Initial ticker configuration */
if (use_smooth_ticker)
@ -1510,14 +1512,14 @@ static void ozone_draw_header(ozone_handle_t *ozone, video_frame_info_t *video_i
}
/* Separator */
gfx_display_draw_quad(video_info, seperator_margin, ozone->dimensions.header_height, video_info->width - seperator_margin * 2, ozone->dimensions.spacer_1px, video_info->width, video_info->height, ozone->theme->header_footer_separator);
gfx_display_draw_quad(video_info, seperator_margin, ozone->dimensions.header_height, video_width - seperator_margin * 2, ozone->dimensions.spacer_1px, video_width, video_height, ozone->theme->header_footer_separator);
/* Title */
if (use_smooth_ticker)
{
ticker_smooth.font = ozone->fonts.title;
ticker_smooth.selected = true;
ticker_smooth.field_width = (video_info->width - (128 + 47 + 180) * scale_factor);
ticker_smooth.field_width = (video_width - (128 + 47 + 180) * scale_factor);
ticker_smooth.src_str = ozone->show_fullscreen_thumbnails ? ozone->fullscreen_thumbnail_label : ozone->title;
ticker_smooth.dst_str = title;
ticker_smooth.dst_str_len = sizeof(title);
@ -1527,14 +1529,14 @@ static void ozone_draw_header(ozone_handle_t *ozone, video_frame_info_t *video_i
else
{
ticker.s = title;
ticker.len = (video_info->width - (128 + 47 + 180) * scale_factor) / ozone->title_font_glyph_width;
ticker.len = (video_width - (128 + 47 + 180) * scale_factor) / ozone->title_font_glyph_width;
ticker.str = ozone->show_fullscreen_thumbnails ? ozone->fullscreen_thumbnail_label : ozone->title;
ticker.selected = true;
gfx_animation_ticker(&ticker);
}
ozone_draw_text(video_info, ozone, title, ticker_x_offset + 128 * scale_factor, ozone->dimensions.header_height / 2 + ozone->title_font_glyph_height * 3.0f/10.0f, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.title, ozone->theme->text_rgba, false);
ozone_draw_text(video_info, ozone, title, ticker_x_offset + 128 * scale_factor, ozone->dimensions.header_height / 2 + ozone->title_font_glyph_height * 3.0f/10.0f, TEXT_ALIGN_LEFT, video_width, video_height, ozone->fonts.title, ozone->theme->text_rgba, false);
/* Icon */
gfx_display_blend_begin(video_info);
@ -1547,8 +1549,8 @@ static void ozone_draw_header(ozone_handle_t *ozone, video_frame_info_t *video_i
ozone->textures[OZONE_TEXTURE_DISCORD_OWN_AVATAR],
47 * scale_factor,
14 * scale_factor, /* Where does this come from...? */
video_info->width,
video_info->height,
video_width,
video_height,
0, 1, ozone->theme->entries_icon);
else
#endif
@ -1559,8 +1561,8 @@ static void ozone_draw_header(ozone_handle_t *ozone, video_frame_info_t *video_i
ozone->textures[OZONE_TEXTURE_RETROARCH],
47 * scale_factor,
(ozone->dimensions.header_height - logo_icon_size) / 2,
video_info->width,
video_info->height,
video_width,
video_height,
0, 1, ozone->theme->entries_icon);
gfx_display_blend_end(video_info);
@ -1581,7 +1583,7 @@ static void ozone_draw_header(ozone_handle_t *ozone, video_frame_info_t *video_i
{
timedate_offset = 95 * scale_factor;
ozone_draw_text(video_info, ozone, msg, video_info->width - 85 * scale_factor, ozone->dimensions.header_height / 2 + ozone->time_font_glyph_height * 3.0f/10.0f, TEXT_ALIGN_RIGHT, video_info->width, video_info->height, ozone->fonts.time, ozone->theme->text_rgba, false);
ozone_draw_text(video_info, ozone, msg, video_width - 85 * scale_factor, ozone->dimensions.header_height / 2 + ozone->time_font_glyph_height * 3.0f/10.0f, TEXT_ALIGN_RIGHT, video_width, video_height, ozone->fonts.time, ozone->theme->text_rgba, false);
gfx_display_blend_begin(video_info);
ozone_draw_icon(
@ -1589,10 +1591,10 @@ static void ozone_draw_header(ozone_handle_t *ozone, video_frame_info_t *video_i
status_icon_size,
status_icon_size,
ozone->icons_textures[powerstate.charging? OZONE_ENTRIES_ICONS_TEXTURE_BATTERY_CHARGING : (powerstate.percent > 80)? OZONE_ENTRIES_ICONS_TEXTURE_BATTERY_FULL : (powerstate.percent > 60)? OZONE_ENTRIES_ICONS_TEXTURE_BATTERY_80 : (powerstate.percent > 40)? OZONE_ENTRIES_ICONS_TEXTURE_BATTERY_60 : (powerstate.percent > 20)? OZONE_ENTRIES_ICONS_TEXTURE_BATTERY_40 : OZONE_ENTRIES_ICONS_TEXTURE_BATTERY_20],
video_info->width - (60 + 56) * scale_factor,
video_width - (60 + 56) * scale_factor,
0,
video_info->width,
video_info->height,
video_width,
video_height,
0, 1, ozone->theme->entries_icon);
gfx_display_blend_end(video_info);
}
@ -1612,7 +1614,7 @@ static void ozone_draw_header(ozone_handle_t *ozone, video_frame_info_t *video_i
menu_display_timedate(&datetime);
ozone_draw_text(video_info, ozone, timedate, video_info->width - (85 * scale_factor) - timedate_offset, ozone->dimensions.header_height / 2 + ozone->time_font_glyph_height * 3.0f/10.0f, TEXT_ALIGN_RIGHT, video_info->width, video_info->height, ozone->fonts.time, ozone->theme->text_rgba, false);
ozone_draw_text(video_info, ozone, timedate, video_width - (85 * scale_factor) - timedate_offset, ozone->dimensions.header_height / 2 + ozone->time_font_glyph_height * 3.0f/10.0f, TEXT_ALIGN_RIGHT, video_width, video_height, ozone->fonts.time, ozone->theme->text_rgba, false);
gfx_display_blend_begin(video_info);
ozone_draw_icon(
@ -1620,10 +1622,10 @@ static void ozone_draw_header(ozone_handle_t *ozone, video_frame_info_t *video_i
status_icon_size,
status_icon_size,
ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_CLOCK],
video_info->width - (60 + 56) * scale_factor - timedate_offset,
video_width - (60 + 56) * scale_factor - timedate_offset,
0,
video_info->width,
video_info->height,
video_width,
video_height,
0, 1, ozone->theme->entries_icon);
gfx_display_blend_end(video_info);
}
@ -1634,19 +1636,21 @@ static void ozone_draw_footer(ozone_handle_t *ozone, video_frame_info_t *video_i
float scale_factor = ozone->last_scale_factor;
unsigned seperator_margin = 30 * scale_factor;
bool menu_core_enable = settings->bools.menu_core_enable;
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
/* Separator */
gfx_display_draw_quad(video_info, seperator_margin, video_info->height - ozone->dimensions.footer_height, video_info->width - seperator_margin * 2, ozone->dimensions.spacer_1px, video_info->width, video_info->height, ozone->theme->header_footer_separator);
gfx_display_draw_quad(video_info, seperator_margin, video_height - ozone->dimensions.footer_height, video_width - seperator_margin * 2, ozone->dimensions.spacer_1px, video_width, video_height, ozone->theme->header_footer_separator);
/* Core title or Switch icon */
if (menu_core_enable)
{
char core_title[255];
menu_entries_get_core_title(core_title, sizeof(core_title));
ozone_draw_text(video_info, ozone, core_title, 59 * scale_factor, video_info->height - ozone->dimensions.footer_height / 2 + ozone->footer_font_glyph_height * 3.0f/10.0f, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.footer, ozone->theme->text_rgba, false);
ozone_draw_text(video_info, ozone, core_title, 59 * scale_factor, video_height - ozone->dimensions.footer_height / 2 + ozone->footer_font_glyph_height * 3.0f/10.0f, TEXT_ALIGN_LEFT, video_width, video_height, ozone->fonts.footer, ozone->theme->text_rgba, false);
}
else
ozone_draw_icon(video_info, 69 * scale_factor, 30 * scale_factor, ozone->theme->textures[OZONE_THEME_TEXTURE_SWITCH], 59 * scale_factor, video_info->height - ozone->dimensions.footer_height / 2 - 15 * scale_factor, video_info->width,video_info->height, 0, 1, NULL);
ozone_draw_icon(video_info, 69 * scale_factor, 30 * scale_factor, ozone->theme->textures[OZONE_THEME_TEXTURE_SWITCH], 59 * scale_factor, video_height - ozone->dimensions.footer_height / 2 - 15 * scale_factor, video_width, video_height, 0, 1, NULL);
/* Buttons */
{
@ -1670,19 +1674,19 @@ static void ozone_draw_footer(ozone_handle_t *ozone, video_frame_info_t *video_i
if (do_swap)
{
ozone_draw_icon(video_info, icon_size, icon_size, ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_D], video_info->width - 138 * scale_factor, video_info->height - ozone->dimensions.footer_height / 2 - icon_offset, video_info->width,video_info->height, 0, 1, ozone->theme_dynamic.entries_icon);
ozone_draw_icon(video_info, icon_size, icon_size, ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_R], video_info->width - 256 * scale_factor, video_info->height - ozone->dimensions.footer_height / 2 - icon_offset, video_info->width,video_info->height, 0, 1, ozone->theme_dynamic.entries_icon);
ozone_draw_icon(video_info, icon_size, icon_size, ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_D], video_width - 138 * scale_factor, video_height - ozone->dimensions.footer_height / 2 - icon_offset, video_width,video_height, 0, 1, ozone->theme_dynamic.entries_icon);
ozone_draw_icon(video_info, icon_size, icon_size, ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_R], video_width - 256 * scale_factor, video_height - ozone->dimensions.footer_height / 2 - icon_offset, video_width,video_height, 0, 1, ozone->theme_dynamic.entries_icon);
}
else
{
ozone_draw_icon(video_info, icon_size, icon_size, ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_D], video_info->width - 256 * scale_factor, video_info->height - ozone->dimensions.footer_height / 2 - icon_offset, video_info->width,video_info->height, 0, 1, ozone->theme_dynamic.entries_icon);
ozone_draw_icon(video_info, icon_size, icon_size, ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_R], video_info->width - 138 * scale_factor, video_info->height - ozone->dimensions.footer_height / 2 - icon_offset, video_info->width,video_info->height, 0, 1, ozone->theme_dynamic.entries_icon);
ozone_draw_icon(video_info, icon_size, icon_size, ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_D], video_width - 256 * scale_factor, video_height - ozone->dimensions.footer_height / 2 - icon_offset, video_width,video_height, 0, 1, ozone->theme_dynamic.entries_icon);
ozone_draw_icon(video_info, icon_size, icon_size, ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_R], video_width - 138 * scale_factor, video_height - ozone->dimensions.footer_height / 2 - icon_offset, video_width,video_height, 0, 1, ozone->theme_dynamic.entries_icon);
}
ozone_draw_icon(video_info, icon_size, icon_size, ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_U], video_info->width - 384 * scale_factor, video_info->height - ozone->dimensions.footer_height / 2 - icon_offset, video_info->width,video_info->height, 0, 1, ozone->theme_dynamic.entries_icon);
ozone_draw_icon(video_info, icon_size, icon_size, ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_U], video_width - 384 * scale_factor, video_height - ozone->dimensions.footer_height / 2 - icon_offset, video_width,video_height, 0, 1, ozone->theme_dynamic.entries_icon);
if (ozone->is_playlist && !ozone->cursor_in_sidebar)
ozone_draw_icon(video_info, icon_size, icon_size, ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_L], video_info->width - (384 + 118 + 100 + 50) * scale_factor, video_info->height - ozone->dimensions.footer_height / 2 - icon_offset, video_info->width,video_info->height, 0, 1, ozone->theme_dynamic.entries_icon);
ozone_draw_icon(video_info, icon_size, icon_size, ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_L], video_width - (384 + 118 + 100 + 50) * scale_factor, video_height - ozone->dimensions.footer_height / 2 - icon_offset, video_width, video_height, 0, 1, ozone->theme_dynamic.entries_icon);
gfx_display_blend_end(video_info);
@ -1690,21 +1694,21 @@ static void ozone_draw_footer(ozone_handle_t *ozone, video_frame_info_t *video_i
do_swap ?
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_BASIC_MENU_CONTROLS_OK) :
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_BASIC_MENU_CONTROLS_BACK),
video_info->width - back_width, video_info->height - ozone->dimensions.footer_height / 2 + ozone->footer_font_glyph_height * 3.0f/10.0f, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.footer, ozone->theme->text_rgba, false);
video_width - back_width, video_height - ozone->dimensions.footer_height / 2 + ozone->footer_font_glyph_height * 3.0f/10.0f, TEXT_ALIGN_LEFT, video_width, video_height, ozone->fonts.footer, ozone->theme->text_rgba, false);
ozone_draw_text(video_info, ozone,
do_swap ?
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_BASIC_MENU_CONTROLS_BACK) :
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_BASIC_MENU_CONTROLS_OK),
video_info->width - ok_width, video_info->height - ozone->dimensions.footer_height / 2 + ozone->footer_font_glyph_height * 3.0f/10.0f, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.footer, ozone->theme->text_rgba, false);
video_width - ok_width, video_height - ozone->dimensions.footer_height / 2 + ozone->footer_font_glyph_height * 3.0f/10.0f, TEXT_ALIGN_LEFT, video_width, video_height, ozone->fonts.footer, ozone->theme->text_rgba, false);
ozone_draw_text(video_info, ozone,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SEARCH),
video_info->width - search_width, video_info->height - ozone->dimensions.footer_height / 2 + ozone->footer_font_glyph_height * 3.0f/10.0f, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.footer, ozone->theme->text_rgba, false);
video_width - search_width, video_height - ozone->dimensions.footer_height / 2 + ozone->footer_font_glyph_height * 3.0f/10.0f, TEXT_ALIGN_LEFT, video_width, video_height, ozone->fonts.footer, ozone->theme->text_rgba, false);
if (ozone->is_playlist && !ozone->cursor_in_sidebar)
ozone_draw_text(video_info, ozone,
msg_hash_to_str(MSG_CHANGE_THUMBNAIL_TYPE),
video_info->width - thumb_width, video_info->height - ozone->dimensions.footer_height / 2 + ozone->footer_font_glyph_height * 3.0f/10.0f, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.footer, ozone->theme->text_rgba, false);
video_width - thumb_width, video_height - ozone->dimensions.footer_height / 2 + ozone->footer_font_glyph_height * 3.0f/10.0f, TEXT_ALIGN_LEFT, video_width, video_height, ozone->fonts.footer, ozone->theme->text_rgba, false);
}
@ -2011,6 +2015,8 @@ static void ozone_frame(void *data, video_frame_info_t *video_info)
bool draw_osk = menu_input_dialog_get_display_kb();
static bool draw_osk_old = false;
float *background_color = NULL;
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
#if 0
static bool reset = false;
@ -2065,7 +2071,7 @@ static void ozone_frame(void *data, video_frame_info_t *video_info)
last_use_preferred_system_color_theme = use_preferred_system_color_theme;
}
gfx_display_set_viewport(video_info->width, video_info->height);
gfx_display_set_viewport(video_width, video_height);
/* Clear text */
font_driver_bind_block(ozone->fonts.footer, &ozone->raster_blocks.footer);
@ -2095,8 +2101,8 @@ static void ozone_frame(void *data, video_frame_info_t *video_info)
background_color = ozone->theme->background;
gfx_display_draw_quad(video_info,
0, 0, video_info->width, video_info->height,
video_info->width, video_info->height,
0, 0, video_width, video_height,
video_width, video_height,
background_color
);
@ -2108,7 +2114,7 @@ static void ozone_frame(void *data, video_frame_info_t *video_info)
ozone_draw_sidebar(ozone, video_info);
/* Menu entries */
gfx_display_scissor_begin(video_info, ozone->sidebar_offset + (unsigned) ozone->dimensions.sidebar_width, ozone->dimensions.header_height + ozone->dimensions.spacer_1px, video_info->width - (unsigned) ozone->dimensions.sidebar_width + (-ozone->sidebar_offset), video_info->height - ozone->dimensions.header_height - ozone->dimensions.footer_height - ozone->dimensions.spacer_1px);
gfx_display_scissor_begin(video_info, ozone->sidebar_offset + (unsigned) ozone->dimensions.sidebar_width, ozone->dimensions.header_height + ozone->dimensions.spacer_1px, video_width - (unsigned) ozone->dimensions.sidebar_width + (-ozone->sidebar_offset), video_height - ozone->dimensions.header_height - ozone->dimensions.footer_height - ozone->dimensions.spacer_1px);
/* Current list */
ozone_draw_entries(ozone,
@ -2140,9 +2146,9 @@ static void ozone_frame(void *data, video_frame_info_t *video_info)
gfx_display_scissor_end(video_info);
/* Flush first layer of text */
font_driver_flush(video_info->width, video_info->height, ozone->fonts.footer);
font_driver_flush(video_info->width, video_info->height, ozone->fonts.title);
font_driver_flush(video_info->width, video_info->height, ozone->fonts.time);
font_driver_flush(video_width, video_height, ozone->fonts.footer);
font_driver_flush(video_width, video_height, ozone->fonts.title);
font_driver_flush(video_width, video_height, ozone->fonts.time);
font_driver_bind_block(ozone->fonts.footer, NULL);
font_driver_bind_block(ozone->fonts.title, NULL);
@ -2209,8 +2215,8 @@ static void ozone_frame(void *data, video_frame_info_t *video_info)
ozone_draw_messagebox(ozone, video_info, ozone->pending_message);
}
font_driver_flush(video_info->width, video_info->height, ozone->fonts.footer);
font_driver_flush(video_info->width, video_info->height, ozone->fonts.entries_label);
font_driver_flush(video_width, video_height, ozone->fonts.footer);
font_driver_flush(video_width, video_height, ozone->fonts.entries_label);
/* Cursor */
if (ozone->show_cursor && (ozone->pointer.type != MENU_POINTER_DISABLED))
@ -2223,12 +2229,12 @@ static void ozone_frame(void *data, video_frame_info_t *video_info)
ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_POINTER],
ozone->pointer.x,
ozone->pointer.y,
video_info->width,
video_info->height
video_width,
video_height
);
}
gfx_display_unset_viewport(video_info->width, video_info->height);
gfx_display_unset_viewport(video_width, video_height);
}
static void ozone_set_header(ozone_handle_t *ozone)

View File

@ -117,11 +117,13 @@ static void ozone_draw_cursor_slice(ozone_handle_t *ozone,
unsigned width, unsigned height,
size_t y, float alpha)
{
float scale_factor = ozone->last_scale_factor;
int slice_x = x_offset - 14 * scale_factor;
int slice_y = (int)y + 8 * scale_factor;
unsigned slice_new_w = width + (3 + 28 - 4) * scale_factor;
unsigned slice_new_h = height + 20 * scale_factor;
float scale_factor = ozone->last_scale_factor;
int slice_x = x_offset - 14 * scale_factor;
int slice_y = (int)y + 8 * scale_factor;
unsigned slice_new_w = width + (3 + 28 - 4) * scale_factor;
unsigned slice_new_h = height + 20 * scale_factor;
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
gfx_display_set_alpha(ozone->theme_dynamic.cursor_alpha, alpha);
gfx_display_set_alpha(ozone->theme_dynamic.cursor_border, alpha);
@ -136,7 +138,7 @@ static void ozone_draw_cursor_slice(ozone_handle_t *ozone,
80, 80,
slice_new_w,
slice_new_h,
video_info->width, video_info->height,
video_width, video_height,
ozone->theme_dynamic.cursor_alpha,
20, scale_factor,
ozone->theme->textures[OZONE_THEME_TEXTURE_CURSOR_NO_BORDER]
@ -150,7 +152,7 @@ static void ozone_draw_cursor_slice(ozone_handle_t *ozone,
80, 80,
slice_new_w,
slice_new_h,
video_info->width, video_info->height,
video_width, video_height,
ozone->theme_dynamic.cursor_border,
20, scale_factor,
ozone->textures[OZONE_TEXTURE_CURSOR_BORDER]
@ -165,25 +167,28 @@ static void ozone_draw_cursor_fallback(ozone_handle_t *ozone,
unsigned width, unsigned height,
size_t y, float alpha)
{
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
gfx_display_set_alpha(ozone->theme_dynamic.selection_border, alpha);
gfx_display_set_alpha(ozone->theme_dynamic.selection, alpha);
/* Fill */
gfx_display_draw_quad(video_info, x_offset, (int)y, width, height - ozone->dimensions.spacer_5px, video_info->width, video_info->height, ozone->theme_dynamic.selection);
gfx_display_draw_quad(video_info, x_offset, (int)y, width, height - ozone->dimensions.spacer_5px, video_width, video_height, ozone->theme_dynamic.selection);
/* Borders (can't do one single quad because of alpha) */
/* Top */
gfx_display_draw_quad(video_info, x_offset - ozone->dimensions.spacer_3px, (int)(y - ozone->dimensions.spacer_3px), width + ozone->dimensions.spacer_3px * 2, ozone->dimensions.spacer_3px, video_info->width, video_info->height, ozone->theme_dynamic.selection_border);
gfx_display_draw_quad(video_info, x_offset - ozone->dimensions.spacer_3px, (int)(y - ozone->dimensions.spacer_3px), width + ozone->dimensions.spacer_3px * 2, ozone->dimensions.spacer_3px, video_width, video_height, ozone->theme_dynamic.selection_border);
/* Bottom */
gfx_display_draw_quad(video_info, x_offset - ozone->dimensions.spacer_3px, (int)(y + height - ozone->dimensions.spacer_5px), width + ozone->dimensions.spacer_3px * 2, ozone->dimensions.spacer_3px, video_info->width, video_info->height, ozone->theme_dynamic.selection_border);
gfx_display_draw_quad(video_info, x_offset - ozone->dimensions.spacer_3px, (int)(y + height - ozone->dimensions.spacer_5px), width + ozone->dimensions.spacer_3px * 2, ozone->dimensions.spacer_3px, video_width, video_height, ozone->theme_dynamic.selection_border);
/* Left */
gfx_display_draw_quad(video_info, (int)(x_offset - ozone->dimensions.spacer_3px), (int)y, ozone->dimensions.spacer_3px, height - ozone->dimensions.spacer_5px, video_info->width, video_info->height, ozone->theme_dynamic.selection_border);
gfx_display_draw_quad(video_info, (int)(x_offset - ozone->dimensions.spacer_3px), (int)y, ozone->dimensions.spacer_3px, height - ozone->dimensions.spacer_5px, video_width, video_height, ozone->theme_dynamic.selection_border);
/* Right */
gfx_display_draw_quad(video_info, x_offset + width, (int)y, ozone->dimensions.spacer_3px, height - ozone->dimensions.spacer_5px, video_info->width, video_info->height, ozone->theme_dynamic.selection_border);
gfx_display_draw_quad(video_info, x_offset + width, (int)y, ozone->dimensions.spacer_3px, height - ozone->dimensions.spacer_5px, video_width, video_height, ozone->theme_dynamic.selection_border);
}
void ozone_draw_cursor(ozone_handle_t *ozone,
@ -246,8 +251,11 @@ void ozone_draw_icon(
void ozone_draw_backdrop(video_frame_info_t *video_info, float alpha)
{
/* TODO: Replace this backdrop by a blur shader on the whole screen if available */
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
gfx_display_set_alpha(ozone_backdrop, alpha);
gfx_display_draw_quad(video_info, 0, 0, video_info->width, video_info->height, video_info->width, video_info->height, ozone_backdrop);
gfx_display_draw_quad(video_info, 0, 0, video_width, video_height, video_width, video_height, ozone_backdrop);
}
void ozone_draw_osk(ozone_handle_t *ozone,
@ -259,11 +267,13 @@ void ozone_draw_osk(ozone_handle_t *ozone,
char message[2048];
unsigned text_color;
struct string_list *list;
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
float scale_factor = ozone->last_scale_factor;
unsigned margin = 75 * scale_factor;
unsigned padding = 10 * scale_factor;
unsigned bottom_end = video_info->height/2;
unsigned bottom_end = video_height / 2;
unsigned y_offset = 0;
bool draw_placeholder = string_is_empty(str);
@ -278,20 +288,20 @@ void ozone_draw_osk(ozone_handle_t *ozone,
/* Border */
/* Top */
gfx_display_draw_quad(video_info, margin, margin, video_info->width - margin*2, ozone->dimensions.spacer_1px, video_info->width, video_info->height, ozone->theme->entries_border);
gfx_display_draw_quad(video_info, margin, margin, video_width - margin*2, ozone->dimensions.spacer_1px, video_width, video_height, ozone->theme->entries_border);
/* Bottom */
gfx_display_draw_quad(video_info, margin, bottom_end - margin, video_info->width - margin*2, ozone->dimensions.spacer_1px, video_info->width, video_info->height, ozone->theme->entries_border);
gfx_display_draw_quad(video_info, margin, bottom_end - margin, video_width - margin*2, ozone->dimensions.spacer_1px, video_width, video_height, ozone->theme->entries_border);
/* Left */
gfx_display_draw_quad(video_info, margin, margin, ozone->dimensions.spacer_1px, bottom_end - margin*2, video_info->width, video_info->height, ozone->theme->entries_border);
gfx_display_draw_quad(video_info, margin, margin, ozone->dimensions.spacer_1px, bottom_end - margin*2, video_width, video_height, ozone->theme->entries_border);
/* Right */
gfx_display_draw_quad(video_info, video_info->width - margin, margin, ozone->dimensions.spacer_1px, bottom_end - margin*2, video_info->width, video_info->height, ozone->theme->entries_border);
gfx_display_draw_quad(video_info, video_width - margin, margin, ozone->dimensions.spacer_1px, bottom_end - margin*2, video_width, video_height, ozone->theme->entries_border);
/* Backdrop */
/* TODO: Remove the backdrop if blur shader is available */
gfx_display_draw_quad(video_info, margin + ozone->dimensions.spacer_1px, margin + ozone->dimensions.spacer_1px, video_info->width - margin*2 - ozone->dimensions.spacer_2px, bottom_end - margin*2 - ozone->dimensions.spacer_2px, video_info->width, video_info->height, ozone_osk_backdrop);
gfx_display_draw_quad(video_info, margin + ozone->dimensions.spacer_1px, margin + ozone->dimensions.spacer_1px, video_width - margin*2 - ozone->dimensions.spacer_2px, bottom_end - margin*2 - ozone->dimensions.spacer_2px, video_width, video_height, ozone_osk_backdrop);
/* Placeholder & text*/
if (!draw_placeholder)
@ -305,7 +315,7 @@ void ozone_draw_osk(ozone_handle_t *ozone,
text_color = ozone_theme_light.text_sublabel_rgba;
}
word_wrap(message, text, (video_info->width - margin*2 - padding*2) / ozone->entry_font_glyph_width, true, 0);
word_wrap(message, text, (video_width - margin*2 - padding*2) / ozone->entry_font_glyph_width, true, 0);
list = string_split(message, "\n");
@ -313,7 +323,7 @@ void ozone_draw_osk(ozone_handle_t *ozone,
{
const char *msg = list->elems[i].data;
ozone_draw_text(video_info, ozone, msg, margin + padding * 2, margin + padding + ozone->sublabel_font_glyph_height + y_offset, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.entries_label, text_color, false);
ozone_draw_text(video_info, ozone, msg, margin + padding * 2, margin + padding + ozone->sublabel_font_glyph_height + y_offset, TEXT_ALIGN_LEFT, video_width, video_height, ozone->fonts.entries_label, text_color, false);
/* Cursor */
if (i == list->size - 1)
@ -321,7 +331,7 @@ void ozone_draw_osk(ozone_handle_t *ozone,
if (ozone->osk_cursor)
{
unsigned cursor_x = draw_placeholder ? 0 : font_driver_get_message_width(ozone->fonts.entries_label, msg, (unsigned)strlen(msg), 1);
gfx_display_draw_quad(video_info, margin + padding*2 + cursor_x, margin + padding + y_offset + ozone->dimensions.spacer_3px, ozone->dimensions.spacer_1px, 25 * scale_factor, video_info->width, video_info->height, ozone_pure_white);
gfx_display_draw_quad(video_info, margin + padding*2 + cursor_x, margin + padding + y_offset + ozone->dimensions.spacer_3px, ozone->dimensions.spacer_1px, 25 * scale_factor, video_width, video_height, ozone_pure_white);
}
}
else

View File

@ -53,9 +53,11 @@ static void ozone_draw_entry_value(ozone_handle_t *ozone,
uint32_t alpha_uint32,
menu_entry_t *entry)
{
bool switch_is_on = true;
bool do_draw_text = false;
float scale_factor = ozone->last_scale_factor;
bool switch_is_on = true;
bool do_draw_text = false;
float scale_factor = ozone->last_scale_factor;
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
if (!entry->checked && string_is_empty(value))
return;
@ -64,7 +66,7 @@ static void ozone_draw_entry_value(ozone_handle_t *ozone,
if (entry->checked)
{
gfx_display_blend_begin(video_info);
ozone_draw_icon(video_info, 30 * scale_factor, 30 * scale_factor, ozone->theme->textures[OZONE_THEME_TEXTURE_CHECK], x - 20 * scale_factor, y - 22 * scale_factor, video_info->width, video_info->height, 0, 1, ozone->theme_dynamic.entries_checkmark);
ozone_draw_icon(video_info, 30 * scale_factor, 30 * scale_factor, ozone->theme->textures[OZONE_THEME_TEXTURE_CHECK], x - 20 * scale_factor, y - 22 * scale_factor, video_width, video_height, 0, 1, ozone->theme_dynamic.entries_checkmark);
gfx_display_blend_end(video_info);
return;
}
@ -113,12 +115,12 @@ static void ozone_draw_entry_value(ozone_handle_t *ozone,
if (do_draw_text)
{
ozone_draw_text(video_info, ozone, value, x, y, TEXT_ALIGN_RIGHT, video_info->width, video_info->height, ozone->fonts.entries_label, COLOR_TEXT_ALPHA(ozone->theme->text_selected_rgba, alpha_uint32), false);
ozone_draw_text(video_info, ozone, value, x, y, TEXT_ALIGN_RIGHT, video_width, video_height, ozone->fonts.entries_label, COLOR_TEXT_ALPHA(ozone->theme->text_selected_rgba, alpha_uint32), false);
}
else
{
ozone_draw_text(video_info, ozone, (switch_is_on ? msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ON) : msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)),
x, y, TEXT_ALIGN_RIGHT, video_info->width, video_info->height, ozone->fonts.entries_label,
x, y, TEXT_ALIGN_RIGHT, video_width, video_height, ozone->fonts.entries_label,
COLOR_TEXT_ALPHA((switch_is_on ? ozone->theme->text_selected_rgba : ozone->theme->text_sublabel_rgba), alpha_uint32), false);
}
}
@ -368,6 +370,8 @@ void ozone_draw_entries(ozone_handle_t *ozone, video_frame_info_t *video_info,
float sidebar_offset, bottom_boundary, invert, alpha_anim;
unsigned video_info_height, video_info_width, entry_width, button_height;
settings_t *settings = config_get_ptr();
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
bool menu_show_sublabels= settings->bools.menu_show_sublabels;
bool use_smooth_ticker = settings->bools.menu_ticker_smooth;
bool old_list = selection_buf == ozone->selection_buf_old;
@ -386,7 +390,7 @@ void ozone_draw_entries(ozone_handle_t *ozone, video_frame_info_t *video_info,
entries_end = file_list_get_size(selection_buf);
y = ozone->dimensions.header_height + ozone->dimensions.spacer_1px + ozone->dimensions.entry_padding_vertical;
sidebar_offset = ozone->sidebar_offset;
entry_width = video_info->width - (unsigned) ozone->dimensions.sidebar_width - ozone->sidebar_offset - entry_padding * 2 - ozone->animations.thumbnail_bar_position;
entry_width = video_width - (unsigned) ozone->dimensions.sidebar_width - ozone->sidebar_offset - entry_padding * 2 - ozone->animations.thumbnail_bar_position;
button_height = ozone->dimensions.entry_height; /* height of the button (entry minus sublabel) */
video_driver_get_size(&video_info_width, &video_info_height);
@ -443,9 +447,9 @@ void ozone_draw_entries(ozone_handle_t *ozone, video_frame_info_t *video_info,
/* Borders */
gfx_display_draw_quad(video_info, border_start_x,
border_start_y, entry_width, ozone->dimensions.spacer_1px, video_info->width, video_info->height, ozone->theme_dynamic.entries_border);
border_start_y, entry_width, ozone->dimensions.spacer_1px, video_width, video_height, ozone->theme_dynamic.entries_border);
gfx_display_draw_quad(video_info, border_start_x,
border_start_y + button_height, entry_width, ozone->dimensions.spacer_1px, video_info->width, video_info->height, ozone->theme_dynamic.entries_border);
border_start_y + button_height, entry_width, ozone->dimensions.spacer_1px, video_width, video_height, ozone->theme_dynamic.entries_border);
border_iterate:
if (node)
@ -619,7 +623,7 @@ border_iterate:
gfx_display_blend_begin(video_info);
ozone_draw_icon(video_info, ozone->dimensions.entry_icon_size, ozone->dimensions.entry_icon_size, texture,
(unsigned) ozone->dimensions.sidebar_width + x_offset + entry_padding + ozone->dimensions.entry_icon_padding,
y + scroll_y + ozone->dimensions.entry_height / 2 - ozone->dimensions.entry_icon_size / 2, video_info->width, video_info->height, 0, 1, icon_color);
y + scroll_y + ozone->dimensions.entry_height / 2 - ozone->dimensions.entry_icon_size / 2, video_width, video_height, 0, 1, icon_color);
gfx_display_blend_end(video_info);
if (icon_color == ozone_pure_white)
@ -630,13 +634,13 @@ border_iterate:
/* Draw text */
ozone_draw_text(video_info, ozone, rich_label, ticker_x_offset + text_offset + (unsigned) ozone->dimensions.sidebar_width + x_offset + entry_padding + ozone->dimensions.entry_icon_size + ozone->dimensions.entry_icon_padding * 2,
y + ozone->dimensions.entry_height / 2 + ozone->entry_font_glyph_height * 3.0f/10.0f + scroll_y, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.entries_label, COLOR_TEXT_ALPHA(ozone->theme->text_rgba, alpha_uint32), false);
y + ozone->dimensions.entry_height / 2 + ozone->entry_font_glyph_height * 3.0f/10.0f + scroll_y, TEXT_ALIGN_LEFT, video_width, video_height, ozone->fonts.entries_label, COLOR_TEXT_ALPHA(ozone->theme->text_rgba, alpha_uint32), false);
if (menu_show_sublabels)
{
if (!string_is_empty(sublabel_str))
ozone_draw_text(video_info, ozone, sublabel_str, (unsigned) ozone->dimensions.sidebar_width + x_offset + entry_padding + ozone->dimensions.entry_icon_padding,
y + ozone->dimensions.entry_height + ozone->dimensions.spacer_1px + ozone->dimensions.spacer_5px + ozone->sublabel_font_glyph_height + scroll_y, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.entries_sublabel, COLOR_TEXT_ALPHA(ozone->theme->text_sublabel_rgba, alpha_uint32), false);
y + ozone->dimensions.entry_height + ozone->dimensions.spacer_1px + ozone->dimensions.spacer_5px + ozone->sublabel_font_glyph_height + scroll_y, TEXT_ALIGN_LEFT, video_width, video_height, ozone->fonts.entries_sublabel, COLOR_TEXT_ALPHA(ozone->theme->text_sublabel_rgba, alpha_uint32), false);
}
/* Value */
@ -674,10 +678,10 @@ icons_iterate:
}
/* Text layer */
font_driver_flush(video_info->width, video_info->height, ozone->fonts.entries_label);
font_driver_flush(video_width, video_height, ozone->fonts.entries_label);
if (menu_show_sublabels)
font_driver_flush(video_info->width, video_info->height, ozone->fonts.entries_sublabel);
font_driver_flush(video_width, video_height, ozone->fonts.entries_sublabel);
}
static void ozone_draw_no_thumbnail_available(ozone_handle_t *ozone,
@ -686,8 +690,10 @@ static void ozone_draw_no_thumbnail_available(ozone_handle_t *ozone,
unsigned sidebar_width,
unsigned y_offset)
{
unsigned icon = OZONE_ENTRIES_ICONS_TEXTURE_CORE_INFO;
unsigned icon_size = (unsigned)((float)ozone->dimensions.sidebar_entry_icon_size * 1.5f);
unsigned icon = OZONE_ENTRIES_ICONS_TEXTURE_CORE_INFO;
unsigned icon_size = (unsigned)((float)ozone->dimensions.sidebar_entry_icon_size * 1.5f);
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
gfx_display_blend_begin(video_info);
ozone_draw_icon(video_info,
@ -695,9 +701,9 @@ static void ozone_draw_no_thumbnail_available(ozone_handle_t *ozone,
icon_size,
ozone->icons_textures[icon],
x_position + sidebar_width/2 - icon_size/2,
video_info->height / 2 - icon_size/2 - y_offset,
video_info->width,
video_info->height,
video_height / 2 - icon_size/2 - y_offset,
video_width,
video_height,
0, 1, ozone->theme->entries_icon);
gfx_display_blend_end(video_info);
@ -705,9 +711,9 @@ static void ozone_draw_no_thumbnail_available(ozone_handle_t *ozone,
ozone,
msg_hash_to_str(MSG_NO_THUMBNAIL_AVAILABLE),
x_position + sidebar_width/2,
video_info->height / 2 - icon_size/2 + ozone->footer_font_glyph_height * 4 - y_offset,
video_height / 2 - icon_size/2 + ozone->footer_font_glyph_height * 4 - y_offset,
TEXT_ALIGN_CENTER,
video_info->width, video_info->height,
video_width, video_height,
ozone->fonts.footer,
ozone->theme->text_rgba,
true
@ -717,12 +723,15 @@ static void ozone_draw_no_thumbnail_available(ozone_handle_t *ozone,
static void ozone_content_metadata_line(video_frame_info_t *video_info, ozone_handle_t *ozone,
unsigned *y, unsigned column_x, const char *text, unsigned lines_count)
{
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
ozone_draw_text(video_info, ozone,
text,
column_x,
*y + ozone->footer_font_glyph_height,
TEXT_ALIGN_LEFT,
video_info->width, video_info->height,
video_width, video_height,
ozone->fonts.footer,
ozone->theme->text_rgba,
true
@ -734,24 +743,27 @@ static void ozone_content_metadata_line(video_frame_info_t *video_info, ozone_ha
void ozone_draw_thumbnail_bar(ozone_handle_t *ozone, video_frame_info_t *video_info)
{
unsigned sidebar_height = video_info->height - ozone->dimensions.header_height - ozone->dimensions.sidebar_gradient_height * 2 - ozone->dimensions.footer_height;
unsigned sidebar_width = ozone->dimensions.thumbnail_bar_width;
unsigned x_position = video_info->width - (unsigned) ozone->animations.thumbnail_bar_position;
unsigned thumbnail_width = sidebar_width - (ozone->dimensions.sidebar_entry_icon_padding * 2);
unsigned thumbnail_height = (video_info->height - ozone->dimensions.header_height - ozone->dimensions.spacer_2px - ozone->dimensions.footer_height - (ozone->dimensions.sidebar_entry_icon_padding * 3)) / 2;
int thumbnail_x_position = x_position + ozone->dimensions.sidebar_entry_icon_padding;
int right_thumbnail_y_position = 0;
int left_thumbnail_y_position = 0;
bool show_right_thumbnail;
bool show_left_thumbnail;
bool show_right_thumbnail = false;
bool show_left_thumbnail = false;
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
bool libretro_running = video_info->libretro_running;
float menu_framebuffer_opacity = video_info->menu_framebuffer_opacity;
unsigned sidebar_height = video_height - ozone->dimensions.header_height - ozone->dimensions.sidebar_gradient_height * 2 - ozone->dimensions.footer_height;
unsigned x_position = video_width - (unsigned) ozone->animations.thumbnail_bar_position;
int thumbnail_x_position = x_position + ozone->dimensions.sidebar_entry_icon_padding;
unsigned thumbnail_height = (video_height - ozone->dimensions.header_height - ozone->dimensions.spacer_2px - ozone->dimensions.footer_height - (ozone->dimensions.sidebar_entry_icon_padding * 3)) / 2;
/* Background */
if (!video_info->libretro_running || (video_info->menu_framebuffer_opacity >= 1.0f))
if (!libretro_running || (menu_framebuffer_opacity >= 1.0f))
{
gfx_display_draw_quad(video_info, x_position, ozone->dimensions.header_height + ozone->dimensions.spacer_1px, (unsigned) ozone->animations.thumbnail_bar_position, ozone->dimensions.sidebar_gradient_height, video_info->width, video_info->height, ozone->theme->sidebar_top_gradient);
gfx_display_draw_quad(video_info, x_position, ozone->dimensions.header_height + ozone->dimensions.spacer_1px + ozone->dimensions.sidebar_gradient_height, (unsigned) ozone->animations.thumbnail_bar_position, sidebar_height, video_info->width, video_info->height, ozone->theme->sidebar_background);
gfx_display_draw_quad(video_info, x_position, video_info->height - ozone->dimensions.footer_height - ozone->dimensions.sidebar_gradient_height - ozone->dimensions.spacer_1px, (unsigned) ozone->animations.thumbnail_bar_position, ozone->dimensions.sidebar_gradient_height + ozone->dimensions.spacer_1px, video_info->width, video_info->height, ozone->theme->sidebar_bottom_gradient);
gfx_display_draw_quad(video_info, x_position, ozone->dimensions.header_height + ozone->dimensions.spacer_1px, (unsigned) ozone->animations.thumbnail_bar_position, ozone->dimensions.sidebar_gradient_height, video_width, video_height, ozone->theme->sidebar_top_gradient);
gfx_display_draw_quad(video_info, x_position, ozone->dimensions.header_height + ozone->dimensions.spacer_1px + ozone->dimensions.sidebar_gradient_height, (unsigned) ozone->animations.thumbnail_bar_position, sidebar_height, video_width, video_height, ozone->theme->sidebar_background);
gfx_display_draw_quad(video_info, x_position, video_height - ozone->dimensions.footer_height - ozone->dimensions.sidebar_gradient_height - ozone->dimensions.spacer_1px, (unsigned) ozone->animations.thumbnail_bar_position, ozone->dimensions.sidebar_gradient_height + ozone->dimensions.spacer_1px, video_width, video_height, ozone->theme->sidebar_bottom_gradient);
}
/* Thumbnails */
@ -886,7 +898,7 @@ void ozone_draw_thumbnail_bar(ozone_handle_t *ozone, video_frame_info_t *video_i
gfx_display_draw_quad(video_info,
x_position + separator_padding, y,
sidebar_width - separator_padding*2, ozone->dimensions.spacer_1px,
video_info->width, video_info->height,
video_width, video_height,
ozone->theme_dynamic.entries_border);
y += 18;

View File

@ -107,7 +107,8 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
{
size_t y;
int entry_width;
unsigned i, sidebar_height, selection_y, selection_old_y, horizontal_list_size;
unsigned i, sidebar_height, selection_y,
selection_old_y, horizontal_list_size;
char console_title[255];
gfx_animation_ctx_ticker_t ticker;
gfx_animation_ctx_ticker_smooth_t ticker_smooth;
@ -119,6 +120,10 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
float scale_factor = ozone->last_scale_factor;
enum gfx_animation_ticker_type
menu_ticker_type = (enum gfx_animation_ticker_type)settings->uints.menu_ticker_type;
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
bool libretro_running = video_info->libretro_running;
float menu_framebuffer_opacity = video_info->menu_framebuffer_opacity;
/* Initial ticker configuration */
if (use_smooth_ticker)
@ -148,16 +153,16 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
if (ozone->horizontal_list)
horizontal_list_size = (unsigned)ozone->horizontal_list->size;
gfx_display_scissor_begin(video_info, 0, ozone->dimensions.header_height + ozone->dimensions.spacer_1px, (unsigned) ozone->dimensions.sidebar_width, video_info->height - ozone->dimensions.header_height - ozone->dimensions.footer_height - ozone->dimensions.spacer_1px);
gfx_display_scissor_begin(video_info, 0, ozone->dimensions.header_height + ozone->dimensions.spacer_1px, (unsigned) ozone->dimensions.sidebar_width, video_height - ozone->dimensions.header_height - ozone->dimensions.footer_height - ozone->dimensions.spacer_1px);
/* Background */
sidebar_height = video_info->height - ozone->dimensions.header_height - ozone->dimensions.sidebar_gradient_height * 2 - ozone->dimensions.footer_height;
sidebar_height = video_height - ozone->dimensions.header_height - ozone->dimensions.sidebar_gradient_height * 2 - ozone->dimensions.footer_height;
if (!video_info->libretro_running || (video_info->menu_framebuffer_opacity >= 1.0f))
if (!libretro_running || (menu_framebuffer_opacity >= 1.0f))
{
gfx_display_draw_quad(video_info, ozone->sidebar_offset, ozone->dimensions.header_height + ozone->dimensions.spacer_1px, (unsigned) ozone->dimensions.sidebar_width, ozone->dimensions.sidebar_gradient_height, video_info->width, video_info->height, ozone->theme->sidebar_top_gradient);
gfx_display_draw_quad(video_info, ozone->sidebar_offset, ozone->dimensions.header_height + ozone->dimensions.spacer_1px + ozone->dimensions.sidebar_gradient_height, (unsigned) ozone->dimensions.sidebar_width, sidebar_height, video_info->width, video_info->height, ozone->theme->sidebar_background);
gfx_display_draw_quad(video_info, ozone->sidebar_offset, video_info->height - ozone->dimensions.footer_height - ozone->dimensions.sidebar_gradient_height - ozone->dimensions.spacer_1px, (unsigned) ozone->dimensions.sidebar_width, ozone->dimensions.sidebar_gradient_height + ozone->dimensions.spacer_1px, video_info->width, video_info->height, ozone->theme->sidebar_bottom_gradient);
gfx_display_draw_quad(video_info, ozone->sidebar_offset, ozone->dimensions.header_height + ozone->dimensions.spacer_1px, (unsigned) ozone->dimensions.sidebar_width, ozone->dimensions.sidebar_gradient_height, video_width, video_height, ozone->theme->sidebar_top_gradient);
gfx_display_draw_quad(video_info, ozone->sidebar_offset, ozone->dimensions.header_height + ozone->dimensions.spacer_1px + ozone->dimensions.sidebar_gradient_height, (unsigned) ozone->dimensions.sidebar_width, sidebar_height, video_width, video_height, ozone->theme->sidebar_background);
gfx_display_draw_quad(video_info, ozone->sidebar_offset, video_height - ozone->dimensions.footer_height - ozone->dimensions.sidebar_gradient_height - ozone->dimensions.spacer_1px, (unsigned) ozone->dimensions.sidebar_width, ozone->dimensions.sidebar_gradient_height + ozone->dimensions.spacer_1px, video_width, video_height, ozone->theme->sidebar_bottom_gradient);
}
/* Tabs */
@ -209,7 +214,7 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
/* Icon */
ozone_draw_icon(video_info, ozone->dimensions.sidebar_entry_icon_size, ozone->dimensions.sidebar_entry_icon_size,
ozone->tab_textures[icon], ozone->sidebar_offset + ozone->dimensions.sidebar_padding_horizontal + ozone->dimensions.sidebar_entry_icon_padding,
y + ozone->dimensions.sidebar_entry_height / 2 - ozone->dimensions.sidebar_entry_icon_size / 2 + ozone->animations.scroll_y_sidebar, video_info->width, video_info->height, 0, 1, (selected ? ozone->theme->text_selected : ozone->theme->entries_icon));
y + ozone->dimensions.sidebar_entry_height / 2 - ozone->dimensions.sidebar_entry_icon_size / 2 + ozone->animations.scroll_y_sidebar, video_width, video_height, 0, 1, (selected ? ozone->theme->text_selected : ozone->theme->entries_icon));
value_idx = ozone_system_tabs_value[ozone->tabs[i]];
title = msg_hash_to_str(value_idx);
@ -217,7 +222,7 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
/* Text */
if (!ozone->sidebar_collapsed)
ozone_draw_text(video_info, ozone, title, ozone->sidebar_offset + ozone->dimensions.sidebar_padding_horizontal + ozone->dimensions.sidebar_entry_icon_padding * 2 + ozone->dimensions.sidebar_entry_icon_size,
y + ozone->dimensions.sidebar_entry_height / 2 + ozone->sidebar_font_glyph_height * 3.0f/10.0f + ozone->animations.scroll_y_sidebar, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.sidebar, text_color, true);
y + ozone->dimensions.sidebar_entry_height / 2 + ozone->sidebar_font_glyph_height * 3.0f/10.0f + ozone->animations.scroll_y_sidebar, TEXT_ALIGN_LEFT, video_width, video_height, ozone->fonts.sidebar, text_color, true);
y += ozone->dimensions.sidebar_entry_height + ozone->dimensions.sidebar_entry_padding_vertical;
}
@ -227,7 +232,7 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
/* Console tabs */
if (horizontal_list_size > 0)
{
gfx_display_draw_quad(video_info, ozone->sidebar_offset + ozone->dimensions.sidebar_padding_horizontal, y + ozone->animations.scroll_y_sidebar, entry_width, ozone->dimensions.spacer_1px, video_info->width, video_info->height, ozone->theme->entries_border);
gfx_display_draw_quad(video_info, ozone->sidebar_offset + ozone->dimensions.sidebar_padding_horizontal, y + ozone->animations.scroll_y_sidebar, entry_width, ozone->dimensions.spacer_1px, video_width, video_height, ozone->theme->entries_border);
y += ozone->dimensions.sidebar_entry_padding_vertical + ozone->dimensions.spacer_1px;
@ -247,7 +252,7 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
/* Icon */
ozone_draw_icon(video_info, ozone->dimensions.sidebar_entry_icon_size, ozone->dimensions.sidebar_entry_icon_size,
node->icon, ozone->sidebar_offset + ozone->dimensions.sidebar_padding_horizontal + ozone->dimensions.sidebar_entry_icon_padding,
y + ozone->dimensions.sidebar_entry_height / 2 - ozone->dimensions.sidebar_entry_icon_size / 2 + ozone->animations.scroll_y_sidebar, video_info->width, video_info->height, 0, 1, (selected ? ozone->theme->text_selected : ozone->theme->entries_icon));
y + ozone->dimensions.sidebar_entry_height / 2 - ozone->dimensions.sidebar_entry_icon_size / 2 + ozone->animations.scroll_y_sidebar, video_width, video_height, 0, 1, (selected ? ozone->theme->text_selected : ozone->theme->entries_icon));
/* Text */
if (ozone->sidebar_collapsed)
@ -279,7 +284,7 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
ozone_draw_text(video_info, ozone, console_title, ticker_x_offset + ozone->sidebar_offset + ozone->dimensions.sidebar_padding_horizontal + ozone->dimensions.sidebar_entry_icon_padding * 2 + ozone->dimensions.sidebar_entry_icon_size,
y + ozone->dimensions.sidebar_entry_height / 2 + ozone->sidebar_font_glyph_height * 3.0f/10.0f + ozone->animations.scroll_y_sidebar, TEXT_ALIGN_LEFT,
video_info->width, video_info->height, ozone->fonts.sidebar, text_color, true);
video_width, video_height, ozone->fonts.sidebar, text_color, true);
console_iterate:
y += ozone->dimensions.sidebar_entry_height + ozone->dimensions.sidebar_entry_padding_vertical;
@ -288,7 +293,7 @@ console_iterate:
gfx_display_blend_end(video_info);
}
font_driver_flush(video_info->width, video_info->height, ozone->fonts.sidebar);
font_driver_flush(video_width, video_height, ozone->fonts.sidebar);
ozone->raster_blocks.sidebar.carr.coords.vertices = 0;
gfx_display_scissor_end(video_info);

View File

@ -874,8 +874,8 @@ static void xmb_render_messagebox_internal(
unsigned i, y_position;
int x, y, longest = 0, longest_width = 0;
float line_height = 0;
unsigned width = video_info->width;
unsigned height = video_info->height;
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
struct string_list *list = !string_is_empty(message)
? string_split(message, "\n") : NULL;
@ -891,11 +891,11 @@ static void xmb_render_messagebox_internal(
line_height = xmb->font->size * 1.2;
y_position = height / 2;
y_position = video_height / 2;
if (menu_input_dialog_get_display_kb())
y_position = height / 4;
y_position = video_height / 4;
x = width / 2;
x = video_width / 2;
y = y_position - (list->size-1) * line_height / 2;
/* find the longest line width */
@ -921,7 +921,7 @@ static void xmb_render_messagebox_internal(
256, 256,
longest_width + xmb->margins_dialog * 2,
line_height * list->size + xmb->margins_dialog * 2,
width, height,
video_width, video_height,
NULL,
xmb->margins_slice, 1.0,
xmb->textures.list[XMB_TEXTURE_DIALOG_SLICE]);
@ -934,7 +934,8 @@ static void xmb_render_messagebox_internal(
gfx_display_draw_text(xmb->font, msg,
x - longest_width/2.0,
y + (i+0.75) * line_height,
width, height, 0x444444ff, TEXT_ALIGN_LEFT, 1.0f, false, 0, false);
video_width, video_height, 0x444444ff,
TEXT_ALIGN_LEFT, 1.0f, false, 0, false);
}
if (menu_input_dialog_get_display_kb())
@ -3612,7 +3613,9 @@ static void xmb_draw_bg(
{
gfx_display_ctx_draw_t draw;
bool running = video_info->libretro_running;
bool libretro_running = video_info->libretro_running;
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
draw.x = 0;
draw.y = 0;
@ -3628,7 +3631,7 @@ static void xmb_draw_bg(
draw.pipeline.active = xmb_shader_pipeline_active(video_info);
gfx_display_blend_begin(video_info);
gfx_display_set_viewport(video_info->width, video_info->height);
gfx_display_set_viewport(video_width, video_height);
#ifdef HAVE_SHADERPIPELINE
if (video_info->menu_shader_pipeline > XMB_SHADER_PIPELINE_WALLPAPER
@ -3637,7 +3640,7 @@ static void xmb_draw_bg(
{
draw.color = xmb_gradient_ident(video_info);
if (running)
if (libretro_running)
gfx_display_set_alpha(draw.color, coord_black[3]);
else
gfx_display_set_alpha(draw.color, coord_white[3]);
@ -3677,7 +3680,7 @@ static void xmb_draw_bg(
if (video_info->xmb_color_theme != XMB_THEME_WALLPAPER)
draw.color = xmb_gradient_ident(video_info);
if (running)
if (libretro_running)
gfx_display_set_alpha(draw.color, coord_black[3]);
else
gfx_display_set_alpha(draw.color, coord_white[3]);
@ -3695,7 +3698,7 @@ static void xmb_draw_bg(
if (draw.texture)
draw.color = &coord_white[0];
if (running || video_info->xmb_color_theme == XMB_THEME_WALLPAPER)
if (libretro_running || video_info->xmb_color_theme == XMB_THEME_WALLPAPER)
add_opacity = true;
gfx_display_draw_bg(&draw, video_info, add_opacity, override_opacity);
@ -3883,13 +3886,16 @@ static void xmb_draw_fullscreen_thumbnails(
xmb_handle_t *xmb, video_frame_info_t *video_info,
settings_t *settings, size_t selection)
{
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
/* Check whether fullscreen thumbnails are visible */
if (xmb->fullscreen_thumbnail_alpha > 0.0f)
{
gfx_thumbnail_t *right_thumbnail = NULL;
gfx_thumbnail_t *left_thumbnail = NULL;
int view_width = (int)video_info->width;
int view_height = (int)video_info->height;
int view_width = (int)video_width;
int view_height = (int)video_height;
int thumbnail_margin = (int)(xmb->icon_size / 2.0f);
bool show_right_thumbnail = false;
bool show_left_thumbnail = false;
@ -4299,6 +4305,8 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
bool menu_core_enable = settings->bools.menu_core_enable;
float thumbnail_scale_factor = (float)settings->uints.menu_xmb_thumbnail_scale_factor / 100.0f;
bool menu_xmb_vertical_thumbnails = settings->bools.menu_xmb_vertical_thumbnails;
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
if (!xmb)
return;
@ -4825,10 +4833,10 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
width,
height);
font_driver_flush(video_info->width, video_info->height, xmb->font);
font_driver_flush(video_width, video_height, xmb->font);
font_driver_bind_block(xmb->font, NULL);
font_driver_flush(video_info->width, video_info->height, xmb->font2);
font_driver_flush(video_width, video_height, xmb->font2);
font_driver_bind_block(xmb->font2, NULL);
/* Draw fullscreen thumbnails, if required */
@ -4878,7 +4886,7 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
height);
}
gfx_display_unset_viewport(video_info->width, video_info->height);
gfx_display_unset_viewport(video_width, video_height);
}
static void xmb_layout_ps3(xmb_handle_t *xmb, int width)