(font_renderer) Cleanups

This commit is contained in:
libretroadmin 2022-11-15 16:03:01 +01:00
parent 527d1557ce
commit e24d62715e
4 changed files with 0 additions and 25 deletions

View File

@ -30,7 +30,6 @@
#include <retro_miscellaneous.h>
#include "../../file_path_special.h"
#include "../../verbosity.h"
#include "bitmapfont_10x10.h"
@ -120,10 +119,7 @@ bitmapfont_lut_t *bitmapfont_10x10_load(unsigned language)
}
if (string_is_empty(font_file))
{
RARCH_WARN("[bitmap 10x10] No font file found for specified language: %u\n", language);
goto error;
}
/* Get font path */
fill_pathname_application_special(font_dir, sizeof(font_dir),
@ -133,18 +129,12 @@ bitmapfont_lut_t *bitmapfont_10x10_load(unsigned language)
/* Attempt to read bitmap file */
if (!rzipstream_read_file(font_path, &bitmap_raw, &len))
{
RARCH_WARN("[bitmap 10x10] Failed to read font file: %s\n", font_path);
goto error;
}
/* Ensure that we have the correct number
* of bytes */
if (len != font_size)
{
RARCH_WARN("[bitmap 10x10] Font file has invalid size: %s\n", font_path);
goto error;
}
bitmap_char = (unsigned char *)bitmap_raw;
num_glyphs = (glyph_max - glyph_min) + 1;

View File

@ -31,7 +31,6 @@
#include <retro_miscellaneous.h>
#include "../../file_path_special.h"
#include "../../verbosity.h"
#include "bitmapfont_6x10.h"
@ -120,10 +119,7 @@ bitmapfont_lut_t *bitmapfont_6x10_load(unsigned language)
/* Sanity check: should only trigger on bug */
if (string_is_empty(font_file))
{
RARCH_WARN("[bitmap 6x10] No font file found for specified language: %u\n", language);
goto error;
}
/* Get font path */
fill_pathname_application_special(font_dir, sizeof(font_dir),
@ -133,18 +129,12 @@ bitmapfont_lut_t *bitmapfont_6x10_load(unsigned language)
/* Attempt to read bitmap file */
if (!rzipstream_read_file(font_path, &bitmap_raw, &len))
{
RARCH_WARN("[bitmap 6x10] Failed to read font file: %s\n", font_path);
goto error;
}
/* Ensure that we have the correct number
* of bytes */
if (len != font_size)
{
RARCH_WARN("[bitmap 6x10] Font file has invalid size: %s\n", font_path);
goto error;
}
bitmap_char = (unsigned char *)bitmap_raw;
num_glyphs = (glyph_max - glyph_min) + 1;

View File

@ -22,7 +22,6 @@
#include <string/stdstring.h>
#include "../font_driver.h"
#include "../../verbosity.h"
#ifndef STB_TRUETYPE_IMPLEMENTATION
#define STB_TRUETYPE_IMPLEMENTATION
@ -71,10 +70,7 @@ static bool font_renderer_stb_create_atlas(stb_font_renderer_t *self,
stbtt_pack_context pc = {NULL};
if (width > 2048 || height > 2048)
{
RARCH_WARN("[stb] Font atlas too big: %ux%u\n", width, height);
goto error;
}
if (self->atlas.buffer)
free(self->atlas.buffer);

View File

@ -26,7 +26,6 @@
#endif
#include "../font_driver.h"
#include "../../verbosity.h"
#ifndef STB_TRUETYPE_IMPLEMENTATION
#define STB_TRUETYPE_IMPLEMENTATION