void blf_glyph_cache_free(GlyphCacheBLF *gc) { GlyphBLF *g; int i; for (i = 0; i < 257; i++) { while ((g = BLI_pophead(&gc->bucket[i]))) { blf_glyph_free(g); } } if (gc->cur_tex != BLF_CURTEX_UNSET) glDeleteTextures((int)gc->cur_tex + 1, gc->textures); MEM_freeN((void *)gc->textures); MEM_freeN(gc); }
void blf_glyph_cache_free(GlyphCacheBLF *gc) { GlyphBLF *g; int i; for (i = 0; i < 257; i++) { while (gc->bucket[i].first) { g = gc->bucket[i].first; BLI_remlink(&(gc->bucket[i]), g); blf_glyph_free(g); } } if (gc->cur_tex+1 > 0) glDeleteTextures(gc->cur_tex+1, gc->textures); free((void *)gc->textures); MEM_freeN(gc); }
void blf_glyph_cache_clear(FontBLF *font) { GlyphCacheBLF *gc; GlyphBLF *g; int i; for (gc = font->cache.first; gc; gc = gc->next) { for (i = 0; i < 257; i++) { while (gc->bucket[i].first) { g = gc->bucket[i].first; BLI_remlink(&(gc->bucket[i]), g); blf_glyph_free(g); } } memset(gc->glyph_ascii_table, 0, sizeof(gc->glyph_ascii_table)); } }