rgui_render - call menu_entries_get_size later in function

ozone_draw_entries - MENU_ENTRIES_CTL_START_GET was unnecessary to call
This commit is contained in:
twinaphex 2021-03-11 19:48:56 +01:00
parent e72cdd78d6
commit a6c11b5ed3
2 changed files with 34 additions and 34 deletions

View File

@ -479,9 +479,9 @@ void ozone_draw_entries(
bool is_playlist) bool is_playlist)
{ {
uint32_t alpha_uint32; uint32_t alpha_uint32;
size_t i, y, entries_end; size_t i;
float sidebar_offset, bottom_boundary, invert, alpha_anim; float bottom_boundary;
unsigned video_info_height, video_info_width, entry_width, button_height; unsigned video_info_height, video_info_width;
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
bool menu_show_sublabels = settings->bools.menu_show_sublabels; bool menu_show_sublabels = settings->bools.menu_show_sublabels;
bool use_smooth_ticker = settings->bools.menu_ticker_smooth; bool use_smooth_ticker = settings->bools.menu_ticker_smooth;
@ -497,29 +497,27 @@ void ozone_draw_entries(
gfx_display_t *p_disp = disp_get_ptr(); gfx_display_t *p_disp = disp_get_ptr();
gfx_display_ctx_driver_t *dispctx = p_disp->dispctx; gfx_display_ctx_driver_t *dispctx = p_disp->dispctx;
gfx_animation_t *p_anim = anim_get_ptr(); gfx_animation_t *p_anim = anim_get_ptr();
size_t entries_end = selection_buf ? selection_buf->size : 0;
menu_entries_ctl(MENU_ENTRIES_CTL_START_GET, &i); size_t y = ozone->dimensions.header_height + ozone->dimensions.spacer_1px + ozone->dimensions.entry_padding_vertical;
float sidebar_offset = ozone->sidebar_offset;
entries_end = selection_buf ? selection_buf->size : 0; unsigned entry_width = video_width - (unsigned) ozone->dimensions_sidebar_width - ozone->sidebar_offset - entry_padding * 2 - ozone->animations.thumbnail_bar_position;
y = ozone->dimensions.header_height + ozone->dimensions.spacer_1px + ozone->dimensions.entry_padding_vertical; unsigned button_height = ozone->dimensions.entry_height; /* height of the button (entry minus sublabel) */
sidebar_offset = ozone->sidebar_offset; float invert = (ozone->fade_direction) ? -1 : 1;
entry_width = video_width - (unsigned) ozone->dimensions_sidebar_width - ozone->sidebar_offset - entry_padding * 2 - ozone->animations.thumbnail_bar_position; float alpha_anim = old_list ? alpha : 1.0f - alpha;
button_height = ozone->dimensions.entry_height; /* height of the button (entry minus sublabel) */
video_driver_get_size(&video_info_width, &video_info_height); video_driver_get_size(&video_info_width, &video_info_height);
bottom_boundary = video_info_height - ozone->dimensions.header_height - ozone->dimensions.footer_height; bottom_boundary = video_info_height - ozone->dimensions.header_height - ozone->dimensions.footer_height;
invert = (ozone->fade_direction) ? -1 : 1;
alpha_anim = old_list ? alpha : 1.0f - alpha;
if (old_list) if (old_list)
alpha = 1.0f - alpha;
if (alpha != 1.0f)
{ {
if (old_list) alpha = 1.0f - alpha;
if (alpha != 1.0f)
x_offset += invert * -(alpha_anim * 120 * scale_factor); /* left */ x_offset += invert * -(alpha_anim * 120 * scale_factor); /* left */
}
else else
{
if (alpha != 1.0f)
x_offset += invert * (alpha_anim * 120 * scale_factor); /* right */ x_offset += invert * (alpha_anim * 120 * scale_factor); /* right */
} }

View File

@ -3937,7 +3937,7 @@ static void rgui_render(void *data,
ticker_spacer = RGUI_TICKER_SPACER; ticker_spacer = RGUI_TICKER_SPACER;
int bottom = 0; int bottom = 0;
unsigned ticker_x_offset = 0; unsigned ticker_x_offset = 0;
size_t entries_end = menu_entries_get_size(); size_t entries_end = 0;
bool msg_force = false; bool msg_force = false;
bool fb_size_changed = false; bool fb_size_changed = false;
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
@ -4032,6 +4032,8 @@ static void rgui_render(void *data,
rgui->force_redraw = false; rgui->force_redraw = false;
entries_end = menu_entries_get_size();
/* Get offset of bottommost entry */ /* Get offset of bottommost entry */
bottom = (int)(entries_end - rgui->term_layout.height); bottom = (int)(entries_end - rgui->term_layout.height);
menu_entries_ctl(MENU_ENTRIES_CTL_START_GET, &old_start); menu_entries_ctl(MENU_ENTRIES_CTL_START_GET, &old_start);