From ee484b693cd8e68ec3db1b6fc610bbae30d678b5 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 24 Apr 2017 17:39:23 +0200 Subject: [PATCH] (vulkan_raster_font.c) Cleanups --- gfx/drivers_font/vulkan_raster_font.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/gfx/drivers_font/vulkan_raster_font.c b/gfx/drivers_font/vulkan_raster_font.c index 6b7f51c217..a4bbe3eef6 100644 --- a/gfx/drivers_font/vulkan_raster_font.c +++ b/gfx/drivers_font/vulkan_raster_font.c @@ -106,10 +106,9 @@ static int vulkan_get_message_width(void *data, const char *msg, font->font_driver->get_glyph(font->font_data, (uint8_t)msg[i]); if (!glyph) /* Do something smarter here ... */ glyph = font->font_driver->get_glyph(font->font_data, '?'); - if (!glyph) - continue; - delta_x += glyph->advance_x; + if (glyph) + delta_x += glyph->advance_x; } return delta_x * scale; @@ -124,15 +123,15 @@ static void vulkan_raster_font_render_line( float inv_tex_size_x, inv_tex_size_y, inv_win_width, inv_win_height; unsigned i; struct vk_color vk_color; - vk_t *vk = font ? font->vk : NULL; + vk_t *vk = font ? font->vk : NULL; if (!vk) return; - x = roundf(pos_x * vk->vp.width); - y = roundf((1.0f - pos_y) * vk->vp.height); - delta_x = 0; - delta_y = 0; + x = roundf(pos_x * vk->vp.width); + y = roundf((1.0f - pos_y) * vk->vp.height); + delta_x = 0; + delta_y = 0; vk_color.r = color[0]; vk_color.g = color[1]; @@ -182,10 +181,11 @@ static void vulkan_raster_font_render_line( width * inv_tex_size_x, height * inv_tex_size_y, &vk_color); + font->vertices += 6; - delta_x += glyph->advance_x; - delta_y += glyph->advance_y; + delta_x += glyph->advance_x; + delta_y += glyph->advance_y; } }