From 44b708642c2ac4cc57ad7740f687b5d0e5452dcf Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 5 Dec 2015 11:34:56 +0100 Subject: [PATCH] Expand font_driver_bind_block --- gfx/font_driver.c | 7 ++++--- gfx/font_driver.h | 2 +- menu/drivers/materialui.c | 2 +- menu/drivers/xmb.c | 2 +- menu/drivers/zarch.c | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/gfx/font_driver.c b/gfx/font_driver.c index 417b5158f6..7354350fcf 100644 --- a/gfx/font_driver.c +++ b/gfx/font_driver.c @@ -162,13 +162,14 @@ void font_driver_render_msg(void *font_data, const char *msg, const struct font_ font_ctx->render_msg(font_data ? font_data : driver->font_osd_data, msg, params); } -void font_driver_bind_block(void *block) +void font_driver_bind_block(void *font_data, void *block) { - driver_t *driver = driver_get_ptr(); + driver_t *driver = driver_get_ptr(); const font_renderer_t *font_ctx = driver->font_osd_driver; + void *new_font_data = font_data ? font_data : driver->font_osd_data; if (font_ctx->bind_block) - font_ctx->bind_block(driver->font_osd_data, block); + font_ctx->bind_block(new_font_data, block); } void font_driver_free(void *data) diff --git a/gfx/font_driver.h b/gfx/font_driver.h index bd7b7f494d..b4b6e53232 100644 --- a/gfx/font_driver.h +++ b/gfx/font_driver.h @@ -65,7 +65,7 @@ bool font_driver_has_render_msg(void); void font_driver_render_msg(void *data, const char *msg, const struct font_params *params); -void font_driver_bind_block(void *block); +void font_driver_bind_block(void *font_data, void *block); void font_driver_free(void *data); diff --git a/menu/drivers/materialui.c b/menu/drivers/materialui.c index a6e74654f5..48b1cadb9a 100644 --- a/menu/drivers/materialui.c +++ b/menu/drivers/materialui.c @@ -1007,7 +1007,7 @@ static void mui_free(void *data) gfx_coord_array_free(&mui->list_block.carr); - font_driver_bind_block(NULL); + font_driver_bind_block(NULL, NULL); if (menu->userdata) free(menu->userdata); diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 06cc9e22e6..db5fe04407 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -2051,7 +2051,7 @@ static void xmb_free(void *data) menu->userdata = NULL; } - font_driver_bind_block(NULL); + font_driver_bind_block(NULL, NULL); } static void xmb_context_bg_destroy(xmb_handle_t *xmb) diff --git a/menu/drivers/zarch.c b/menu/drivers/zarch.c index c61552d27d..502f29af86 100644 --- a/menu/drivers/zarch.c +++ b/menu/drivers/zarch.c @@ -1142,7 +1142,7 @@ static void zarch_free(void *data) free(menu->userdata); menu->userdata = NULL; - font_driver_bind_block(NULL); + font_driver_bind_block(NULL, NULL); } static void zarch_context_bg_destroy(zui_t *zui)