Merge branch 'portable' of https://github.com/Clownacy/Cave-Story-Engine-2 into portable
This commit is contained in:
commit
bdbebf9a35
1 changed files with 11 additions and 8 deletions
|
@ -1012,18 +1012,19 @@ static CachedGlyph* GetGlyphCached(FontObject *font_object, unsigned long unicod
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Don't bother loading glyphs that don't have an image (causes `cute_spritebatch.h` to freak-out)
|
||||||
|
if (bitmap.width == 0 || bitmap.rows == 0)
|
||||||
|
glyph->backend = NULL;
|
||||||
|
else
|
||||||
glyph->backend = RenderBackend_LoadGlyph(bitmap.buffer, bitmap.width, bitmap.rows, bitmap.pitch);
|
glyph->backend = RenderBackend_LoadGlyph(bitmap.buffer, bitmap.width, bitmap.rows, bitmap.pitch);
|
||||||
|
|
||||||
FT_Bitmap_Done(font_object->library, &bitmap);
|
FT_Bitmap_Done(font_object->library, &bitmap);
|
||||||
|
|
||||||
if (glyph->backend != NULL)
|
|
||||||
{
|
|
||||||
glyph->next = font_object->glyph_list_head;
|
glyph->next = font_object->glyph_list_head;
|
||||||
font_object->glyph_list_head = glyph;
|
font_object->glyph_list_head = glyph;
|
||||||
|
|
||||||
return glyph;
|
return glyph;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
FT_Bitmap_Done(font_object->library, &bitmap);
|
FT_Bitmap_Done(font_object->library, &bitmap);
|
||||||
}
|
}
|
||||||
|
@ -1041,7 +1042,9 @@ static void UnloadCachedGlyphs(FontObject *font_object)
|
||||||
{
|
{
|
||||||
CachedGlyph *next_glyph = glyph->next;
|
CachedGlyph *next_glyph = glyph->next;
|
||||||
|
|
||||||
|
if (glyph->backend != NULL)
|
||||||
RenderBackend_UnloadGlyph(glyph->backend);
|
RenderBackend_UnloadGlyph(glyph->backend);
|
||||||
|
|
||||||
free(glyph);
|
free(glyph);
|
||||||
|
|
||||||
glyph = next_glyph;
|
glyph = next_glyph;
|
||||||
|
|
Loading…
Add table
Reference in a new issue