From a79511e27fae0eed00c82784969c4bbb9aa1235c Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 24 Apr 2015 23:28:25 +0200 Subject: [PATCH] Simplify menu_display_font_flush_block --- menu/drivers/glui.c | 3 +-- menu/drivers/xmb.c | 3 +-- menu/menu_display.c | 22 ++++++++++++---------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/menu/drivers/glui.c b/menu/drivers/glui.c index 52a0d1ae46..b9caeb534f 100644 --- a/menu/drivers/glui.c +++ b/menu/drivers/glui.c @@ -547,8 +547,7 @@ static void glui_frame(void) TEXT_ALIGN_RIGHT); } - if (menu_display_font_flush_block(menu, font_driver)) - menu_display_font_bind_block(menu, font_driver, NULL); + menu_display_font_flush_block(menu, font_driver); if (menu->keyboard.display) { diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 64c26f3384..a6e68bfc3a 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -1423,8 +1423,7 @@ static void xmb_frame(void) } } - if (menu_display_font_flush_block(menu, font_driver)) - menu_display_font_bind_block(menu, font_driver, NULL); + menu_display_font_flush_block(menu, font_driver); if (menu->keyboard.display) { diff --git a/menu/menu_display.c b/menu/menu_display.c index 05be5b230e..706db6f777 100644 --- a/menu/menu_display.c +++ b/menu/menu_display.c @@ -133,16 +133,6 @@ bool menu_display_font_init_first(const void **font_driver, font_path, font_size, FONT_DRIVER_RENDER_OPENGL_API); } -bool menu_display_font_flush_block(menu_handle_t *menu, - const struct font_renderer *font_driver) -{ - if (!font_driver || !font_driver->flush) - return false; - - font_driver->flush(menu->font.buf); - return true; -} - bool menu_display_font_bind_block(menu_handle_t *menu, const struct font_renderer *font_driver, void *userdata) { @@ -153,3 +143,15 @@ bool menu_display_font_bind_block(menu_handle_t *menu, return true; } + +bool menu_display_font_flush_block(menu_handle_t *menu, + const struct font_renderer *font_driver) +{ + if (!font_driver || !font_driver->flush) + return false; + + font_driver->flush(menu->font.buf); + + return menu_display_font_bind_block(menu, + font_driver, NULL); +}