Create MENU_DISPLAY_CTL_FONT_FLUSH_BLOCK

This commit is contained in:
twinaphex 2015-12-12 23:48:44 +01:00
parent ebe3454969
commit 8833ba1141
5 changed files with 12 additions and 19 deletions

View File

@ -804,8 +804,7 @@ static void mui_frame(void *data)
mui_render_menu_list(mui, width, height, normal_color, hover_color, &pure_white[0]);
menu_display_font_flush_block();
menu_display_ctl(MENU_DISPLAY_CTL_FONT_FLUSH_BLOCK, NULL);
menu_animation_ctl(MENU_ANIMATION_CTL_SET_ACTIVE, NULL);
/* header */

View File

@ -1744,8 +1744,7 @@ static void xmb_frame(void *data)
xmb_frame_horizontal_list(xmb, width, height, &item_color[0]);
menu_display_font_flush_block();
menu_display_ctl(MENU_DISPLAY_CTL_FONT_FLUSH_BLOCK, NULL);
menu_input_ctl(MENU_INPUT_CTL_KEYBOARD_DISPLAY, &display_kb);
if (display_kb)

View File

@ -1039,10 +1039,9 @@ static void zarch_frame(void *data)
NULL, menu_display_get_tex_coords(), 4,
MENU_DISPLAY_PRIM_TRIANGLESTRIP);
menu_display_font_flush_block();
zui->rendering = false;
menu_display_ctl(MENU_DISPLAY_CTL_FONT_FLUSH_BLOCK, NULL);
menu_display_ctl(MENU_DISPLAY_CTL_UNSET_VIEWPORT, NULL);
}

View File

@ -135,17 +135,6 @@ bool menu_display_font_bind_block(void *userdata)
return true;
}
bool menu_display_font_flush_block(void)
{
menu_display_t *disp = menu_display_get_ptr();
if (!disp || !disp->font.buf)
return false;
font_driver_flush(disp->font.buf);
return menu_display_font_bind_block(NULL);
}
void menu_display_free_main_font(void)
{
menu_display_t *disp = menu_display_get_ptr();
@ -245,6 +234,14 @@ bool menu_display_ctl(enum menu_display_ctl_state state, void *data)
switch (state)
{
case MENU_DISPLAY_CTL_FONT_FLUSH_BLOCK:
if (!disp || !disp->font.buf)
return false;
font_driver_flush(disp->font.buf);
return menu_display_font_bind_block(NULL);
break;
case MENU_DISPLAY_CTL_FRAMEBUF_DEINIT:
if (menu_display_framebuf.data)
free(menu_display_framebuf.data);

View File

@ -60,6 +60,7 @@ enum menu_display_ctl_state
MENU_DISPLAY_CTL_MSG_FORCE,
MENU_DISPLAY_CTL_SET_MSG_FORCE,
MENU_DISPLAY_CTL_FONT_BUF,
MENU_DISPLAY_CTL_FONT_FLUSH_BLOCK,
MENU_DISPLAY_CTL_SET_FONT_BUF,
MENU_DISPLAY_CTL_FONT_FB,
MENU_DISPLAY_CTL_SET_FONT_FB
@ -126,8 +127,6 @@ bool menu_display_init(void);
bool menu_display_font_bind_block(void *userdata);
bool menu_display_font_flush_block(void);
bool menu_display_init_main_font(const char *font_path, float font_size);
void menu_display_free_main_font(void);