mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 13:20:30 +00:00
(Vulkan) Fix font driver 'vulkan_get_message_width()' function
This commit is contained in:
parent
7fa6247770
commit
7ad4becedb
@ -125,17 +125,21 @@ static int vulkan_get_message_width(void *data, const char *msg,
|
|||||||
unsigned msg_len, float scale)
|
unsigned msg_len, float scale)
|
||||||
{
|
{
|
||||||
vulkan_raster_t *font = (vulkan_raster_t*)data;
|
vulkan_raster_t *font = (vulkan_raster_t*)data;
|
||||||
|
const char* msg_end = msg + msg_len;
|
||||||
|
int delta_x = 0;
|
||||||
|
|
||||||
unsigned i;
|
if ( !font
|
||||||
int delta_x = 0;
|
|| !font->font_driver
|
||||||
|
|| !font->font_driver->get_glyph
|
||||||
if (!font)
|
|| !font->font_data )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
for (i = 0; i < msg_len; i++)
|
while (msg < msg_end)
|
||||||
{
|
{
|
||||||
const struct font_glyph *glyph =
|
uint32_t code = utf8_walk(&msg);
|
||||||
font->font_driver->get_glyph(font->font_data, (uint8_t)msg[i]);
|
const struct font_glyph *glyph = font->font_driver->get_glyph(
|
||||||
|
font->font_data, code);
|
||||||
|
|
||||||
if (!glyph) /* Do something smarter here ... */
|
if (!glyph) /* Do something smarter here ... */
|
||||||
glyph = font->font_driver->get_glyph(font->font_data, '?');
|
glyph = font->font_driver->get_glyph(font->font_data, '?');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user