From 29855712a84f20ddbeac986601c230a3bcecdecc Mon Sep 17 00:00:00 2001 From: farisawan-2000 Date: Sun, 13 Dec 2020 22:30:24 -0500 Subject: [PATCH] initial tests for text speed --- s2d_parse.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/s2d_parse.c b/s2d_parse.c index c2be7e6f..86d52492 100644 --- a/s2d_parse.c +++ b/s2d_parse.c @@ -86,10 +86,17 @@ void s2d_print(int x, int y, const char *str, uObjMtx *buf) { ty = 0; } -void s2d_type_print(int x, int y, char *str, uObjMtx *buf, int pos) { - char t = str[pos]; - str[pos] = '\0'; - s2d_print(x, y, str, buf); - str[pos] = t; +void s2d_type_print(int x, int y, char *str, uObjMtx *buf, int *pos) { + char *temp_str = str; + char t = temp_str[*pos]; + switch(t) { + case CH_TRANSLATE: + CH_SKIP(temp_str); + s2d_atoi(temp_str, &temp_str); + } + temp_str[*pos] = '\0'; + s2d_print(x, y, temp_str, buf); + temp_str[*pos] = t; + (*pos)++; }