mirror of
https://github.com/libretro/RetroArch
synced 2025-03-03 13:14:04 +00:00
CLeanups
This commit is contained in:
parent
917e3078e9
commit
8badf1787d
@ -1002,21 +1002,6 @@ static void mui_frame(void *data)
|
|||||||
menu_display_unset_viewport();
|
menu_display_unset_viewport();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mui_font(enum application_special_type type)
|
|
||||||
{
|
|
||||||
menu_display_ctx_font_t font_info;
|
|
||||||
char fontpath[PATH_MAX_LENGTH] = {0};
|
|
||||||
int font_size = menu_display_get_font_size();
|
|
||||||
|
|
||||||
fill_pathname_application_special(fontpath, sizeof(fontpath), type);
|
|
||||||
|
|
||||||
font_info.path = fontpath;
|
|
||||||
font_info.size = font_size;
|
|
||||||
|
|
||||||
if (!menu_display_font_main_init(&font_info))
|
|
||||||
RARCH_WARN("Failed to load font.");
|
|
||||||
}
|
|
||||||
|
|
||||||
static void mui_layout(mui_handle_t *mui)
|
static void mui_layout(mui_handle_t *mui)
|
||||||
{
|
{
|
||||||
void *fb_buf;
|
void *fb_buf;
|
||||||
@ -1050,7 +1035,7 @@ static void mui_layout(mui_handle_t *mui)
|
|||||||
/* we assume the average glyph aspect ratio is close to 3:4 */
|
/* we assume the average glyph aspect ratio is close to 3:4 */
|
||||||
mui->glyph_width = new_font_size * 3/4;
|
mui->glyph_width = new_font_size * 3/4;
|
||||||
|
|
||||||
mui_font(APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI_FONT);
|
menu_display_font(APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI_FONT);
|
||||||
|
|
||||||
fb_buf = menu_display_get_font_buffer();
|
fb_buf = menu_display_get_font_buffer();
|
||||||
|
|
||||||
|
@ -2255,23 +2255,6 @@ static void xmb_frame(void *data)
|
|||||||
menu_display_unset_viewport();
|
menu_display_unset_viewport();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xmb_font(enum application_special_type type)
|
|
||||||
{
|
|
||||||
menu_display_ctx_font_t font_info;
|
|
||||||
char fontpath[PATH_MAX_LENGTH] = {0};
|
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
int font_size = menu_display_get_font_size();
|
|
||||||
|
|
||||||
fill_pathname_application_special(fontpath, sizeof(fontpath),
|
|
||||||
type);
|
|
||||||
|
|
||||||
font_info.path = fontpath;
|
|
||||||
font_info.size = font_size;
|
|
||||||
|
|
||||||
if (!menu_display_font_main_init(&font_info))
|
|
||||||
RARCH_WARN("Failed to load font.");
|
|
||||||
}
|
|
||||||
|
|
||||||
static void xmb_layout_ps3(xmb_handle_t *xmb, int width)
|
static void xmb_layout_ps3(xmb_handle_t *xmb, int width)
|
||||||
{
|
{
|
||||||
unsigned new_font_size, new_header_height;
|
unsigned new_font_size, new_header_height;
|
||||||
@ -2530,7 +2513,7 @@ static void *xmb_init(void **userdata)
|
|||||||
menu_display_allocate_white_texture();
|
menu_display_allocate_white_texture();
|
||||||
|
|
||||||
xmb_init_horizontal_list(xmb);
|
xmb_init_horizontal_list(xmb);
|
||||||
xmb_font(APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_FONT);
|
menu_display_font(APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_FONT);
|
||||||
xmb_init_ribbon(xmb);
|
xmb_init_ribbon(xmb);
|
||||||
|
|
||||||
return menu;
|
return menu;
|
||||||
@ -2777,7 +2760,7 @@ static void xmb_context_reset(void *data)
|
|||||||
APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_ICONS);
|
APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_ICONS);
|
||||||
|
|
||||||
xmb_layout(xmb);
|
xmb_layout(xmb);
|
||||||
xmb_font(APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_FONT);
|
menu_display_font(APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_FONT);
|
||||||
xmb_context_reset_textures(xmb, iconpath);
|
xmb_context_reset_textures(xmb, iconpath);
|
||||||
xmb_context_reset_background(iconpath);
|
xmb_context_reset_background(iconpath);
|
||||||
xmb_context_reset_horizontal_list(xmb);
|
xmb_context_reset_horizontal_list(xmb);
|
||||||
|
@ -169,21 +169,6 @@ struct zui_tabbed
|
|||||||
|
|
||||||
static enum zarch_layout_type zarch_layout;
|
static enum zarch_layout_type zarch_layout;
|
||||||
|
|
||||||
static void zarch_zui_font(enum application_special_type type)
|
|
||||||
{
|
|
||||||
menu_display_ctx_font_t font_info;
|
|
||||||
char fontpath[PATH_MAX_LENGTH] = {0};
|
|
||||||
int font_size = menu_display_get_font_size();
|
|
||||||
|
|
||||||
fill_pathname_application_special(fontpath, sizeof(fontpath), type);
|
|
||||||
|
|
||||||
font_info.path = fontpath;
|
|
||||||
font_info.size = font_size;
|
|
||||||
|
|
||||||
if (!menu_display_font_main_init(&font_info))
|
|
||||||
RARCH_WARN("Failed to load font.");
|
|
||||||
}
|
|
||||||
|
|
||||||
static float zarch_zui_strwidth(void *fb_buf, const char *text, float scale)
|
static float zarch_zui_strwidth(void *fb_buf, const char *text, float scale)
|
||||||
{
|
{
|
||||||
return font_driver_get_message_width(fb_buf, text, strlen(text), scale);
|
return font_driver_get_message_width(fb_buf, text, strlen(text), scale);
|
||||||
@ -1027,7 +1012,7 @@ static void *zarch_init(void **userdata)
|
|||||||
|
|
||||||
matrix_4x4_ortho(&zui->mvp, 0, 1, 1, 0, 0, 1);
|
matrix_4x4_ortho(&zui->mvp, 0, 1, 1, 0, 0, 1);
|
||||||
|
|
||||||
zarch_zui_font(APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH_FONT);
|
menu_display_font(APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH_FONT);
|
||||||
|
|
||||||
return menu;
|
return menu;
|
||||||
error:
|
error:
|
||||||
@ -1112,7 +1097,7 @@ static void zarch_context_reset(void *data)
|
|||||||
menu_display_allocate_white_texture();
|
menu_display_allocate_white_texture();
|
||||||
|
|
||||||
menu_display_set_font_size(zui->font_size);
|
menu_display_set_font_size(zui->font_size);
|
||||||
zarch_zui_font(APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH_FONT);
|
menu_display_font(APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH_FONT);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zarch_iterate(void *data, void *userdata, enum menu_action action)
|
static int zarch_iterate(void *data, void *userdata, enum menu_action action)
|
||||||
|
@ -162,6 +162,26 @@ void menu_display_font_main_deinit(void)
|
|||||||
menu_display_font_size = 0;
|
menu_display_font_size = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool menu_display_font(enum application_special_type type)
|
||||||
|
{
|
||||||
|
menu_display_ctx_font_t font_info;
|
||||||
|
char fontpath[PATH_MAX_LENGTH] = {0};
|
||||||
|
int font_size = menu_display_get_font_size();
|
||||||
|
|
||||||
|
fill_pathname_application_special(fontpath, sizeof(fontpath), type);
|
||||||
|
|
||||||
|
font_info.path = fontpath;
|
||||||
|
font_info.size = font_size;
|
||||||
|
|
||||||
|
if (!menu_display_font_main_init(&font_info))
|
||||||
|
{
|
||||||
|
RARCH_WARN("Failed to load font.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool menu_display_font_main_init(menu_display_ctx_font_t *font)
|
bool menu_display_font_main_init(menu_display_ctx_font_t *font)
|
||||||
{
|
{
|
||||||
menu_display_font_main_deinit();
|
menu_display_font_main_deinit();
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include <retro_common_api.h>
|
#include <retro_common_api.h>
|
||||||
#include <gfx/math/matrix_4x4.h>
|
#include <gfx/math/matrix_4x4.h>
|
||||||
|
|
||||||
|
#include "../file_path_special.h"
|
||||||
#include "../gfx/video_context_driver.h"
|
#include "../gfx/video_context_driver.h"
|
||||||
#include "../gfx/video_coord_array.h"
|
#include "../gfx/video_coord_array.h"
|
||||||
|
|
||||||
@ -202,6 +203,8 @@ void menu_display_draw_text(const char *msg, int width, int height,
|
|||||||
|
|
||||||
void menu_display_set_alpha(float *color, float alpha_value);
|
void menu_display_set_alpha(float *color, float alpha_value);
|
||||||
|
|
||||||
|
bool menu_display_font(enum application_special_type type);
|
||||||
|
|
||||||
extern uintptr_t menu_display_white_texture;
|
extern uintptr_t menu_display_white_texture;
|
||||||
|
|
||||||
extern menu_display_ctx_driver_t menu_display_ctx_gl;
|
extern menu_display_ctx_driver_t menu_display_ctx_gl;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user