added \t, \v, \n

This commit is contained in:
farisawan-2000
2020-12-15 23:36:40 -05:00
parent 9597bc91c3
commit 7405b27509
2 changed files with 12 additions and 2 deletions

View File

@@ -33,6 +33,7 @@ extern Gfx *gdl_head;
// texture glyph width and height
#define TEX_WIDTH 16
#define TEX_HEIGHT 16
#define TAB_WIDTH_H TEX_WIDTH * 2
#define TAB_WIDTH_V TEX_WIDTH / 2
#endif

View File

@@ -21,7 +21,9 @@ void s2d_snprint(int x, int y, const char *str, uObjMtx *buf, int len) {
int tmp_len = 0;
int orig_x = x;
int orig_y = y;
// int r = 0, g = 0, b = 0, a = 0;
s2d_red = s2d_green = s2d_blue = 255;
s2d_alpha = 255;
if (*p == '\0') return;
do {
char r = *p;
@@ -65,6 +67,13 @@ void s2d_snprint(int x, int y, const char *str, uObjMtx *buf, int len) {
x = orig_x;
y += TEX_HEIGHT;
break;
case '\t':
x += TAB_WIDTH_H;
break;
case '\v':
x += TAB_WIDTH_V;
y += TEX_HEIGHT;
break;
default:
// if (s2d_colorFrames > 2) {
// s2d_colorFrames = 0;