Add font containers for global and custom fonts

All global fonts and all custom fonts in a level are now loaded, and
added to their respective "vectors". The selected font is still always
as the global font.png, and the custom level font also isn't selected
yet, but it's now easier to implement that.

Also, I added FILESYSTEM_enumerateAssets, which #902 already has but I
needed it now. I also rewrote it to not use std::vector<std::string>.
That was my idea, it's also how FILESYSTEM_getLanguageCodes worked,
so for symmetry, that function is getting changed as well.
This commit is contained in:
Dav999-v
2023-01-11 02:57:31 +01:00
committed by Misa Elizabeth Kai
parent 22dcc29d45
commit 83d645c8e3
5 changed files with 179 additions and 31 deletions

View File

@@ -60,6 +60,12 @@ struct Font
GlyphInfo* glyph_page[FONT_N_PAGES];
};
struct FontContainer
{
size_t count;
Font* fonts;
};
struct PrintFlags
{
uint8_t scale;
@@ -97,8 +103,6 @@ struct PrintFlags
#define PR_CJK_LOW (1 << 20) /* larger fonts should stick out fully on the bottom (draw at Y) */
#define PR_CJK_HIGH (2 << 20) /* larger fonts should stick out fully on the top */
extern Font temp_bfont;
void load_main(void);
void load_custom(void);
void unload_custom(void);