Create font_driver_bind_block

This commit is contained in:
twinaphex 2015-12-05 10:59:03 +01:00
parent a26e64e24d
commit 4c8a2a3f88
5 changed files with 14 additions and 13 deletions

View File

@ -161,6 +161,15 @@ 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)
{
driver_t *driver = driver_get_ptr();
const font_renderer_t *font_ctx = driver->font_osd_driver;
if (font_ctx->bind_block)
font_ctx->bind_block(driver->font_osd_data, block);
}
void font_driver_free(void *data)
{
driver_t *driver = driver_get_ptr();

View File

@ -65,6 +65,8 @@ 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_free(void *data);
bool font_driver_init_first(void *data, const char *font_path, float font_size,

View File

@ -1001,16 +1001,13 @@ static void mui_free(void *data)
menu_handle_t *menu = (menu_handle_t*)data;
driver_t *driver = driver_get_ptr();
mui_handle_t *mui = menu ? (mui_handle_t*)menu->userdata : NULL;
const struct font_renderer *font_driver = driver ?
(const struct font_renderer*)driver->font_osd_driver : NULL;
if (!mui)
return;
gfx_coord_array_free(&mui->list_block.carr);
if (font_driver && font_driver->bind_block)
font_driver->bind_block(driver->font_osd_data, NULL);
font_driver_bind_block(NULL);
if (menu->userdata)
free(menu->userdata);

View File

@ -2025,8 +2025,6 @@ static void xmb_free(void *data)
xmb_handle_t *xmb = NULL;
menu_handle_t *menu = (menu_handle_t*)data;
driver_t *driver = driver_get_ptr();
const struct font_renderer *font_driver =
(const struct font_renderer*)driver->font_osd_driver;
if (menu && menu->userdata)
{
@ -2053,8 +2051,7 @@ static void xmb_free(void *data)
menu->userdata = NULL;
}
if (font_driver->bind_block)
font_driver->bind_block(driver->font_osd_data, NULL);
font_driver_bind_block(NULL);
}
static void xmb_context_bg_destroy(xmb_handle_t *xmb)

View File

@ -1131,8 +1131,6 @@ static void zarch_free(void *data)
menu_handle_t *menu = (menu_handle_t*)data;
driver_t *driver = driver_get_ptr();
zui_t *zui = (zui_t*)menu->userdata;
const struct font_renderer *font_driver =
(const struct font_renderer*)driver->font_osd_driver;
if (!zui || !menu)
return;
@ -1144,9 +1142,7 @@ static void zarch_free(void *data)
free(menu->userdata);
menu->userdata = NULL;
if (font_driver->bind_block)
font_driver->bind_block(driver->font_osd_data, NULL);
font_driver_bind_block(NULL);
}
static void zarch_context_bg_destroy(zui_t *zui)