From 1a307e306f45903aa0839710e28240cf95b8791d Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 7 Nov 2007 08:19:17 +0000 Subject: [PATCH] Con_Printf actually has a use after all: it prints to the console /only/ (no redirects, etc) --- include/QF/console.h | 1 + libs/console/console.c | 13 +++++++++++++ qw/source/sv_send.c | 3 ++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/include/QF/console.h b/include/QF/console.h index 89b624a76..6f6fb1436 100644 --- a/include/QF/console.h +++ b/include/QF/console.h @@ -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); diff --git a/libs/console/console.c b/libs/console/console.c index 2e6778ed0..b1d2a4f45 100644 --- a/libs/console/console.c +++ b/libs/console/console.c @@ -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) { diff --git a/qw/source/sv_send.c b/qw/source/sv_send.c index 5da4ef842..90fe92035 100644 --- a/qw/source/sv_send.c +++ b/qw/source/sv_send.c @@ -43,6 +43,7 @@ static __attribute__ ((used)) const char rcsid[] = #include #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 } }