mirror of
https://github.com/libretro/RetroArch
synced 2025-03-17 10:21:26 +00:00
(Ozone) Cleanups
This commit is contained in:
parent
a0446f778c
commit
d91800038d
@ -1549,7 +1549,7 @@ static void ozone_draw_header(ozone_handle_t *ozone, video_frame_info_t *video_i
|
||||
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_width, video_height, ozone->fonts.title, ozone->theme->text_rgba, false);
|
||||
ozone_draw_text(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->userdata);
|
||||
@ -1596,7 +1596,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_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);
|
||||
ozone_draw_text(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->userdata);
|
||||
ozone_draw_icon(
|
||||
@ -1627,7 +1627,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_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);
|
||||
ozone_draw_text(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->userdata);
|
||||
ozone_draw_icon(
|
||||
@ -1671,7 +1671,7 @@ static void ozone_draw_footer(ozone_handle_t *ozone, video_frame_info_t *video_i
|
||||
{
|
||||
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_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(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_height - ozone->dimensions.footer_height / 2 - 15 * scale_factor, video_width, video_height, 0, 1, NULL);
|
||||
@ -1714,23 +1714,23 @@ static void ozone_draw_footer(ozone_handle_t *ozone, video_frame_info_t *video_i
|
||||
|
||||
gfx_display_blend_end(video_info->userdata);
|
||||
|
||||
ozone_draw_text(video_info, ozone,
|
||||
ozone_draw_text(ozone,
|
||||
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_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,
|
||||
ozone_draw_text(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_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,
|
||||
ozone_draw_text(ozone,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SEARCH),
|
||||
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,
|
||||
ozone_draw_text(ozone,
|
||||
msg_hash_to_str(MSG_CHANGE_THUMBNAIL_TYPE),
|
||||
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);
|
||||
|
||||
|
@ -96,7 +96,6 @@ void ozone_restart_cursor_animation(ozone_handle_t *ozone)
|
||||
}
|
||||
|
||||
void ozone_draw_text(
|
||||
video_frame_info_t *video_info,
|
||||
ozone_handle_t *ozone,
|
||||
const char *str, float x,
|
||||
float y,
|
||||
@ -441,7 +440,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_width, video_height, ozone->fonts.entries_label, text_color, false);
|
||||
ozone_draw_text(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)
|
||||
@ -554,7 +553,7 @@ void ozone_draw_messagebox(ozone_handle_t *ozone,
|
||||
const char *msg = list->elems[i].data;
|
||||
|
||||
if (msg)
|
||||
ozone_draw_text(video_info, ozone,
|
||||
ozone_draw_text(ozone,
|
||||
msg,
|
||||
x - longest_width/2.0,
|
||||
y + (i + 1) * ozone->footer_font_glyph_height,
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include "../../menu_driver.h"
|
||||
|
||||
void ozone_draw_text(
|
||||
video_frame_info_t *video_info,
|
||||
ozone_handle_t *ozone,
|
||||
const char *str, float x,
|
||||
float y,
|
||||
|
@ -115,11 +115,11 @@ 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_width, video_height, ozone->fonts.entries_label, COLOR_TEXT_ALPHA(ozone->theme->text_selected_rgba, alpha_uint32), false);
|
||||
ozone_draw_text(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)),
|
||||
ozone_draw_text(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_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);
|
||||
}
|
||||
@ -653,13 +653,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,
|
||||
ozone_draw_text(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_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,
|
||||
ozone_draw_text(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_width, video_height, ozone->fonts.entries_sublabel, COLOR_TEXT_ALPHA(ozone->theme->text_sublabel_rgba, alpha_uint32), false);
|
||||
}
|
||||
|
||||
@ -727,7 +727,7 @@ static void ozone_draw_no_thumbnail_available(ozone_handle_t *ozone,
|
||||
0, 1, ozone->theme->entries_icon);
|
||||
gfx_display_blend_end(video_info->userdata);
|
||||
|
||||
ozone_draw_text(video_info,
|
||||
ozone_draw_text(
|
||||
ozone,
|
||||
msg_hash_to_str(MSG_NO_THUMBNAIL_AVAILABLE),
|
||||
x_position + sidebar_width/2,
|
||||
@ -746,7 +746,7 @@ static void ozone_content_metadata_line(video_frame_info_t *video_info, ozone_ha
|
||||
unsigned video_width = video_info->width;
|
||||
unsigned video_height = video_info->height;
|
||||
|
||||
ozone_draw_text(video_info, ozone,
|
||||
ozone_draw_text(ozone,
|
||||
text,
|
||||
column_x,
|
||||
*y + ozone->footer_font_glyph_height,
|
||||
|
@ -254,7 +254,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,
|
||||
ozone_draw_text(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_width, video_height, ozone->fonts.sidebar, text_color, true);
|
||||
|
||||
y += ozone->dimensions.sidebar_entry_height + ozone->dimensions.sidebar_entry_padding_vertical;
|
||||
@ -325,9 +325,9 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
|
||||
gfx_animation_ticker(&ticker);
|
||||
}
|
||||
|
||||
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_width, video_height, ozone->fonts.sidebar, text_color, true);
|
||||
ozone_draw_text(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_width, video_height, ozone->fonts.sidebar, text_color, true);
|
||||
|
||||
console_iterate:
|
||||
y += ozone->dimensions.sidebar_entry_height + ozone->dimensions.sidebar_entry_padding_vertical;
|
||||
|
Loading…
x
Reference in New Issue
Block a user