added Sys_DebugPrintf

This commit is contained in:
myT 2022-04-10 21:24:36 +02:00
parent fa1cee73e0
commit 1317ce54cb
3 changed files with 25 additions and 0 deletions

View file

@ -740,3 +740,8 @@ sysEvent_t Sys_GetEvent()
ev.evTime = Sys_Milliseconds();
return ev;
}
void Sys_DebugPrintf( const char*, ... )
{
}

View file

@ -1148,6 +1148,9 @@ void Sys_Sleep( int ms );
void Sys_MicroSleep( int us );
int64_t Sys_Microseconds();
// prints text in the debugger's output window
void Sys_DebugPrintf( const char* fmt, ... );
#ifndef DEDICATED
qbool Sys_IsMinimized();
#endif

View file

@ -126,3 +126,20 @@ int Sys_GetUptimeSeconds( qbool parent )
return seconds;
}
void Sys_DebugPrintf( const char* fmt, ... )
{
char buffer[1024];
va_list argptr;
va_start(argptr, fmt);
const int len = vsprintf(buffer, fmt, argptr);
va_end(argptr);
if (len < 0)
return;
if (len >= sizeof(buffer))
buffer[sizeof(buffer) - 1] = '\0';
OutputDebugStringA(buffer);
}