This commit is contained in:
farisawan-2000
2020-12-16 00:57:28 -05:00
parent a11d88c2a7
commit 8f7a3b6f0b
2 changed files with 9 additions and 2 deletions

View File

@@ -27,7 +27,8 @@ extern Gfx *gdl_head;
#define s2d_timer gGlobalTimer
// The equivalent vsprintf in your game (defaults to libultra _Printf)
#define vsprintf _Printf
#define vsprintf(dst, str, fmt, args) _Printf(proutSprintf, dst, fmt, args)
extern char *proutSprintf(char *dst, const char *src, size_t count);
// texture glyph width and height

View File

@@ -108,9 +108,15 @@ void s2d_type_print(int x, int y, const char *str, uObjMtx *buf, int *pos) {
}
void s2d_vsprint(int x, int y, uObjMtx *buf, const char *str, ...) {
int last_chr;
va_list args;
char *dst = alloc(s2d_strlen(str) * 2);
va_start(args, str);
// vsprintf(str, )
last_chr = vsprintf(dst, str, str, args);
if (last_chr >= 0) {
dst[last_chr] = '\0';
}
s2d_print(x, y, dst, buf);
}