mirror of
https://bitbucket.org/CPMADevs/cnq3
synced 2024-11-10 06:31:48 +00:00
added Sys_DebugPrintf
This commit is contained in:
parent
fa1cee73e0
commit
1317ce54cb
3 changed files with 25 additions and 0 deletions
|
@ -740,3 +740,8 @@ sysEvent_t Sys_GetEvent()
|
|||
ev.evTime = Sys_Milliseconds();
|
||||
return ev;
|
||||
}
|
||||
|
||||
|
||||
void Sys_DebugPrintf( const char*, ... )
|
||||
{
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue