diff --git a/gfx/drivers_font/caca_font.c b/gfx/drivers_font/caca_font.c index 766b21b169..0010f06146 100644 --- a/gfx/drivers_font/caca_font.c +++ b/gfx/drivers_font/caca_font.c @@ -76,7 +76,9 @@ static const struct font_glyph *caca_font_get_glyph( return NULL; } -static void caca_render_msg(video_frame_info_t *video_info, +static void caca_render_msg( + void *userdata, + video_frame_info_t *video_info, void *data, const char *msg, const struct font_params *params) { diff --git a/gfx/drivers_font/ctr_font.c b/gfx/drivers_font/ctr_font.c index 83e8db7ad5..c7f850c0ab 100644 --- a/gfx/drivers_font/ctr_font.c +++ b/gfx/drivers_font/ctr_font.c @@ -355,6 +355,7 @@ static void ctr_font_render_message( } static void ctr_font_render_msg( + void *userdata, video_frame_info_t *video_info, void* data, const char* msg, const struct font_params *params) @@ -366,7 +367,7 @@ static void ctr_font_render_msg( unsigned color, color_dark, r, g, b, alpha, r_dark, g_dark, b_dark, alpha_dark; ctr_font_t * font = (ctr_font_t*)data; - ctr_video_t *ctr = (ctr_video_t*)video_info->userdata; + ctr_video_t *ctr = (ctr_video_t*)userdata; unsigned width = video_info->width; unsigned height = video_info->height; settings_t *settings = config_get_ptr(); diff --git a/gfx/drivers_font/d3d10_font.c b/gfx/drivers_font/d3d10_font.c index a2456856f7..401ae4dec4 100644 --- a/gfx/drivers_font/d3d10_font.c +++ b/gfx/drivers_font/d3d10_font.c @@ -283,6 +283,7 @@ static void d3d10_font_render_message( } static void d3d10_font_render_msg( + void *userdata, video_frame_info_t* video_info, void* data, const char* msg, const struct font_params *params) { @@ -292,7 +293,7 @@ static void d3d10_font_render_msg( unsigned color, color_dark, r, g, b, alpha, r_dark, g_dark, b_dark, alpha_dark; d3d10_font_t* font = (d3d10_font_t*)data; - d3d10_video_t* d3d10 = (d3d10_video_t*)video_info->userdata; + d3d10_video_t* d3d10 = (d3d10_video_t*)userdata; unsigned width = video_info->width; unsigned height = video_info->height; settings_t *settings = config_get_ptr(); diff --git a/gfx/drivers_font/d3d11_font.c b/gfx/drivers_font/d3d11_font.c index 2513e0c928..e213bf4f53 100644 --- a/gfx/drivers_font/d3d11_font.c +++ b/gfx/drivers_font/d3d11_font.c @@ -279,6 +279,7 @@ static void d3d11_font_render_message( } static void d3d11_font_render_msg( + void *userdata, video_frame_info_t* video_info, void* data, const char* msg, const struct font_params *params) { @@ -288,7 +289,7 @@ static void d3d11_font_render_msg( unsigned color, color_dark, r, g, b, alpha, r_dark, g_dark, b_dark, alpha_dark; d3d11_font_t* font = (d3d11_font_t*)data; - d3d11_video_t * d3d11 = (d3d11_video_t*)video_info->userdata; + d3d11_video_t * d3d11 = (d3d11_video_t*)userdata; unsigned width = video_info->width; unsigned height = video_info->height; settings_t *settings = config_get_ptr(); diff --git a/gfx/drivers_font/d3d12_font.c b/gfx/drivers_font/d3d12_font.c index edcb1942d4..931e98292f 100644 --- a/gfx/drivers_font/d3d12_font.c +++ b/gfx/drivers_font/d3d12_font.c @@ -292,6 +292,7 @@ static void d3d12_font_render_message( } static void d3d12_font_render_msg( + void *userdata, video_frame_info_t* video_info, void* data, const char* msg, const struct font_params *params) { @@ -300,7 +301,7 @@ static void d3d12_font_render_msg( enum text_alignment text_align; unsigned color, color_dark, r, g, b, alpha, r_dark, g_dark, b_dark, alpha_dark; - d3d12_video_t *d3d12 = (d3d12_video_t*)video_info->userdata; + d3d12_video_t *d3d12 = (d3d12_video_t*)userdata; d3d12_font_t* font = (d3d12_font_t*)data; unsigned width = video_info->width; unsigned height = video_info->height; diff --git a/gfx/drivers_font/d3d_w32_font.c b/gfx/drivers_font/d3d_w32_font.c index 6ad8d44623..0077436d48 100644 --- a/gfx/drivers_font/d3d_w32_font.c +++ b/gfx/drivers_font/d3d_w32_font.c @@ -125,8 +125,11 @@ static int d3dfonts_w32_get_message_width(void* data, const char* msg, return box.right - box.left; } -static void d3dfonts_w32_render_msg(video_frame_info_t *video_info, - void *data, const char *msg, const struct font_params *params) +static void d3dfonts_w32_render_msg( + void *userdata, + video_frame_info_t *video_info, + void *data, const char *msg, + const struct font_params *params) { unsigned format; unsigned a, r, g, b; diff --git a/gfx/drivers_font/fpga_font.c b/gfx/drivers_font/fpga_font.c index f6addf52ac..a55c743751 100644 --- a/gfx/drivers_font/fpga_font.c +++ b/gfx/drivers_font/fpga_font.c @@ -79,6 +79,7 @@ static const struct font_glyph *fpga_font_get_glyph( } static void fpga_render_msg( + void *userdata, video_frame_info_t *video_info, void *data, const char *msg, const void *userdata) diff --git a/gfx/drivers_font/gdi_font.c b/gfx/drivers_font/gdi_font.c index ab5cc36e9f..7da4bdb1d9 100644 --- a/gfx/drivers_font/gdi_font.c +++ b/gfx/drivers_font/gdi_font.c @@ -84,6 +84,7 @@ static const struct font_glyph *gdi_font_get_glyph( } static void gdi_render_msg( + void *userdata, video_frame_info_t *video_info, void *data, const char *msg, const struct font_params *params) diff --git a/gfx/drivers_font/gl1_raster_font.c b/gfx/drivers_font/gl1_raster_font.c index dc056e097c..0dea2edcb8 100644 --- a/gfx/drivers_font/gl1_raster_font.c +++ b/gfx/drivers_font/gl1_raster_font.c @@ -430,6 +430,7 @@ static void gl1_raster_font_setup_viewport(unsigned width, unsigned height, } static void gl1_raster_font_render_msg( + void *userdata, video_frame_info_t *video_info, void *data, const char *msg, const struct font_params *params) diff --git a/gfx/drivers_font/gl_core_raster_font.c b/gfx/drivers_font/gl_core_raster_font.c index c9a37ef52c..2e064694dd 100644 --- a/gfx/drivers_font/gl_core_raster_font.c +++ b/gfx/drivers_font/gl_core_raster_font.c @@ -339,6 +339,7 @@ static void gl_core_raster_font_setup_viewport(unsigned width, unsigned height, } static void gl_core_raster_font_render_msg( + void *userdata, video_frame_info_t *video_info, void *data, const char *msg, const struct font_params *params) diff --git a/gfx/drivers_font/gl_raster_font.c b/gfx/drivers_font/gl_raster_font.c index e162e478f3..db3de5d874 100644 --- a/gfx/drivers_font/gl_raster_font.c +++ b/gfx/drivers_font/gl_raster_font.c @@ -413,6 +413,7 @@ static void gl_raster_font_setup_viewport(unsigned width, unsigned height, } static void gl_raster_font_render_msg( + void *userdata, video_frame_info_t *video_info, void *data, const char *msg, const struct font_params *params) diff --git a/gfx/drivers_font/metal_raster_font.m b/gfx/drivers_font/metal_raster_font.m index 23fa490ef9..7200f19a3a 100644 --- a/gfx/drivers_font/metal_raster_font.m +++ b/gfx/drivers_font/metal_raster_font.m @@ -518,9 +518,10 @@ static int metal_get_message_width(void *data, const char *msg, } static void metal_raster_font_render_msg( - video_frame_info_t *video_info, - void *data, const char *msg, - const struct font_params *params) + void *userdata, + video_frame_info_t *video_info, + void *data, const char *msg, + const struct font_params *params) { MetalRaster *r = (__bridge MetalRaster *)data; [r renderMessage:msg video:video_info params:params]; diff --git a/gfx/drivers_font/ps2_font.c b/gfx/drivers_font/ps2_font.c index 448310211f..a675c05ff9 100644 --- a/gfx/drivers_font/ps2_font.c +++ b/gfx/drivers_font/ps2_font.c @@ -131,6 +131,7 @@ static void ps2_font_free_font(void *data, bool is_threaded) } static void ps2_font_render_msg( + void *userdata, video_frame_info_t *video_info, void *data, const char *msg, const struct font_params *params) diff --git a/gfx/drivers_font/sixel_font.c b/gfx/drivers_font/sixel_font.c index 03f2b30e4e..a3109cb4b2 100644 --- a/gfx/drivers_font/sixel_font.c +++ b/gfx/drivers_font/sixel_font.c @@ -75,16 +75,18 @@ static const struct font_glyph *sixel_font_get_glyph( return NULL; } -static void sixel_render_msg(video_frame_info_t *video_info, +static void sixel_render_msg( + void *userdata, + video_frame_info_t *video_info, void *data, const char *msg, - const struct font_params *userdata) + const struct font_params *_params) { float x, y, scale; unsigned width, height; unsigned newX, newY; unsigned align; sixel_raster_t *font = (sixel_raster_t*)data; - const struct font_params *params = (const struct font_params*)userdata; + const struct font_params *params = (const struct font_params*)_params; settings_t *settings = config_get_ptr(); float video_msg_pos_x = settings->floats.video_msg_pos_x; float video_msg_pos_y = settings->floats.video_msg_pos_y; diff --git a/gfx/drivers_font/switch_font.c b/gfx/drivers_font/switch_font.c index 44f473e195..903b93d316 100644 --- a/gfx/drivers_font/switch_font.c +++ b/gfx/drivers_font/switch_font.c @@ -247,15 +247,16 @@ static void switch_font_render_message( } static void switch_font_render_msg( - video_frame_info_t *video_info, - void *data, const char *msg, - const struct font_params *params) + void *userdata, + video_frame_info_t *video_info, + void *data, const char *msg, + const struct font_params *params) { float x, y, scale; enum text_alignment text_align; unsigned color, r, g, b, alpha; switch_font_t *font = (switch_font_t *)data; - switch_video_t *sw = (switch_video_t*)video_info->userdata; + switch_video_t *sw = (switch_video_t*)userdata; settings_t *settings = config_get_ptr(); float video_msg_color_r = settings->floats.video_msg_color_r; float video_msg_color_g = settings->floats.video_msg_color_g; diff --git a/gfx/drivers_font/vga_font.c b/gfx/drivers_font/vga_font.c index 1ff6144868..15981e1e58 100644 --- a/gfx/drivers_font/vga_font.c +++ b/gfx/drivers_font/vga_font.c @@ -76,7 +76,9 @@ static const struct font_glyph *vga_font_get_glyph( return NULL; } -static void vga_render_msg(video_frame_info_t *video_info, +static void vga_render_msg( + void *userdata, + video_frame_info_t *video_info, void *data, const char *msg, const struct font_params *params) { diff --git a/gfx/drivers_font/vita2d_font.c b/gfx/drivers_font/vita2d_font.c index 39ae614413..4ee0038a2a 100644 --- a/gfx/drivers_font/vita2d_font.c +++ b/gfx/drivers_font/vita2d_font.c @@ -261,6 +261,7 @@ static void vita2d_font_render_message( } static void vita2d_font_render_msg( + void *userdata, video_frame_info_t *video_info, void *data, const char *msg, const struct font_params *params) diff --git a/gfx/drivers_font/vulkan_raster_font.c b/gfx/drivers_font/vulkan_raster_font.c index d2b716034b..acbb5f9be9 100644 --- a/gfx/drivers_font/vulkan_raster_font.c +++ b/gfx/drivers_font/vulkan_raster_font.c @@ -335,6 +335,7 @@ static void vulkan_raster_font_flush(vulkan_raster_t *font) } static void vulkan_raster_font_render_msg( + void *userdata, video_frame_info_t *video_info, void *data, const char *msg, const struct font_params *params) diff --git a/gfx/drivers_font/wiiu_font.c b/gfx/drivers_font/wiiu_font.c index 5d79e523ab..d9227f5bb7 100644 --- a/gfx/drivers_font/wiiu_font.c +++ b/gfx/drivers_font/wiiu_font.c @@ -284,6 +284,7 @@ static void wiiu_font_render_message( } static void wiiu_font_render_msg( + void *userdata, video_frame_info_t *video_info, void* data, const char* msg, const struct font_params *params) @@ -294,7 +295,7 @@ static void wiiu_font_render_msg( enum text_alignment text_align; unsigned color, color_dark, r, g, b, alpha, r_dark, g_dark, b_dark, alpha_dark; - wiiu_video_t *wiiu = (wiiu_video_t*)video_info->userdata; + wiiu_video_t *wiiu = (wiiu_video_t*)userdata; wiiu_font_t *font = (wiiu_font_t*)data; unsigned width = video_info->width; unsigned height = video_info->height; diff --git a/gfx/drivers_font/xdk1_xfonts.c b/gfx/drivers_font/xdk1_xfonts.c index 088e4c5e5e..16fd667fbf 100644 --- a/gfx/drivers_font/xdk1_xfonts.c +++ b/gfx/drivers_font/xdk1_xfonts.c @@ -74,6 +74,7 @@ static void xfonts_free_font(void *data, bool is_threaded) } static void xfonts_render_msg( + void *userdata, video_frame_info_t *video_info, void *data, const char *msg, const struct font_params *params) diff --git a/gfx/font_driver.c b/gfx/font_driver.c index 544664ed5b..5e485b21f7 100644 --- a/gfx/font_driver.c +++ b/gfx/font_driver.c @@ -1048,7 +1048,8 @@ void font_driver_render_msg( char *new_msg = (char*)msg; #endif - font->renderer->render_msg(video_info, + font->renderer->render_msg(data, + video_info, font->renderer_data, new_msg, params); #ifdef HAVE_LANGEXTRA free(new_msg); diff --git a/gfx/font_driver.h b/gfx/font_driver.h index 9449889e98..8272cd73d5 100644 --- a/gfx/font_driver.h +++ b/gfx/font_driver.h @@ -86,7 +86,7 @@ typedef struct font_renderer void *(*init)(void *data, const char *font_path, float font_size, bool is_threaded); void (*free)(void *data, bool is_threaded); - void (*render_msg)( + void (*render_msg)(void *userdata, video_frame_info_t *video_info, void *data, const char *msg, const struct font_params *params);