From 600c2c1ca133f557599843800c69c64506447cff Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 14 Jul 2018 00:39:46 +0200 Subject: [PATCH] Simplify menu_display_font --- gfx/drivers_font_renderer/freetype.c | 1 - menu/menu_driver.c | 30 +++++++++------------------- menu/menu_driver.h | 6 ------ 3 files changed, 9 insertions(+), 28 deletions(-) diff --git a/gfx/drivers_font_renderer/freetype.c b/gfx/drivers_font_renderer/freetype.c index d83d14ee94..2273806938 100644 --- a/gfx/drivers_font_renderer/freetype.c +++ b/gfx/drivers_font_renderer/freetype.c @@ -25,7 +25,6 @@ #include #include #include -#include "../../configuration.h" #ifdef WIIU #include diff --git a/menu/menu_driver.c b/menu/menu_driver.c index 4bc0a32ec1..e9285912c6 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -383,40 +383,28 @@ void menu_display_font_free(font_data_t *font) /* Setup: Initializes the font associated * to the menu driver */ -static font_data_t *menu_display_font_main_init( - menu_display_ctx_font_t *font, - bool is_threaded) -{ - font_data_t *font_data = NULL; - - if (!font || !menu_disp) - return NULL; - - if (!menu_disp->font_init_first((void**)&font_data, - video_driver_get_ptr(false), - font->path, font->size, is_threaded)) - return NULL; - - return font_data; -} - font_data_t *menu_display_font( enum application_special_type type, float font_size, bool is_threaded) { - menu_display_ctx_font_t font_info; char fontpath[PATH_MAX_LENGTH]; + font_data_t *font_data = NULL; + + if (!menu_disp) + return NULL; fontpath[0] = '\0'; fill_pathname_application_special( fontpath, sizeof(fontpath), type); - font_info.path = fontpath; - font_info.size = font_size; + if (!menu_disp->font_init_first((void**)&font_data, + video_driver_get_ptr(false), + fontpath, font_size, is_threaded)) + return NULL; - return menu_display_font_main_init(&font_info, is_threaded); + return font_data; } /* Reset the menu's coordinate array vertices. diff --git a/menu/menu_driver.h b/menu/menu_driver.h index b3c363afb7..b919f290e6 100644 --- a/menu/menu_driver.h +++ b/menu/menu_driver.h @@ -455,12 +455,6 @@ typedef struct menu_display_ctx_datetime unsigned time_mode; } menu_display_ctx_datetime_t; -typedef struct menu_display_ctx_font -{ - const char *path; - float size; -} menu_display_ctx_font_t; - typedef struct menu_ctx_driver { /* Set a framebuffer texture. This is used for instance by RGUI. */