Con_Printf actually has a use after all: it prints to the console /only/ (no redirects, etc)

This commit is contained in:
Bill Currie 2007-11-07 08:19:17 +00:00 committed by Jeff Teunissen
parent 2b81eaea6c
commit 1a307e306f
3 changed files with 16 additions and 1 deletions

View file

@ -89,6 +89,7 @@ extern struct console_data_s con_data;
void Con_CheckResize (void);
void Con_DrawConsole (void);
VISIBLE void Con_Printf (const char *fmt, ...);
void Con_Print (const char *fmt, va_list args);
void Con_ToggleConsole_f (void);

View file

@ -133,6 +133,19 @@ Con_Shutdown (void)
}
}
VISIBLE void
Con_Printf (const char *fmt, ...)
{
va_list args;
va_start (args, fmt);
if (con_module)
con_module->functions->console->pC_Print (fmt, args);
else
vfprintf (stdout, fmt, args);
va_end (args);
}
VISIBLE void
Con_Print (const char *fmt, va_list args)
{

View file

@ -43,6 +43,7 @@ static __attribute__ ((used)) const char rcsid[] =
#include <time.h>
#include "QF/cvar.h"
#include "QF/console.h"
#include "QF/dstring.h"
#include "QF/msg.h"
#include "QF/sound.h" // FIXME: DEFAULT_SOUND_PACKET_*
@ -233,7 +234,7 @@ SV_Print (const char *fmt, va_list args)
pending = 0;
}
Sys_Printf ("%s", msg2); // also echo to debugging console
Con_Printf ("%s", msg2); // also echo to debugging console
}
}