mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 21:57:57 +03:00
Added Com_DPrintf2 and Com_DebugPrintf
This commit is contained in:
parent
128c8f3c06
commit
e95d71da0d
2 changed files with 56 additions and 1 deletions
|
@ -37,8 +37,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
|
||||
#include "tiki.h"
|
||||
|
||||
#ifndef DEDICATED
|
||||
# include "../uilib/ui_public.h"
|
||||
#endif
|
||||
|
||||
qboolean CL_FinishedIntro(void);
|
||||
void UI_PrintConsole(const char* msg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -301,6 +304,56 @@ void QDECL Com_DPrintf( const char *fmt, ...) {
|
|||
Com_Printf ("%s", msg);
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
Com_DPrintf2
|
||||
|
||||
A Com_Printf that only shows up if the "developer" cvar is set
|
||||
================
|
||||
*/
|
||||
void QDECL Com_DPrintf2( const char *fmt, ...) {
|
||||
va_list argptr;
|
||||
char msg[MAXPRINTMSG];
|
||||
|
||||
if ( !developer || !developer->integer ) {
|
||||
return; // don't confuse non-developers with techie stuff...
|
||||
}
|
||||
|
||||
va_start (argptr,fmt);
|
||||
Q_vsnprintf (msg, sizeof(msg), fmt, argptr);
|
||||
va_end (argptr);
|
||||
|
||||
Com_Printf ("%s", msg);
|
||||
|
||||
#ifndef DEDICATED
|
||||
if (com_dedicated && !com_dedicated->integer) {
|
||||
UI_PrintDeveloperConsole(msg);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
Com_DebugPrintf
|
||||
|
||||
A Com_Printf that only shows up if the "developer" cvar is set
|
||||
================
|
||||
*/
|
||||
void QDECL Com_DebugPrintf( const char *fmt, ...) {
|
||||
va_list argptr;
|
||||
char msg[MAXPRINTMSG];
|
||||
|
||||
if ( !developer || !developer->integer ) {
|
||||
return; // don't confuse non-developers with techie stuff...
|
||||
}
|
||||
|
||||
va_start (argptr,fmt);
|
||||
Q_vsnprintf (msg, sizeof(msg), fmt, argptr);
|
||||
va_end (argptr);
|
||||
|
||||
Sys_DebugPrint (msg);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
|
@ -1262,6 +1262,8 @@ void Info_NextPair( const char **s, char *key, char *value );
|
|||
void QDECL Com_Error( int level, const char *error, ... ) __attribute__ ((format (printf, 2, 3)));
|
||||
void QDECL Com_Printf( const char *msg, ... ) __attribute__ ((format (printf, 1, 2)));
|
||||
void QDECL Com_DPrintf( const char *msg, ... ) __attribute__ ((format (printf, 1, 2)));
|
||||
void QDECL Com_DPrintf2( const char *msg, ... ) __attribute__ ((format (printf, 1, 2)));
|
||||
void QDECL Com_DebugPrintf( const char *msg, ... ) __attribute__ ((format (printf, 1, 2)));
|
||||
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue