1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-08 20:25:47 +00:00

(ozone) reorder structs, alignment

This commit is contained in:
twinaphex 2020-08-24 10:47:17 +02:00
parent 7a6b9fd1b2
commit e4f99dc648
6 changed files with 171 additions and 159 deletions

View File

@ -16,6 +16,7 @@ For POD-types, try to order structs as follows (first to last):
* jmp_buf (4 bytes)
* long (4 bytes [64bit Win], 8 bytes [64bit non-Win], 4 bytes [32bit])
* int32_t (4 bytes)
* unsigned (4 bytes)
* float (4 bytes)
* int (4 bytes)
* enum (4 bytes)

View File

@ -607,7 +607,7 @@ static void *ozone_init(void **userdata, bool video_is_threaded)
ozone->animations.thumbnail_bar_position = 0.0f;
ozone->show_thumbnail_bar = false;
ozone->dimensions.sidebar_width = 0.0f;
ozone->dimensions_sidebar_width = 0.0f;
ozone->num_search_terms_old = 0;
@ -952,7 +952,7 @@ static void ozone_cache_footer_labels(ozone_handle_t *ozone)
MSG_TOGGLE_CONTENT_METADATA);
/* Record current language setting */
ozone->footer_labels.lanuage = *msg_hash_get_uint(MSG_HASH_USER_LANGUAGE);
ozone->footer_labels_language = *msg_hash_get_uint(MSG_HASH_USER_LANGUAGE);
}
/* Determines the size of all menu elements */
@ -996,8 +996,8 @@ static void ozone_set_layout(ozone_handle_t *ozone, bool is_threaded)
ozone->dimensions.sidebar_entry_icon_padding * 2 +
ozone->dimensions.sidebar_padding_horizontal * 2;
if (ozone->dimensions.sidebar_width == 0)
ozone->dimensions.sidebar_width = (float)ozone->dimensions.sidebar_width_normal;
if (ozone->dimensions_sidebar_width == 0)
ozone->dimensions_sidebar_width = (float)ozone->dimensions.sidebar_width_normal;
ozone->dimensions.thumbnail_bar_width =
ozone->dimensions.sidebar_width_normal -
@ -1601,9 +1601,9 @@ static void ozone_render(void *data,
/* Check whether menu language has changed
* > If so, need to re-cache footer text labels */
if (ozone->footer_labels.lanuage != language)
if (ozone->footer_labels_language != language)
{
ozone->footer_labels.lanuage = language;
ozone->footer_labels_language = language;
ozone_cache_footer_labels(ozone);
}
@ -1666,9 +1666,9 @@ static void ozone_render(void *data,
int entry_padding = (ozone->depth == 1) ?
ozone->dimensions.entry_padding_horizontal_half :
ozone->dimensions.entry_padding_horizontal_full;
float entry_x = ozone->dimensions.sidebar_width +
float entry_x = ozone->dimensions_sidebar_width +
ozone->sidebar_offset + entry_padding;
float entry_width = width - ozone->dimensions.sidebar_width -
float entry_width = width - ozone->dimensions_sidebar_width -
ozone->sidebar_offset - entry_padding * 2 -
ozone->animations.thumbnail_bar_position;
bool first_entry_found = false;
@ -1700,7 +1700,8 @@ static void ozone_render(void *data,
if ((ozone->pointer.type == MENU_POINTER_MOUSE) ||
ozone->pointer.pressed)
ozone->pointer_in_sidebar = ozone->draw_sidebar &&
(ozone->pointer.x < ozone->dimensions.sidebar_width + ozone->sidebar_offset);
(ozone->pointer.x < ozone->dimensions_sidebar_width
+ ozone->sidebar_offset);
/* If pointer has switched from entries to sidebar
* or vice versa, must reset pointer acceleration */
@ -2698,9 +2699,10 @@ static void ozone_frame(void *data, video_frame_info_t *video_info)
gfx_display_scissor_begin(userdata,
video_width,
video_height,
ozone->sidebar_offset + (unsigned) ozone->dimensions.sidebar_width,
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_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 */
@ -2928,13 +2930,13 @@ static void ozone_list_open(ozone_handle_t *ozone)
{
struct gfx_animation_ctx_entry entry;
entry.cb = ozone_collapse_end;
entry.duration = ANIMATION_PUSH_ENTRY_DURATION;
entry.easing_enum = EASING_OUT_QUAD;
entry.subject = &ozone->sidebar_offset;
entry.tag = sidebar_tag;
entry.target_value = -ozone->dimensions.sidebar_width;
entry.userdata = (void*) ozone;
entry.cb = ozone_collapse_end;
entry.duration = ANIMATION_PUSH_ENTRY_DURATION;
entry.easing_enum = EASING_OUT_QUAD;
entry.subject = &ozone->sidebar_offset;
entry.tag = sidebar_tag;
entry.target_value = -ozone->dimensions_sidebar_width;
entry.userdata = (void*)ozone;
gfx_animation_push(&entry);
}
@ -3402,7 +3404,8 @@ static int ozone_pointer_up(void *userdata,
return ozone_menu_entry_action(ozone, entry, selection, MENU_ACTION_CANCEL);
/* Tap/press entries: Activate and/or select item */
else if ((ptr < entries_end) &&
(x > ozone->dimensions.sidebar_width + ozone->sidebar_offset) &&
(x > ozone->dimensions_sidebar_width
+ ozone->sidebar_offset) &&
(x < width - ozone->animations.thumbnail_bar_position))
{
if (gesture == MENU_INPUT_GESTURE_TAP)
@ -3490,7 +3493,7 @@ static int ozone_pointer_up(void *userdata,
(y < height - ozone->dimensions.footer_height) &&
(ptr < entries_end) &&
(ptr == selection) &&
(x > ozone->dimensions.sidebar_width + ozone->sidebar_offset) &&
(x > ozone->dimensions_sidebar_width + ozone->sidebar_offset) &&
(x < width - ozone->animations.thumbnail_bar_position))
return menu_entry_action(entry, selection, MENU_ACTION_START);
break;

View File

@ -92,7 +92,7 @@ enum ozone_onscreen_entry_position_type
typedef struct
{
font_data_t *font;
video_font_raster_block_t raster_block;
video_font_raster_block_t raster_block; /* ptr alignment */
int glyph_width;
int line_height;
int line_ascender;
@ -108,6 +108,14 @@ typedef struct
struct ozone_handle
{
menu_input_pointer_t pointer; /* retro_time_t alignment */
ozone_theme_t *theme;
gfx_thumbnail_path_data_t *thumbnail_path_data;
file_list_t *selection_buf_old;
char *pending_message;
file_list_t horizontal_list; /* console tabs */ /* ptr alignment */
struct
{
ozone_font_data_t footer;
@ -120,7 +128,6 @@ struct ozone_handle
struct
{
unsigned lanuage;
ozone_footer_label_t ok;
ozone_footer_label_t back;
ozone_footer_label_t search;
@ -128,101 +135,33 @@ struct ozone_handle
ozone_footer_label_t metadata_toggle;
} footer_labels;
struct
{
gfx_thumbnail_t right; /* uintptr_t alignment */
gfx_thumbnail_t left; /* uintptr_t alignment */
} thumbnails;
uintptr_t textures[OZONE_THEME_TEXTURE_LAST];
uintptr_t icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_LAST];
uintptr_t tab_textures[OZONE_TAB_TEXTURE_LAST];
char title[PATH_MAX_LENGTH];
char assets_path[PATH_MAX_LENGTH];
char png_path[PATH_MAX_LENGTH];
char icons_path[PATH_MAX_LENGTH];
char tab_path[PATH_MAX_LENGTH];
uint8_t system_tab_end;
uint8_t tabs[OZONE_SYSTEM_TAB_LAST];
size_t categories_selection_ptr; /* active tab id */
size_t categories_active_idx_old;
bool cursor_in_sidebar;
bool cursor_in_sidebar_old;
struct
{
float cursor_alpha;
float scroll_y;
float scroll_y_sidebar;
float list_alpha;
float messagebox_alpha;
float sidebar_text_alpha;
float thumbnail_bar_position;
float fullscreen_thumbnail_alpha;
float left_thumbnail_alpha;
} animations;
bool fade_direction; /* false = left to right, true = right to left */
size_t selection; /* currently selected entry */
size_t selection_old; /* previously selected entry (for fancy animation) */
size_t selection_old_list;
unsigned entries_height;
size_t fullscreen_thumbnail_selection;
size_t num_search_terms_old;
size_t pointer_categories_selection;
size_t first_onscreen_entry;
size_t last_onscreen_entry;
size_t first_onscreen_category;
size_t last_onscreen_category;
int depth;
bool draw_sidebar;
float sidebar_offset;
ozone_theme_t *theme;
struct {
float selection_border[16];
float selection[16];
float entries_border[16];
float entries_icon[16];
float entries_checkmark[16];
float cursor_alpha[16];
unsigned cursor_state; /* 0 -> 1 -> 0 -> 1 [...] */
float cursor_border[16];
float message_background[16];
} theme_dynamic;
unsigned last_width;
unsigned last_height;
float last_scale_factor;
bool need_compute;
file_list_t *selection_buf_old;
bool draw_old_list;
float scroll_old;
char *pending_message;
bool has_all_assets;
bool is_playlist;
bool is_playlist_old;
size_t num_search_terms_old;
bool empty_playlist;
bool osk_cursor; /* true = display it, false = don't */
bool messagebox_state;
bool messagebox_state_old;
bool should_draw_messagebox;
unsigned old_list_offset_y;
file_list_t horizontal_list; /* console tabs */ /* ptr alignment */
struct {
struct
{
int header_height;
int footer_height;
@ -237,7 +176,6 @@ struct ozone_handle
int sidebar_width_normal;
int sidebar_width_collapsed;
float sidebar_width; /* animated field */
int sidebar_padding_horizontal;
int sidebar_padding_vertical;
int sidebar_entry_padding_vertical;
@ -257,44 +195,98 @@ struct ozone_handle
int spacer_5px;
} dimensions;
menu_input_pointer_t pointer;
unsigned footer_labels_language;
unsigned last_width;
unsigned last_height;
unsigned entries_height;
unsigned theme_dynamic_cursor_state; /* 0 -> 1 -> 0 -> 1 [...] */
unsigned selection_core_name_lines;
unsigned selection_lastplayed_lines;
unsigned old_list_offset_y;
float dimensions_sidebar_width; /* animated field */
float sidebar_offset;
float last_scale_factor;
struct
{
float cursor_alpha;
float scroll_y;
float scroll_y_sidebar;
float list_alpha;
float messagebox_alpha;
float sidebar_text_alpha;
float thumbnail_bar_position;
float fullscreen_thumbnail_alpha;
float left_thumbnail_alpha;
} animations;
struct
{
float selection_border[16];
float selection[16];
float entries_border[16];
float entries_icon[16];
float entries_checkmark[16];
float cursor_alpha[16];
float cursor_border[16];
float message_background[16];
} theme_dynamic;
float scroll_old;
int16_t pointer_active_delta;
bool pointer_in_sidebar;
bool last_pointer_in_sidebar;
size_t pointer_categories_selection;
size_t first_onscreen_entry;
size_t last_onscreen_entry;
size_t first_onscreen_category;
size_t last_onscreen_category;
bool show_cursor;
bool cursor_mode;
int16_t cursor_x_old;
int16_t cursor_y_old;
bool sidebar_collapsed;
uint8_t system_tab_end;
uint8_t tabs[OZONE_SYSTEM_TAB_LAST];
/* Thumbnails data */
bool show_thumbnail_bar;
char title[PATH_MAX_LENGTH];
gfx_thumbnail_path_data_t *thumbnail_path_data;
struct {
gfx_thumbnail_t right;
gfx_thumbnail_t left;
} thumbnails;
bool fullscreen_thumbnails_available;
bool show_fullscreen_thumbnails;
size_t fullscreen_thumbnail_selection;
char assets_path[PATH_MAX_LENGTH];
char png_path[PATH_MAX_LENGTH];
char icons_path[PATH_MAX_LENGTH];
char tab_path[PATH_MAX_LENGTH];
char fullscreen_thumbnail_label[255];
char selection_core_name[255];
char selection_playtime[255];
char selection_lastplayed[255];
unsigned selection_core_name_lines;
unsigned selection_lastplayed_lines;
bool cursor_in_sidebar;
bool cursor_in_sidebar_old;
bool fade_direction; /* false = left to right, true = right to left */
bool draw_sidebar;
bool empty_playlist;
bool osk_cursor; /* true = display it, false = don't */
bool messagebox_state;
bool messagebox_state_old;
bool should_draw_messagebox;
bool need_compute;
bool draw_old_list;
bool has_all_assets;
bool is_playlist;
bool is_playlist_old;
bool pointer_in_sidebar;
bool last_pointer_in_sidebar;
bool show_cursor;
bool cursor_mode;
bool sidebar_collapsed;
bool show_thumbnail_bar;
bool fullscreen_thumbnails_available;
bool show_fullscreen_thumbnails;
bool selection_core_is_viewer;
bool force_metadata_display;

View File

@ -79,7 +79,7 @@ static void ozone_cursor_animation_cb(void *userdata)
float *target = NULL;
switch (ozone->theme_dynamic.cursor_state)
switch (ozone->theme_dynamic_cursor_state)
{
case 0:
target = ozone->theme->cursor_border_1;
@ -89,7 +89,7 @@ static void ozone_cursor_animation_cb(void *userdata)
break;
}
ozone->theme_dynamic.cursor_state = (ozone->theme_dynamic.cursor_state + 1) % 2;
ozone->theme_dynamic_cursor_state = (ozone->theme_dynamic_cursor_state + 1) % 2;
ozone_animate_cursor(ozone, ozone->theme_dynamic.cursor_border, target);
}
@ -238,7 +238,7 @@ void ozone_restart_cursor_animation(ozone_handle_t *ozone)
if (!ozone->has_all_assets)
return;
ozone->theme_dynamic.cursor_state = 1;
ozone->theme_dynamic_cursor_state = 1;
memcpy(ozone->theme_dynamic.cursor_border, ozone->theme->cursor_border_0, sizeof(ozone->theme_dynamic.cursor_border));
gfx_animation_kill_by_tag(&tag);

View File

@ -357,7 +357,7 @@ void ozone_compute_entries_position(ozone_handle_t *ozone)
if (ozone->depth == 1)
{
sublabel_max_width -= (unsigned) ozone->dimensions.sidebar_width;
sublabel_max_width -= (unsigned) ozone->dimensions_sidebar_width;
if (ozone->show_thumbnail_bar)
sublabel_max_width -= ozone->dimensions.thumbnail_bar_width;
@ -471,7 +471,7 @@ void ozone_draw_entries(
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_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);
@ -520,7 +520,8 @@ void ozone_draw_entries(
else if (y + scroll_y - node->height - 20 * scale_factor > bottom_boundary)
goto border_iterate;
border_start_x = (unsigned) ozone->dimensions.sidebar_width + x_offset + entry_padding;
border_start_x = (unsigned) ozone->dimensions_sidebar_width
+ x_offset + entry_padding;
border_start_y = y + scroll_y;
gfx_display_set_alpha(ozone->theme_dynamic.entries_border, alpha);
@ -562,7 +563,8 @@ border_iterate:
userdata,
video_width,
video_height,
(unsigned) ozone->dimensions.sidebar_width + x_offset + entry_padding + ozone->dimensions.spacer_3px,
(unsigned) ozone->dimensions_sidebar_width
+ x_offset + entry_padding + ozone->dimensions.spacer_3px,
entry_width - ozone->dimensions.spacer_5px,
button_height + ozone->dimensions.spacer_1px,
selection_y + scroll_y,
@ -575,7 +577,8 @@ border_iterate:
userdata,
video_width,
video_height,
(unsigned)ozone->dimensions.sidebar_width + x_offset + entry_padding + ozone->dimensions.spacer_3px,
(unsigned)ozone->dimensions_sidebar_width
+ x_offset + entry_padding + ozone->dimensions.spacer_3px,
/* TODO/FIXME - undefined behavior reported by ASAN -
*-35.2358 is outside the range of representable values
of type 'unsigned int'
@ -687,7 +690,9 @@ border_iterate:
/* Note: This entry can never be selected, so ticker_x_offset
* is irrelevant here (i.e. this text will never scroll) */
unsigned text_width = font_driver_get_message_width(ozone->fonts.entries_label.font, rich_label, (unsigned)strlen(rich_label), 1);
x_offset = (video_info_width - (unsigned) ozone->dimensions.sidebar_width - entry_padding * 2) / 2 - text_width / 2 - 60 * scale_factor;
x_offset = (video_info_width - (unsigned)
ozone->dimensions_sidebar_width - entry_padding * 2)
/ 2 - text_width / 2 - 60 * scale_factor;
y = video_info_height / 2 - 60 * scale_factor;
}
@ -702,7 +707,8 @@ border_iterate:
if (ozone->depth == 1)
{
sublabel_max_width -= (unsigned) ozone->dimensions.sidebar_width;
sublabel_max_width -= (unsigned)
ozone->dimensions_sidebar_width;
if (ozone->show_thumbnail_bar)
sublabel_max_width -= ozone->dimensions.thumbnail_bar_width;
@ -750,8 +756,11 @@ border_iterate:
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,
(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_width,
video_height,
0,
@ -767,7 +776,10 @@ border_iterate:
/* Draw text */
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,
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.0f + ozone->fonts.entries_label.line_centre_offset + scroll_y,
TEXT_ALIGN_LEFT, video_width, video_height, &ozone->fonts.entries_label, COLOR_TEXT_ALPHA(ozone->theme->text_rgba, alpha_uint32), false);
@ -775,7 +787,9 @@ border_iterate:
{
if (!string_is_empty(sublabel_str))
ozone_draw_text(ozone, sublabel_str,
(unsigned) ozone->dimensions.sidebar_width + x_offset + entry_padding + ozone->dimensions.entry_icon_padding,
(unsigned) ozone->dimensions_sidebar_width +
x_offset + entry_padding +
ozone->dimensions.entry_icon_padding,
y + ozone->dimensions.entry_height - ozone->dimensions.spacer_1px + (node->height - ozone->dimensions.entry_height - (node->sublabel_lines * ozone->fonts.entries_sublabel.line_height))/2.0f + ozone->fonts.entries_sublabel.line_ascender + scroll_y,
TEXT_ALIGN_LEFT, video_width, video_height, &ozone->fonts.entries_sublabel, COLOR_TEXT_ALPHA(ozone->theme->text_sublabel_rgba, alpha_uint32), false);
}
@ -811,7 +825,9 @@ border_iterate:
video_width,
video_height,
entry_value_ticker,
value_x_offset + (unsigned) ozone->dimensions.sidebar_width + entry_padding + x_offset + entry_width - ozone->dimensions.entry_icon_padding,
value_x_offset + (unsigned) ozone->dimensions_sidebar_width
+ entry_padding + x_offset
+ entry_width - ozone->dimensions.entry_icon_padding,
y + ozone->dimensions.entry_height / 2 + ozone->fonts.entries_label.line_centre_offset + scroll_y,
alpha_uint32,
&entry);

View File

@ -213,7 +213,7 @@ void ozone_draw_sidebar(
video_width, video_height,
0,
ozone->dimensions.header_height + ozone->dimensions.spacer_1px,
(unsigned) ozone->dimensions.sidebar_width,
(unsigned) ozone->dimensions_sidebar_width,
video_height - ozone->dimensions.header_height - ozone->dimensions.footer_height - ozone->dimensions.spacer_1px);
/* Background */
@ -227,7 +227,7 @@ void ozone_draw_sidebar(
video_height,
ozone->sidebar_offset,
ozone->dimensions.header_height + ozone->dimensions.spacer_1px,
(unsigned)ozone->dimensions.sidebar_width,
(unsigned)ozone->dimensions_sidebar_width,
ozone->dimensions.sidebar_gradient_height,
video_width,
video_height,
@ -238,7 +238,7 @@ void ozone_draw_sidebar(
video_height,
ozone->sidebar_offset,
ozone->dimensions.header_height + ozone->dimensions.spacer_1px + ozone->dimensions.sidebar_gradient_height,
(unsigned)ozone->dimensions.sidebar_width,
(unsigned)ozone->dimensions_sidebar_width,
sidebar_height,
video_width,
video_height,
@ -249,7 +249,7 @@ void ozone_draw_sidebar(
video_height,
ozone->sidebar_offset,
video_height - ozone->dimensions.footer_height - ozone->dimensions.sidebar_gradient_height - ozone->dimensions.spacer_1px,
(unsigned)ozone->dimensions.sidebar_width,
(unsigned)ozone->dimensions_sidebar_width,
ozone->dimensions.sidebar_gradient_height + ozone->dimensions.spacer_1px,
video_width,
video_height,
@ -278,7 +278,7 @@ void ozone_draw_sidebar(
y += ozone->dimensions.sidebar_entry_height + ozone->dimensions.sidebar_entry_padding_vertical;
}
entry_width = (unsigned) ozone->dimensions.sidebar_width - ozone->dimensions.sidebar_padding_horizontal * 2;
entry_width = (unsigned) ozone->dimensions_sidebar_width - ozone->dimensions.sidebar_padding_horizontal * 2;
/* Cursor */
if (ozone->cursor_in_sidebar)
@ -538,7 +538,7 @@ void ozone_sidebar_update_collapse(ozone_handle_t *ozone, bool allow_animation)
gfx_animation_push(&entry);
/* Collapse */
entry.subject = &ozone->dimensions.sidebar_width;
entry.subject = &ozone->dimensions_sidebar_width;
entry.target_value = ozone->dimensions.sidebar_width_collapsed;
gfx_animation_push(&entry);
@ -546,7 +546,7 @@ void ozone_sidebar_update_collapse(ozone_handle_t *ozone, bool allow_animation)
else
{
ozone->animations.sidebar_text_alpha = 0.0f;
ozone->dimensions.sidebar_width =
ozone->dimensions_sidebar_width =
ozone->dimensions.sidebar_width_collapsed;
ozone_sidebar_collapse_end(ozone);
}
@ -567,7 +567,7 @@ void ozone_sidebar_update_collapse(ozone_handle_t *ozone, bool allow_animation)
gfx_animation_push(&entry);
/* Collapse */
entry.subject = &ozone->dimensions.sidebar_width;
entry.subject = &ozone->dimensions_sidebar_width;
entry.target_value = ozone->dimensions.sidebar_width_normal;
gfx_animation_push(&entry);
@ -575,7 +575,7 @@ void ozone_sidebar_update_collapse(ozone_handle_t *ozone, bool allow_animation)
else
{
ozone->animations.sidebar_text_alpha = 1.0f;
ozone->dimensions.sidebar_width = ozone->dimensions.sidebar_width_normal;
ozone->dimensions_sidebar_width = ozone->dimensions.sidebar_width_normal;
ozone->sidebar_collapsed = false;
}
}
@ -657,13 +657,13 @@ void ozone_refresh_sidebars(ozone_handle_t *ozone, unsigned video_height)
if (collapse_sidebar || (is_playlist && !ozone->cursor_in_sidebar))
{
ozone->animations.sidebar_text_alpha = 0.0f;
ozone->dimensions.sidebar_width = ozone->dimensions.sidebar_width_collapsed;
ozone->dimensions_sidebar_width = ozone->dimensions.sidebar_width_collapsed;
ozone->sidebar_collapsed = true;
}
else if (ozone->cursor_in_sidebar || (!is_playlist && !collapse_sidebar))
{
ozone->animations.sidebar_text_alpha = 1.0f;
ozone->dimensions.sidebar_width = ozone->dimensions.sidebar_width_normal;
ozone->dimensions_sidebar_width = ozone->dimensions.sidebar_width_normal;
ozone->sidebar_collapsed = false;
}
@ -675,7 +675,7 @@ void ozone_refresh_sidebars(ozone_handle_t *ozone, unsigned video_height)
}
else if (ozone->depth > 1)
{
ozone->sidebar_offset = -ozone->dimensions.sidebar_width;
ozone->sidebar_offset = -ozone->dimensions_sidebar_width;
ozone->draw_sidebar = false;
}