mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-26 13:50:53 +00:00
Basic ezQuake color code stripping.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2832 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
a6617581c8
commit
69ca88da5c
2 changed files with 13 additions and 0 deletions
|
@ -694,6 +694,18 @@ void Con_PrintCon (console_t *con, char *txt)
|
|||
continue;
|
||||
}
|
||||
}
|
||||
if (c == '&' && txt[1] == 'c')
|
||||
{
|
||||
// ezQuake color codes
|
||||
|
||||
if (ishexcode(txt[2]) && ishexcode(txt[3]) && ishexcode(txt[4]))
|
||||
{
|
||||
// Just strip it for now
|
||||
// TODO: Colorize the console properly
|
||||
txt += 5;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (c=='\t')
|
||||
c = ' ';
|
||||
|
||||
|
|
|
@ -86,6 +86,7 @@ extern conchar_t q3codemasks[MAXQ3COLOURS];
|
|||
#define CON_TEXTSIZE 16384
|
||||
|
||||
#define isextendedcode(x) ((x >= '0' && x <= '9') || (x >= 'A' && x <= 'F') || x == '-')
|
||||
#define ishexcode(x) ((x >= '0' && x <= '9') || (x >= 'A' && x <= 'F') || (x >= 'a' && x <= 'f'))
|
||||
|
||||
typedef struct console_s
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue