Remove some getter functions

This commit is contained in:
twinaphex 2020-10-14 02:24:18 +02:00
parent 992e780407
commit ac03578617
8 changed files with 31 additions and 39 deletions

View File

@ -2253,15 +2253,3 @@ uint64_t gfx_animation_get_ticker_slow_idx(void)
gfx_animation_t *p_anim = anim_get_ptr();
return p_anim->ticker_slow_idx;
}
uint64_t gfx_animation_get_ticker_pixel_idx(void)
{
gfx_animation_t *p_anim = anim_get_ptr();
return p_anim->ticker_pixel_idx;
}
uint64_t gfx_animation_get_ticker_pixel_line_idx(void)
{
gfx_animation_t *p_anim = anim_get_ptr();
return p_anim->ticker_pixel_line_idx;
}

View File

@ -257,10 +257,6 @@ uint64_t gfx_animation_get_ticker_idx(void);
uint64_t gfx_animation_get_ticker_slow_idx(void);
uint64_t gfx_animation_get_ticker_pixel_idx(void);
uint64_t gfx_animation_get_ticker_pixel_line_idx(void);
void gfx_animation_set_update_time_cb(update_time_cb cb);
void gfx_animation_unset_update_time_cb(void);

View File

@ -6607,6 +6607,7 @@ static void materialui_frame(void *data, video_frame_info_t *video_info)
materialui_color_theme = video_info->materialui_color_theme;
bool video_fullscreen = video_info->fullscreen;
bool menu_mouse_enable = video_info->menu_mouse_enable;
gfx_animation_t *p_anim = anim_get_ptr();
if (!mui)
return;
@ -6633,12 +6634,12 @@ static void materialui_frame(void *data, video_frame_info_t *video_info)
if (mui->use_smooth_ticker)
{
mui->ticker_smooth.idx = gfx_animation_get_ticker_pixel_idx();
mui->ticker_smooth.idx = p_anim->ticker_pixel_idx;
mui->ticker_smooth.type_enum = menu_ticker_type;
}
else
{
mui->ticker.idx = gfx_animation_get_ticker_idx();
mui->ticker.idx = p_anim->ticker_idx;
mui->ticker.type_enum = menu_ticker_type;
}

View File

@ -2069,13 +2069,14 @@ static void ozone_draw_header(ozone_handle_t *ozone,
enum gfx_animation_ticker_type
menu_ticker_type = (enum gfx_animation_ticker_type)settings->uints.menu_ticker_type;
gfx_display_t *p_disp = disp_get_ptr();
gfx_animation_t *p_anim = anim_get_ptr();
gfx_display_ctx_driver_t *dispctx = p_disp->dispctx;
float *col = ozone->theme->entries_icon;
/* Initial ticker configuration */
if (use_smooth_ticker)
{
ticker_smooth.idx = gfx_animation_get_ticker_pixel_idx();
ticker_smooth.idx = p_anim->ticker_pixel_idx;
ticker_smooth.font_scale = 1.0f;
ticker_smooth.type_enum = menu_ticker_type;
ticker_smooth.spacer = ticker_spacer;
@ -2084,7 +2085,7 @@ static void ozone_draw_header(ozone_handle_t *ozone,
}
else
{
ticker.idx = gfx_animation_get_ticker_idx();
ticker.idx = p_anim->ticker_idx;
ticker.type_enum = menu_ticker_type;
ticker.spacer = ticker_spacer;
}
@ -2330,6 +2331,7 @@ static void ozone_draw_footer(ozone_handle_t *ozone,
gfx_display_t *p_disp = disp_get_ptr();
gfx_display_ctx_driver_t *dispctx = p_disp->dispctx;
float *col = ozone->theme_dynamic.entries_icon;
gfx_animation_t *p_anim = anim_get_ptr();
/* Separator */
gfx_display_draw_quad(
@ -2540,7 +2542,7 @@ static void ozone_draw_footer(ozone_handle_t *ozone,
/* Configure and run ticker */
if (use_smooth_ticker)
{
ticker_smooth.idx = gfx_animation_get_ticker_pixel_idx();
ticker_smooth.idx = p_anim->ticker_pixel_idx;
ticker_smooth.font_scale = 1.0f;
ticker_smooth.type_enum = menu_ticker_type;
ticker_smooth.spacer = ticker_spacer;
@ -2558,7 +2560,7 @@ static void ozone_draw_footer(ozone_handle_t *ozone,
}
else
{
ticker.idx = gfx_animation_get_ticker_idx();
ticker.idx = p_anim->ticker_idx;
ticker.type_enum = menu_ticker_type;
ticker.spacer = ticker_spacer;

View File

@ -503,6 +503,7 @@ void ozone_draw_entries(
float scale_factor = ozone->last_scale_factor;
gfx_display_t *p_disp = disp_get_ptr();
gfx_display_ctx_driver_t *dispctx = p_disp->dispctx;
gfx_animation_t *p_anim = anim_get_ptr();
menu_entries_ctl(MENU_ENTRIES_CTL_START_GET, &i);
@ -657,7 +658,7 @@ border_iterate:
/* Initial ticker configuration */
if (use_smooth_ticker)
{
ticker_smooth.idx = gfx_animation_get_ticker_pixel_idx();
ticker_smooth.idx = p_anim->ticker_pixel_idx;
ticker_smooth.font = ozone->fonts.entries_label.font;
ticker_smooth.font_scale = 1.0f;
ticker_smooth.type_enum = menu_ticker_type;
@ -932,6 +933,7 @@ void ozone_draw_thumbnail_bar(ozone_handle_t *ozone,
enum gfx_thumbnail_alignment left_thumbnail_alignment;
gfx_display_t *p_disp = disp_get_ptr();
gfx_display_ctx_driver_t *dispctx = p_disp->dispctx;
gfx_animation_t *p_anim = anim_get_ptr();
/* Background */
if (!libretro_running || (menu_framebuffer_opacity >= 1.0f))
@ -1153,7 +1155,7 @@ void ozone_draw_thumbnail_bar(ozone_handle_t *ozone,
/* Initial ticker configuration */
if (use_smooth_ticker)
{
ticker_smooth.idx = gfx_animation_get_ticker_pixel_idx();
ticker_smooth.idx = p_anim->ticker_pixel_idx;
ticker_smooth.font_scale = 1.0f;
ticker_smooth.type_enum = menu_ticker_type;
ticker_smooth.spacer = ticker_spacer;

View File

@ -172,21 +172,22 @@ void ozone_draw_sidebar(
gfx_animation_ctx_ticker_t ticker;
gfx_animation_ctx_ticker_smooth_t ticker_smooth;
static const char* const
ticker_spacer = OZONE_TICKER_SPACER;
unsigned ticker_x_offset = 0;
settings_t *settings = config_get_ptr();
uint32_t text_alpha = ozone->animations.sidebar_text_alpha
ticker_spacer = OZONE_TICKER_SPACER;
unsigned ticker_x_offset = 0;
settings_t *settings = config_get_ptr();
uint32_t text_alpha = ozone->animations.sidebar_text_alpha
* 255.0f;
bool use_smooth_ticker = settings->bools.menu_ticker_smooth;
float scale_factor = ozone->last_scale_factor;
bool use_smooth_ticker = settings->bools.menu_ticker_smooth;
float scale_factor = ozone->last_scale_factor;
enum gfx_animation_ticker_type
menu_ticker_type = (enum gfx_animation_ticker_type)
menu_ticker_type = (enum gfx_animation_ticker_type)
settings->uints.menu_ticker_type;
unsigned selection_y = 0;
unsigned selection_old_y = 0;
unsigned horizontal_list_size = 0;
unsigned selection_y = 0;
unsigned selection_old_y = 0;
unsigned horizontal_list_size = 0;
gfx_display_t *p_disp = disp_get_ptr();
gfx_display_ctx_driver_t *dispctx = p_disp->dispctx;
gfx_animation_t *p_anim = anim_get_ptr();
if (!ozone->draw_sidebar)
return;
@ -194,7 +195,7 @@ void ozone_draw_sidebar(
/* Initial ticker configuration */
if (use_smooth_ticker)
{
ticker_smooth.idx = gfx_animation_get_ticker_pixel_idx();
ticker_smooth.idx = p_anim->ticker_pixel_idx;
ticker_smooth.font = ozone->fonts.sidebar.font;
ticker_smooth.font_scale = 1.0f;
ticker_smooth.type_enum = menu_ticker_type;

View File

@ -3610,7 +3610,7 @@ static void rgui_render(void *data,
* with the following configuration: */
if (use_smooth_ticker)
{
ticker_smooth.idx = gfx_animation_get_ticker_pixel_idx();
ticker_smooth.idx = p_anim->ticker_pixel_idx;
ticker_smooth.font = NULL;
ticker_smooth.glyph_width = FONT_WIDTH_STRIDE;
ticker_smooth.type_enum = menu_ticker_type;

View File

@ -3051,11 +3051,12 @@ static int xmb_draw_item(
settings->uints.menu_xmb_thumbnail_scale_factor;
bool menu_xmb_vertical_thumbnails = settings->bools.menu_xmb_vertical_thumbnails;
bool menu_show_sublabels = settings->bools.menu_show_sublabels;
gfx_animation_t *p_anim = anim_get_ptr();
/* Initial ticker configuration */
if (use_smooth_ticker)
{
ticker_smooth.idx = gfx_animation_get_ticker_pixel_idx();
ticker_smooth.idx = p_anim->ticker_pixel_idx;
ticker_smooth.font = xmb->font;
ticker_smooth.font_scale = 1.0f;
ticker_smooth.type_enum = menu_ticker_type;
@ -3258,7 +3259,7 @@ static int xmb_draw_item(
{
line_ticker_smooth.fade_enabled = true;
line_ticker_smooth.type_enum = menu_ticker_type;
line_ticker_smooth.idx = gfx_animation_get_ticker_pixel_line_idx();
line_ticker_smooth.idx = p_anim->ticker_pixel_line_idx;
line_ticker_smooth.font = xmb->font2;
line_ticker_smooth.font_scale = 1.0f;
@ -4266,6 +4267,7 @@ static void xmb_draw_fullscreen_thumbnails(
bool menu_ticker_smooth = settings->bools.menu_ticker_smooth;
enum gfx_animation_ticker_type
menu_ticker_type = (enum gfx_animation_ticker_type)settings->uints.menu_ticker_type;
gfx_animation_t *p_anim = anim_get_ptr();
/* Sanity check: Return immediately if this is
* a menu without thumbnails and we are not currently
@ -4467,7 +4469,7 @@ static void xmb_draw_fullscreen_thumbnails(
title_buf[0] = '\0';
ticker_smooth.idx = gfx_animation_get_ticker_pixel_idx();
ticker_smooth.idx = p_anim->ticker_pixel_idx;
ticker_smooth.font = xmb->font;
ticker_smooth.font_scale = 1.0f;
ticker_smooth.type_enum = menu_ticker_type;