From 884dacd65450c604181799853182287162cb6ded Mon Sep 17 00:00:00 2001 From: TimeServ Date: Thu, 6 Apr 2006 08:33:47 +0000 Subject: [PATCH] fixes to sys_colorconsole git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2166 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/console.h | 2 +- engine/server/sv_sys_unix.c | 5 +++-- engine/server/sv_sys_win.c | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/common/console.h b/engine/common/console.h index c0cea3a5f..5670620da 100644 --- a/engine/common/console.h +++ b/engine/common/console.h @@ -85,7 +85,7 @@ extern conchar_t q3codemasks[MAXQ3COLOURS]; #define CON_TEXTSIZE 16384 -#define isextendedcode(x) ((x >= '0' && x <= '9') || (x >= 'A' && x <= 'F') || x == '-') +#define isextendedcode(x) (((x) >= '0' && (x) <= '9') || ((x) >= 'A' && (x) <= 'F') || (x) == '-') typedef struct console_s { diff --git a/engine/server/sv_sys_unix.c b/engine/server/sv_sys_unix.c index 4317f8604..6213efebf 100644 --- a/engine/server/sv_sys_unix.c +++ b/engine/server/sv_sys_unix.c @@ -265,12 +265,14 @@ void Sys_PrintColouredChar(unsigned int chr) { ApplyColour(chr); + chr = chr & CON_CHARMASK; + if ((chr > 128 || chr < 32) && chr != 10 && chr != 13 && chr != 9) printf("[%02x]", chr); else chr &= ~0x80; - putch(chr & CON_CHARMASK); + putch(chr); } /* @@ -372,7 +374,6 @@ void Sys_Printf (char *fmt, ...) continue; } Sys_PrintColouredChar('^' | ext); - Sys_PrintColouredChar('&' | ext); // else invalid code } else if (*str == 'a') diff --git a/engine/server/sv_sys_win.c b/engine/server/sv_sys_win.c index a7ad57158..6917b39ba 100644 --- a/engine/server/sv_sys_win.c +++ b/engine/server/sv_sys_win.c @@ -582,7 +582,6 @@ void Sys_Printf (char *fmt, ...) continue; } Sys_PrintColouredChar('^' | ext); - Sys_PrintColouredChar('&' | ext); // else invalid code } else if (*str == 'a')