idk why but my GDB just stopped working

This commit is contained in:
2023-12-05 20:58:11 -06:00
parent f140b26172
commit e4da9b4d2f
5 changed files with 29 additions and 18 deletions

View File

@ -12,7 +12,9 @@ TrueTypeLoader::TrueTypeLoader(const std::string name) :
AssetLoader(name),
loader(name + ".ttf")
{
// Init the font.
auto ret = FT_Init_FreeType(&fontLibrary);
assertTrue(ret == 0, "Failed to initialize FreeType library.");
}
void TrueTypeLoader::updateSync() {
@ -31,10 +33,7 @@ void TrueTypeLoader::updateAsync() {
assertTrue(readSize == size, "Failed to read all data from TrueTypeLoader.");
// Init the font.
auto ret = FT_Init_FreeType(&fontLibrary);
assertTrue(ret == 0, "Failed to initialize FreeType library.");
ret = FT_New_Memory_Face(fontLibrary, buffer, size, 0, &face);
auto ret = FT_New_Memory_Face(fontLibrary, buffer, size, 0, &face);
assertTrue(ret == 0, "Failed to load font face.");
// Now close the asset loader
@ -64,4 +63,6 @@ TrueTypeLoader::~TrueTypeLoader() {
delete[] buffer;
buffer = nullptr;
}
FT_Done_FreeType(fontLibrary);
}