mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 04:20:27 +00:00
(drivers_font) Cleanups
This commit is contained in:
parent
6ada72e09d
commit
5d0b01ea07
@ -501,7 +501,9 @@ static void gl1_raster_font_render_msg(
|
||||
else
|
||||
gl1_raster_font_setup_viewport(width, height, font, full_screen);
|
||||
|
||||
if (!string_is_empty(msg) && font->gl
|
||||
if (font->gl)
|
||||
{
|
||||
if (!string_is_empty(msg)
|
||||
&& font->font_data && font->font_driver)
|
||||
{
|
||||
if (drop_x || drop_y)
|
||||
@ -513,18 +515,16 @@ static void gl1_raster_font_render_msg(
|
||||
color_dark[2] = color[2] * drop_mod;
|
||||
color_dark[3] = color[3] * drop_alpha;
|
||||
|
||||
if (font->gl)
|
||||
gl1_raster_font_render_message(font, msg, scale, color_dark,
|
||||
x + scale * drop_x / font->gl->vp.width, y +
|
||||
scale * drop_y / font->gl->vp.height, text_align);
|
||||
}
|
||||
|
||||
if (font->gl)
|
||||
gl1_raster_font_render_message(font, msg, scale, color,
|
||||
x, y, text_align);
|
||||
}
|
||||
|
||||
if (!font->block && font->gl)
|
||||
if (!font->block)
|
||||
{
|
||||
/* restore viewport */
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
@ -534,6 +534,7 @@ static void gl1_raster_font_render_msg(
|
||||
video_driver_set_viewport(width, height, false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static const struct font_glyph *gl1_raster_font_get_glyph(
|
||||
void *data, uint32_t code)
|
||||
|
@ -179,11 +179,10 @@ static void gl_core_raster_font_draw_vertices(gl_core_raster_t *font,
|
||||
glActiveTexture(GL_TEXTURE1);
|
||||
glBindTexture(GL_TEXTURE_2D, font->tex);
|
||||
|
||||
if (font->gl->pipelines.font_loc.flat_ubo_vertex >= 0)
|
||||
{
|
||||
if ( font->gl &&
|
||||
font->gl->pipelines.font_loc.flat_ubo_vertex >= 0)
|
||||
glUniform4fv(font->gl->pipelines.font_loc.flat_ubo_vertex,
|
||||
4, font->gl->mvp_no_rot.data);
|
||||
}
|
||||
|
||||
glEnableVertexAttribArray(0);
|
||||
glEnableVertexAttribArray(1);
|
||||
@ -335,6 +334,7 @@ static void gl_core_raster_font_setup_viewport(unsigned width, unsigned height,
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glBlendEquation(GL_FUNC_ADD);
|
||||
if (font->gl)
|
||||
glUseProgram(font->gl->pipelines.font);
|
||||
}
|
||||
|
||||
@ -407,7 +407,9 @@ static void gl_core_raster_font_render_msg(
|
||||
else
|
||||
gl_core_raster_font_setup_viewport(width, height, font, full_screen);
|
||||
|
||||
if (!string_is_empty(msg) && font->gl
|
||||
if (font->gl)
|
||||
{
|
||||
if (!string_is_empty(msg)
|
||||
&& font->font_data && font->font_driver)
|
||||
{
|
||||
if (drop_x || drop_y)
|
||||
@ -419,23 +421,22 @@ static void gl_core_raster_font_render_msg(
|
||||
color_dark[2] = color[2] * drop_mod;
|
||||
color_dark[3] = color[3] * drop_alpha;
|
||||
|
||||
if (font->gl)
|
||||
gl_core_raster_font_render_message(font, msg, scale, color_dark,
|
||||
x + scale * drop_x / font->gl->vp.width, y +
|
||||
scale * drop_y / font->gl->vp.height, text_align);
|
||||
}
|
||||
|
||||
if (font->gl)
|
||||
gl_core_raster_font_render_message(font, msg, scale, color,
|
||||
x, y, text_align);
|
||||
}
|
||||
|
||||
if (!font->block && font->gl)
|
||||
if (!font->block)
|
||||
{
|
||||
glDisable(GL_BLEND);
|
||||
video_driver_set_viewport(width, height, false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static const struct font_glyph *gl_core_raster_font_get_glyph(
|
||||
void *data, uint32_t code)
|
||||
|
Loading…
x
Reference in New Issue
Block a user