Change signatures of gl font driver callback functions

This commit is contained in:
twinaphex 2015-03-29 21:59:01 +02:00
parent bbfedcedae
commit 65e812da4c
6 changed files with 20 additions and 16 deletions

View File

@ -56,9 +56,10 @@ static void d3dfonts_w32_deinit_font(void *data)
}
static void d3dfonts_w32_render_msg(void *data, const char *msg,
const struct font_params *params)
const void *userdata)
{
d3d_video_t *d3d = (d3d_video_t*)data;
const struct font_params *params = (const struct font_params*)userdata;
if (!d3d)
return;

View File

@ -267,7 +267,7 @@ static void restore_viewport(gl_t *gl)
}
static void gl_raster_font_render_msg(void *data, const char *msg,
const struct font_params *params)
const void *userdata)
{
GLfloat x, y, scale, drop_mod;
GLfloat color[4], color_dark[4];
@ -277,8 +277,9 @@ static void gl_raster_font_render_msg(void *data, const char *msg,
gl_t *gl = NULL;
gl_raster_t *font = (gl_raster_t*)data;
settings_t *settings = config_get_ptr();
const struct font_params *params = (const struct font_params*)userdata;
if (!font)
if (!font || !params)
return;
gl = font->gl;
@ -354,7 +355,7 @@ static const struct font_glyph *gl_raster_font_get_glyph(
return font->font_driver->get_glyph((void*)font->font_driver, code);
}
static void gl_flush_block(void *data)
static void gl_raster_font_flush_block(void *data)
{
gl_raster_t *font = (gl_raster_t*)data;
gl_font_raster_block_t *block = font->block;
@ -367,15 +368,15 @@ static void gl_flush_block(void *data)
restore_viewport(font->gl);
}
/* block->carr.coords.vertices = 0; */
}
static void gl_bind_block(void *data, gl_font_raster_block_t *block)
static void gl_raster_font_bind_block(void *data, void *userdata)
{
gl_raster_t *font = (gl_raster_t*)data;
gl_font_raster_block_t *block = (gl_font_raster_block_t*)userdata;
font->block = block;
if (font && block)
font->block = block;
}
gl_font_renderer_t gl_raster_font = {
@ -384,6 +385,6 @@ gl_font_renderer_t gl_raster_font = {
gl_raster_font_render_msg,
"GL raster",
gl_raster_font_get_glyph,
gl_bind_block,
gl_flush_block
gl_raster_font_bind_block,
gl_raster_font_flush_block
};

View File

@ -62,11 +62,12 @@ static void libdbg_font_deinit_font(void *data)
}
static void libdbg_font_render_msg(void *data, const char *msg,
const struct font_params *params)
const void *params)
{
float x, y, scale;
unsigned color;
settings_t *settings = config_get_ptr();
const struct font_params *params = (const struct font_params*)userdata;
(void)data;

View File

@ -43,12 +43,13 @@ static void xfonts_deinit_font(void *data)
}
static void xfonts_render_msg(void *data, const char *msg,
const struct font_params *params)
const void *userdata)
{
wchar_t str[PATH_MAX_LENGTH];
float x, y;
d3d_video_t *d3d = (d3d_video_t*)data;
settings_t *settings = config_get_ptr();
const struct font_params *params = (const struct font_params*)userdata;
if (params)
{

View File

@ -451,12 +451,13 @@ static void xdk360_draw_text(xdk360_video_font_t *font, void *video_data,
}
static void xdk360_render_msg(void *data, const char *str_msg,
const struct font_params *params)
const void *userdata)
{
float x, y;
wchar_t msg[PATH_MAX_LENGTH];
d3d_video_t *d3d = (d3d_video_t*)data;
xdk360_video_font_t *font = &m_Font;
const struct font_params *params = (const struct font_params*)userdata;
if (params)
{

View File

@ -27,12 +27,11 @@ typedef struct gl_font_renderer
{
void *(*init)(void *data, const char *font_path, float font_size);
void (*free)(void *data);
void (*render_msg)(void *data, const char *msg,
const struct font_params *parms);
void (*render_msg)(void *data, const char *msg, const void *userdata);
const char *ident;
const struct font_glyph *(*get_glyph)(void *data, uint32_t code);
void (*bind_block)(void *data, gl_font_raster_block_t *block);
void (*bind_block)(void *data, void *block);
void (*flush)(void *data);
} gl_font_renderer_t;