Remove unnecessary wrapper function gfx_display_font - just wrapped

around gfx_display_font_file
This commit is contained in:
libretroadmin 2022-06-26 18:19:43 +02:00
parent cf12a5e7e7
commit 4e13134c40
4 changed files with 15 additions and 38 deletions

View File

@ -1030,24 +1030,6 @@ void gfx_display_draw_cursor(
dispctx->blend_end(userdata);
}
/* Setup: Initializes the font associated
* to the menu driver */
font_data_t *gfx_display_font(
gfx_display_t *p_disp,
enum application_special_type type,
float menu_font_size,
bool is_threaded)
{
char fontpath[PATH_MAX_LENGTH];
fontpath[0] = '\0';
fill_pathname_application_special(
fontpath, sizeof(fontpath), type);
return gfx_display_font_file(p_disp, fontpath, menu_font_size, is_threaded);
}
/* Returns the OSK key at a given position */
int gfx_display_osk_ptr_at_pos(void *data, int x, int y,
unsigned width, unsigned height)

View File

@ -243,12 +243,6 @@ void gfx_display_draw_text(
float scale_factor, bool shadows_enable, float shadow_offset,
bool draw_outside);
font_data_t *gfx_display_font(
gfx_display_t *p_disp,
enum application_special_type type,
float font_size,
bool video_is_threaded);
void gfx_display_scissor_begin(
gfx_display_t *p_disp,
void *userdata,

View File

@ -7763,21 +7763,22 @@ static void materialui_init_font(
const char *str_latin
)
{
char fontpath[PATH_MAX_LENGTH];
const char *wideglyph_str = msg_hash_get_wideglyph_str();
fontpath[0] = '\0';
/* We assume the average glyph aspect ratio is close to 3:4 */
font_data->glyph_width = (int)((font_size * (3.0f / 4.0f)) + 0.5f);
font_data->glyph_width = (int)((font_size * (3.0f / 4.0f)) + 0.5f);
if (font_data->font)
{
gfx_display_font_free(font_data->font);
font_data->font = NULL;
}
font_data->font = gfx_display_font(
p_disp,
APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI_FONT,
font_size, video_is_threaded);
fill_pathname_application_special(
fontpath, sizeof(fontpath), APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI_FONT);
font_data->font = gfx_display_font_file(p_disp,
fontpath, font_size, video_is_threaded);
if (font_data->font)
{

View File

@ -6553,11 +6553,13 @@ static void xmb_context_reset_internal(xmb_handle_t *xmb,
{
char iconpath[PATH_MAX_LENGTH];
char bg_file_path[PATH_MAX_LENGTH];
char fontpath[PATH_MAX_LENGTH];
settings_t *settings = config_get_ptr();
gfx_display_t *p_disp = disp_get_ptr();
const char *wideglyph_str = msg_hash_get_wideglyph_str();
unsigned menu_xmb_theme = settings->uints.menu_xmb_theme;
iconpath[0] = bg_file_path[0] = '\0';
fontpath[0] = '\0';
fill_pathname_application_special(bg_file_path,
sizeof(bg_file_path),
@ -6584,14 +6586,12 @@ static void xmb_context_reset_internal(xmb_handle_t *xmb,
gfx_display_font_free(xmb->font2);
xmb->font2 = NULL;
}
xmb->font = gfx_display_font(p_disp,
APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_FONT,
xmb->font_size,
is_threaded);
xmb->font2 = gfx_display_font(p_disp,
APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_FONT,
xmb->font2_size,
is_threaded);
fill_pathname_application_special(
fontpath, sizeof(fontpath), APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_FONT);
xmb->font = gfx_display_font_file(p_disp,
fontpath, xmb->font_size, is_threaded);
xmb->font2 = gfx_display_font_file(p_disp,
fontpath, xmb->font2_size, is_threaded);
xmb->wideglyph_width = 100;