mirror of
https://github.com/libretro/RetroArch
synced 2025-02-28 22:13:51 +00:00
(zarch) Fix build
This commit is contained in:
parent
275814e291
commit
ec776a8d75
@ -141,7 +141,7 @@ typedef struct zarch_handle
|
||||
const core_info_t *pick_cores;
|
||||
size_t pick_supported;
|
||||
|
||||
void *fb_buf;
|
||||
void *font;
|
||||
int font_size;
|
||||
int header_height;
|
||||
unsigned next_id;
|
||||
@ -269,7 +269,7 @@ static void zarch_zui_draw_text(zui_t *zui,
|
||||
{
|
||||
struct font_params params;
|
||||
|
||||
if (!zui || !zui->fb_buf || string_is_empty(text))
|
||||
if (!zui || !zui->font || string_is_empty(text))
|
||||
return;
|
||||
|
||||
/* need to use height-y because the font renderer
|
||||
@ -284,7 +284,7 @@ static void zarch_zui_draw_text(zui_t *zui,
|
||||
params.full_screen = true;
|
||||
params.text_align = TEXT_ALIGN_LEFT;
|
||||
|
||||
video_driver_set_osd_msg(text, ¶ms, zui->fb_buf);
|
||||
video_driver_set_osd_msg(text, ¶ms, zui->font);
|
||||
}
|
||||
|
||||
static bool zarch_zui_button_full(zui_t *zui,
|
||||
@ -305,10 +305,10 @@ static bool zarch_zui_button_full(zui_t *zui,
|
||||
|
||||
static bool zarch_zui_button(zui_t *zui, int x1, int y1, const char *label)
|
||||
{
|
||||
if (!zui || !zui->fb_buf)
|
||||
if (!zui || !zui->font)
|
||||
return false;
|
||||
return zarch_zui_button_full(zui, x1, y1, x1
|
||||
+ zarch_zui_strwidth(zui->fb_buf, label, 1.0) + 24, y1 + 64, label);
|
||||
+ zarch_zui_strwidth(zui->font, label, 1.0) + 24, y1 + 64, label);
|
||||
}
|
||||
|
||||
static bool zarch_zui_list_item(zui_t *zui, struct zui_tabbed *tab, int x1, int y1,
|
||||
@ -378,9 +378,9 @@ static bool zarch_zui_tab(zui_t *zui, struct zui_tabbed *tab,
|
||||
|
||||
if (!width)
|
||||
{
|
||||
if (!zui->fb_buf)
|
||||
if (!zui->font)
|
||||
return false;
|
||||
width = zarch_zui_strwidth(zui->fb_buf, label, 1.0) + 24;
|
||||
width = zarch_zui_strwidth(zui->font, label, 1.0) + 24;
|
||||
}
|
||||
|
||||
x1 = tab->x;
|
||||
@ -854,7 +854,6 @@ static void zarch_frame(void *data)
|
||||
video_driver_get_size(&zui->width, &zui->height);
|
||||
|
||||
menu_display_set_viewport();
|
||||
zui->fb_buf = menu_display_get_font_buffer();
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
@ -880,7 +879,7 @@ static void zarch_frame(void *data)
|
||||
|
||||
zui->tmp_block.carr.coords.vertices = 0;
|
||||
|
||||
menu_display_font_bind_block(&zui->tmp_block);
|
||||
menu_display_font_bind_block(zui->font, &zui->tmp_block);
|
||||
|
||||
menu_display_push_quad(zui->width, zui->height, zui_bg_screen,
|
||||
0, 0, zui->width, zui->height);
|
||||
@ -958,13 +957,12 @@ static void zarch_frame(void *data)
|
||||
|
||||
zui->rendering = false;
|
||||
|
||||
menu_display_font_flush_block();
|
||||
menu_display_font_flush_block(zui->font);
|
||||
menu_display_unset_viewport();
|
||||
}
|
||||
|
||||
static void *zarch_init(void **userdata)
|
||||
{
|
||||
int unused;
|
||||
zui_t *zui = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
menu_handle_t *menu = (menu_handle_t*)
|
||||
@ -989,26 +987,11 @@ static void *zarch_init(void **userdata)
|
||||
settings->menu.mouse.enable = false;
|
||||
}
|
||||
|
||||
unused = 1000;
|
||||
menu_display_set_header_height(unused);
|
||||
|
||||
unused = 28;
|
||||
menu_display_set_font_size(unused);
|
||||
|
||||
(void)unused;
|
||||
|
||||
zui->header_height = 1000; /* dpi / 3; */
|
||||
zui->font_size = 28;
|
||||
|
||||
if (!string_is_empty(settings->path.menu_wallpaper))
|
||||
task_push_image_load(settings->path.menu_wallpaper,
|
||||
MENU_ENUM_LABEL_CB_MENU_WALLPAPER,
|
||||
menu_display_handle_wallpaper_upload, NULL);
|
||||
|
||||
matrix_4x4_ortho(&zui->mvp, 0, 1, 1, 0, 0, 1);
|
||||
|
||||
menu_display_font(APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH_FONT);
|
||||
|
||||
return menu;
|
||||
error:
|
||||
if (menu)
|
||||
@ -1037,8 +1020,16 @@ static void zarch_context_bg_destroy(void *data)
|
||||
|
||||
static void zarch_context_destroy(void *data)
|
||||
{
|
||||
menu_display_font_main_deinit();
|
||||
zui_t *zui = (zui_t*)data;
|
||||
|
||||
/* why on earth is this called twice on exit? */
|
||||
if (!zui)
|
||||
return;
|
||||
|
||||
menu_display_font_free(zui->font);
|
||||
zarch_context_bg_destroy(data);
|
||||
|
||||
zui->font = NULL;
|
||||
}
|
||||
|
||||
static bool zarch_load_image(void *userdata,
|
||||
@ -1068,22 +1059,12 @@ static bool zarch_load_image(void *userdata,
|
||||
|
||||
static void zarch_context_reset(void *data)
|
||||
{
|
||||
menu_display_ctx_font_t font_info;
|
||||
settings_t *settings = config_get_ptr();
|
||||
zui_t *zui = (zui_t*)data;
|
||||
|
||||
if (!zui || !settings)
|
||||
return;
|
||||
|
||||
font_info.path = NULL;
|
||||
font_info.size = zui->font_size;
|
||||
|
||||
if (settings->video.font_enable)
|
||||
font_info.path = settings->path.font;
|
||||
|
||||
if (!menu_display_font_main_init(&font_info))
|
||||
RARCH_WARN("Failed to load font.");
|
||||
|
||||
zarch_context_bg_destroy(zui);
|
||||
|
||||
task_push_image_load(settings->path.menu_wallpaper,
|
||||
@ -1092,8 +1073,8 @@ static void zarch_context_reset(void *data)
|
||||
|
||||
menu_display_allocate_white_texture();
|
||||
|
||||
menu_display_set_font_size(zui->font_size);
|
||||
menu_display_font(APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH_FONT);
|
||||
menu_display_set_header_height(zui->header_height);
|
||||
zui->font = menu_display_font(APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH_FONT, zui->font_size);
|
||||
}
|
||||
|
||||
static int zarch_iterate(void *data, void *userdata, enum menu_action action)
|
||||
|
Loading…
x
Reference in New Issue
Block a user