From e7a9014f862a466d9252b4e6dba8b50ffa8bb276 Mon Sep 17 00:00:00 2001 From: itsmattkc <34096995+itsmattkc@users.noreply.github.com> Date: Mon, 30 Oct 2023 20:42:29 -0700 Subject: [PATCH] debug to messagebox rather than file --- wrappers/debug.c | 15 +++++++++++---- wrappers/debug.h | 1 + 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/wrappers/debug.c b/wrappers/debug.c index ae5be66..b769565 100644 --- a/wrappers/debug.c +++ b/wrappers/debug.c @@ -4,21 +4,23 @@ #include #include -#define DEBUG_MINIMUM_LEVEL TRACE_IMPLEMENTED +#define DEBUG_MINIMUM_LEVEL TRACE_UNIMPLEMENTED #undef Trace void Trace(int level, const char *s, ...) { va_list args; - FILE *fptr; + //FILE *fptr; char buf[1024]; - DWORD le = GetLastError(); + DWORD le; if (level < DEBUG_MINIMUM_LEVEL) { return; } - va_start(args, s); + le = GetLastError(); + + /*va_start(args, s); _vsnprintf(buf, 1024, s, args); @@ -26,7 +28,12 @@ void Trace(int level, const char *s, ...) fprintf(fptr, "%s\n", buf); fclose(fptr); + va_end(args);*/ + + va_start(args, s); + _vsnprintf(buf, 1024, s, args); va_end(args); + MessageBoxA(0, buf, 0, 0); SetLastError(le); } diff --git a/wrappers/debug.h b/wrappers/debug.h index f0c95c6..0d19c40 100644 --- a/wrappers/debug.h +++ b/wrappers/debug.h @@ -4,6 +4,7 @@ #define TRACE_FORCE_DONT_PRINT -1 #define TRACE_PASSTHROUGH 0 #define TRACE_IMPLEMENTED 1 +#define TRACE_POTENTIAL_ERROR 1 #define TRACE_UNIMPLEMENTED 2 #define TRACE_UNEXPECTED_ERROR 3 #define TRACE_FORCE_PRINT 99