aboutsummaryrefslogtreecommitdiff
path: root/dc
diff options
context:
space:
mode:
Diffstat (limited to 'dc')
-rw-r--r--dc/dc.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/dc/dc.c b/dc/dc.c
index b68988e..99f9cf1 100644
--- a/dc/dc.c
+++ b/dc/dc.c
@@ -13,7 +13,7 @@
#define TILE_SIZE 16
struct ty_image img;
-struct ty_font font;
+struct ty_font font = {};
double last_frame = 0;
@@ -182,8 +182,14 @@ int main(void)
ty_free_image(img);
ty_free_image(font_img);
- for (int i = 0; i < CHAR_MAX; i++)
- ty_free_image(font.glyphs[i]);
+ for (int i = 0; i < CHAR_MAX; i++) {
+ if (i >= 'a' && i <= 'z')
+ continue;
+ struct ty_image glyph = font.glyphs[i];
+ if (glyph.width * glyph.height == 0)
+ continue;
+ ty_free_image(glyph);
+ }
ty_deinit();
return 0;