mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 18:40:49 +00:00
(font_renderer) Cleanups
This commit is contained in:
parent
527d1557ce
commit
e24d62715e
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -26,7 +26,6 @@
|
||||
#endif
|
||||
|
||||
#include "../font_driver.h"
|
||||
#include "../../verbosity.h"
|
||||
|
||||
#ifndef STB_TRUETYPE_IMPLEMENTATION
|
||||
#define STB_TRUETYPE_IMPLEMENTATION
|
||||
|
Loading…
x
Reference in New Issue
Block a user