summaryrefslogtreecommitdiff
path: root/font.c
diff options
context:
space:
mode:
Diffstat (limited to 'font.c')
-rw-r--r--font.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/font.c b/font.c
index 1f6d7e5..90acaee 100644
--- a/font.c
+++ b/font.c
@@ -16,8 +16,9 @@ void font_draw(int x, int y, const char *s, int size)
const int ox = x;
TZR_DrawSetColor(1, 1, 1, 1);
for (; *s != '\0' && size > 0; s++, size--) {
- const int ix = *s % 16 * 8;
- const int iy = *s / 16 * 16;
+ const char c = toupper(*s);
+ const int ix = c % 16 * FONT_W;
+ const int iy = c / 16 * FONT_H;
switch (*s) {
case '\n':
y += 1;
@@ -35,13 +36,17 @@ void font_draw(int x, int y, const char *s, int size)
case 'W':
TZR_DrawSetColor(1, 1, 1);
break;
+ case 'D':
+ TZR_DrawSetColor(0.5, 0.5, 0.5);
+ break;
default:
- TZR_DrawImage(___font_spr, x*8, y*16, ix, iy, 8, 16);
+ TZR_DrawImage(___font_spr, x*FONT_W, y*FONT_H, ix, iy,
+ FONT_W, FONT_H);
x += 1;
break;
}
}
TZR_DrawSetColor(1, 1, 1);
if (TZR_GetTick() / 30 % 2)
- TZR_DrawRectangle(true, x*8, y*16+1, 1, 14);
+ TZR_DrawRectangle(true, x*FONT_W, y*FONT_H+1, 1, FONT_H-2);
}