THIS COMMIT MOST LIKELY BREAKS THINGS.
changed conchars from 16-bit to 32-bit added support for RGBI fg and bg colors better support for ^8/^9 text codes fix to echoish menu sounds added plugin stuff for centerprints/server messages/chat messages, not finalized (?) GL/SW color character functions improved (although neither handle transparent characters, and SW needs improvement with the palette remapping) git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1750 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
8ef3ae1182
commit
a8889d8f24
31 changed files with 632 additions and 575 deletions
|
@ -30,7 +30,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
//okay, so these are a quick but easy hack
|
||||
void ED_Print (struct progfuncs_s *progfuncs, struct edict_s *ed);
|
||||
int PR_EnableEBFSBuiltin(char *name, int binum);
|
||||
void PR_CleanLogText_Init (void);
|
||||
|
||||
cvar_t nomonsters = {"nomonsters", "0"};
|
||||
cvar_t gamecfg = {"gamecfg", "0"};
|
||||
|
@ -535,8 +534,6 @@ void PR_LoadGlabalStruct(void)
|
|||
|
||||
pr_items2 = !!PR_FindGlobal(svprogfuncs, "items2", 0);
|
||||
|
||||
PR_CleanLogText_Init();
|
||||
|
||||
SV_ClearQCStats();
|
||||
|
||||
if (progstype == PROG_H2)
|
||||
|
@ -5362,7 +5359,7 @@ void PF_redstring(progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
|||
static char buf[1024];
|
||||
|
||||
for (s = buf; *string; s++, string++)
|
||||
*s=*string|128;
|
||||
*s=*string|CON_HIGHCHARSMASK;
|
||||
*s = '\0';
|
||||
|
||||
RETURN_TSTRING(buf);
|
||||
|
@ -6836,66 +6833,46 @@ void PF_strstr (progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
|||
RETURN_TSTRING(p);
|
||||
}
|
||||
|
||||
/*
|
||||
====================
|
||||
SV_CleanName_Init
|
||||
|
||||
sets chararcter table to translate quake texts to more friendly texts
|
||||
====================
|
||||
*/
|
||||
|
||||
char chartbl2[256];
|
||||
|
||||
void PR_CleanLogText_Init (void)
|
||||
char readable2[256] =
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
chartbl2[i] = (i&127) < 32 ? ' ' : i&127;
|
||||
|
||||
chartbl2[13] = 13;
|
||||
chartbl2[10] = 10;
|
||||
// special cases
|
||||
|
||||
// numbers
|
||||
for (i = 18; i < 28; i++)
|
||||
chartbl2[i] = chartbl2[i + 128] = i + 30;
|
||||
|
||||
// brackets
|
||||
chartbl2[29] = chartbl2[29 + 128] = chartbl2[128] = '(';
|
||||
chartbl2[31] = chartbl2[31 + 128] = chartbl2[130] = ')';
|
||||
chartbl2[16] = chartbl2[16 + 128]= '[';
|
||||
chartbl2[17] = chartbl2[17 + 128] = ']';
|
||||
|
||||
// hash
|
||||
for (i = 1; i < 10; i++) // 5 redefined as '.'
|
||||
chartbl2[i] = chartbl2[i + 128] = '#';
|
||||
|
||||
chartbl2[11] = chartbl2[11 + 128] = '#';
|
||||
|
||||
// dot
|
||||
chartbl2[5] = chartbl2[14] = chartbl2[15] = chartbl2[28] = chartbl2[46] = '.';
|
||||
chartbl2[5 + 128] = chartbl2[14 + 128] = chartbl2[15 + 128] = chartbl2[28 + 128] = chartbl2[46 + 128] = '.';
|
||||
|
||||
// left arrow
|
||||
chartbl2[127] = '>';
|
||||
|
||||
// right arrow
|
||||
chartbl2[141] = '<';
|
||||
|
||||
// '='
|
||||
chartbl2[30] = chartbl2[129] = chartbl2[30 + 128] = '=';
|
||||
|
||||
// whitespaces
|
||||
chartbl2[12] = chartbl2[12 + 128] = chartbl2[138] = ' ';
|
||||
|
||||
chartbl2[33] = chartbl2[33 + 128]= '!';
|
||||
}
|
||||
'.', '_', '_', '_', '_', '.', '_', '_',
|
||||
'_', '_', '\n', '_', '\n', '>', '.', '.',
|
||||
'[', ']', '0', '1', '2', '3', '4', '5',
|
||||
'6', '7', '8', '9', '.', '_', '_', '_',
|
||||
' ', '!', '\"', '#', '$', '%', '&', '\'',
|
||||
'(', ')', '*', '+', ',', '-', '.', '/',
|
||||
'0', '1', '2', '3', '4', '5', '6', '7',
|
||||
'8', '9', ':', ';', '<', '=', '>', '?',
|
||||
'@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
|
||||
'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
|
||||
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
|
||||
'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
|
||||
'`', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
|
||||
'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
|
||||
'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
|
||||
'x', 'y', 'z', '{', '|', '}', '~', '_',
|
||||
'_', '_', '_', '_', '_', '.', '_', '_',
|
||||
'_', '_', '_', '_', '_', '>', '.', '.',
|
||||
'[', ']', '0', '1', '2', '3', '4', '5',
|
||||
'6', '7', '8', '9', '.', '_', '_', '_',
|
||||
' ', '!', '\"', '#', '$', '%', '&', '\'',
|
||||
'(', ')', '*', '+', ',', '-', '.', '/',
|
||||
'0', '1', '2', '3', '4', '5', '6', '7',
|
||||
'8', '9', ':', ';', '<', '=', '>', '?',
|
||||
'@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
|
||||
'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
|
||||
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
|
||||
'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
|
||||
'`', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
|
||||
'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
|
||||
'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
|
||||
'x', 'y', 'z', '{', '|', '}', '~', '_'
|
||||
};
|
||||
|
||||
void PR_CleanText(unsigned char *text)
|
||||
{
|
||||
for ( ; *text; text++)
|
||||
*text = chartbl2[*text];
|
||||
*text = readable2[*text];
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -899,8 +899,8 @@ void SV_MVDWritePackets (int num)
|
|||
demo.dbuf->maxsize = MAXSIZE + demo.dbuf->bufsize;
|
||||
}
|
||||
|
||||
static char chartbl[256];
|
||||
void CleanName_Init ();
|
||||
extern char readable[256];
|
||||
#define chartbl readable
|
||||
|
||||
void MVD_Init (void)
|
||||
{
|
||||
|
@ -918,15 +918,8 @@ void MVD_Init (void)
|
|||
Cvar_Register (&sv_demoSuffix, MVDVARGROUP);
|
||||
Cvar_Register (&sv_demotxt, MVDVARGROUP);
|
||||
Cvar_Register (&sv_demoExtraNames, MVDVARGROUP);
|
||||
|
||||
|
||||
CleanName_Init();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static char *SV_PrintTeams(void)
|
||||
{
|
||||
char *teams[MAX_CLIENTS];
|
||||
|
@ -1523,85 +1516,6 @@ static qboolean SV_MVD_Record (mvddest_t *dest)
|
|||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
====================
|
||||
SV_CleanName_Init
|
||||
|
||||
sets chararcter table for quake text->filename translation
|
||||
====================
|
||||
*/
|
||||
|
||||
void CleanName_Init ()
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
chartbl[i] = (((i&127) < 'a' || (i&127) > 'z') && ((i&127) < '0' || (i&127) > '9')) ? '_' : (i&127);
|
||||
|
||||
// special cases
|
||||
|
||||
// numbers
|
||||
for (i = 18; i < 29; i++)
|
||||
chartbl[i] = chartbl[i + 128] = i + 30;
|
||||
|
||||
// allow lowercase only
|
||||
for (i = 'A'; i <= 'Z'; i++)
|
||||
chartbl[i] = chartbl[i+128] = i + 'a' - 'A';
|
||||
|
||||
// brackets
|
||||
chartbl[29] = chartbl[29+128] = chartbl[128] = '(';
|
||||
chartbl[31] = chartbl[31+128] = chartbl[130] = ')';
|
||||
chartbl[16] = chartbl[16 + 128]= '[';
|
||||
chartbl[17] = chartbl[17 + 128] = ']';
|
||||
|
||||
// dot
|
||||
chartbl[5] = chartbl[14] = chartbl[15] = chartbl[28] = chartbl[46] = '.';
|
||||
chartbl[5 + 128] = chartbl[14 + 128] = chartbl[15 + 128] = chartbl[28 + 128] = chartbl[46 + 128] = '.';
|
||||
|
||||
// !
|
||||
chartbl[33] = chartbl[33 + 128] = '!';
|
||||
|
||||
// #
|
||||
chartbl[35] = chartbl[35 + 128] = '#';
|
||||
|
||||
// %
|
||||
chartbl[37] = chartbl[37 + 128] = '%';
|
||||
|
||||
// &
|
||||
chartbl[38] = chartbl[38 + 128] = '&';
|
||||
|
||||
// '
|
||||
chartbl[39] = chartbl[39 + 128] = '\'';
|
||||
|
||||
// (
|
||||
chartbl[40] = chartbl[40 + 128] = '(';
|
||||
|
||||
// )
|
||||
chartbl[41] = chartbl[41 + 128] = ')';
|
||||
|
||||
// +
|
||||
chartbl[43] = chartbl[43 + 128] = '+';
|
||||
|
||||
// -
|
||||
chartbl[45] = chartbl[45 + 128] = '-';
|
||||
|
||||
// @
|
||||
chartbl[64] = chartbl[64 + 128] = '@';
|
||||
|
||||
// ^
|
||||
// chartbl[94] = chartbl[94 + 128] = '^';
|
||||
|
||||
|
||||
chartbl[91] = chartbl[91 + 128] = '[';
|
||||
chartbl[93] = chartbl[93 + 128] = ']';
|
||||
|
||||
chartbl[16] = chartbl[16 + 128] = '[';
|
||||
chartbl[17] = chartbl[17 + 128] = ']';
|
||||
|
||||
chartbl[123] = chartbl[123 + 128] = '{';
|
||||
chartbl[125] = chartbl[125 + 128] = '}';
|
||||
}
|
||||
|
||||
/*
|
||||
====================
|
||||
SV_CleanName
|
||||
|
|
|
@ -41,8 +41,19 @@ cvar_t sys_linebuffer = {"sys_linebuffer", "1"};
|
|||
|
||||
qboolean stdin_ready;
|
||||
|
||||
|
||||
|
||||
// This is for remapping the Q3 color codes to character masks, including ^9
|
||||
conchar_t q3codemasks[MAXQ3COLOURS] = {
|
||||
0x00000000, // 0, black
|
||||
0x0c000000, // 1, red
|
||||
0x0a000000, // 2, green
|
||||
0x0e000000, // 3, yellow
|
||||
0x09000000, // 4, blue
|
||||
0x0b000000, // 5, cyan
|
||||
0x0d000000, // 6, magenta
|
||||
0x0f000000, // 7, white
|
||||
0x0f100000, // 8, half-alpha white (BX_COLOREDTEXT)
|
||||
0x07000000 // 9, "half-intensity" (BX_COLOREDTEXT)
|
||||
};
|
||||
|
||||
struct termios orig, changes;
|
||||
|
||||
|
@ -186,39 +197,64 @@ void Sys_Error (const char *error, ...)
|
|||
exit (1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int ansiremap[8] = {0, 4, 2, 6, 1, 5, 3, 7};
|
||||
void ApplyColour(unsigned int chr)
|
||||
{
|
||||
static int oldchar = 7*256;
|
||||
chr = chr&~255;
|
||||
static int oldchar = CON_WHITEMASK;
|
||||
int bg, fg;
|
||||
chr &= CON_FLAGSMASK;
|
||||
|
||||
if (oldchar == chr)
|
||||
return;
|
||||
oldchar = chr;
|
||||
switch(chr&CON_COLOURMASK)
|
||||
|
||||
printf("\e[0;"); // reset
|
||||
|
||||
if (chr & CON_BLINKTEXT)
|
||||
printf("5;"); // set blink
|
||||
|
||||
bg = chr & CON_BGMASK >> CON_BGSHIFT;
|
||||
fg = chr & CON_FGMASK >> CON_FGSHIFT;
|
||||
|
||||
// don't handle intensive bit for background
|
||||
// as terminals differ too much in displaying \e[1;7;3?m
|
||||
bg &= 0x7;
|
||||
|
||||
if (chr & CON_NONCLEARBG)
|
||||
{
|
||||
//to get around wierd defaults (like a white background) we have these special hacks for colours 0 and 7
|
||||
case 0*256:
|
||||
printf("\e[0;7%sm", (chr&CON_BLINKTEXT)?";5":"");
|
||||
break;
|
||||
case 7*256:
|
||||
printf("\e[0%sm", (chr&CON_BLINKTEXT)?";5":"");
|
||||
break;
|
||||
default:
|
||||
printf("\e[0;%i%sm", 30+((chr&CON_COLOURMASK)>>8), (chr&CON_BLINKTEXT)?";5":"");
|
||||
break;
|
||||
if (fg & 0x8) // intensive bit set for foreground
|
||||
{
|
||||
printf("1;"); // set bold/intensity ansi flag
|
||||
fg &= 0x7; // strip intensive bit
|
||||
}
|
||||
|
||||
// set foreground and background colors
|
||||
printf("3%i;4%im", ansiremap[fg], ansiremap[bg]);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(fg)
|
||||
{
|
||||
//to get around wierd defaults (like a white background) we have these special hacks for colours 0 and 7
|
||||
case COLOR_BLACK:
|
||||
printf("7m"); // set inverse
|
||||
break;
|
||||
case COLOR_GREY:
|
||||
printf("1;30m"); // treat as dark grey
|
||||
break;
|
||||
case COLOR_WHITE:
|
||||
print("m"); // set nothing else
|
||||
break;
|
||||
default:
|
||||
if (fg & 0x8) // intensive bit set for foreground
|
||||
{
|
||||
printf("1;"); // set bold/intensity ansi flag
|
||||
fg &= 0x7; // strip intensive bit
|
||||
}
|
||||
|
||||
printf("3%im", fg); // set foreground
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -227,7 +263,7 @@ void Sys_PrintColouredChar(unsigned int chr)
|
|||
{
|
||||
ApplyColour(chr);
|
||||
|
||||
putch(chr&255);
|
||||
putch(chr & CON_CHARMASK);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -292,7 +328,7 @@ void Sys_Printf (char *fmt, ...)
|
|||
|
||||
if (sys_colorconsole.value)
|
||||
{
|
||||
int ext = COLOR_WHITE<<8;
|
||||
int ext = CON_WHITEMASK;
|
||||
int extstack[4];
|
||||
int extstackdepth = 0;
|
||||
unsigned char *str = (unsigned char*)msg;
|
||||
|
@ -303,21 +339,21 @@ void Sys_Printf (char *fmt, ...)
|
|||
if (*str == '^')
|
||||
{
|
||||
str++;
|
||||
if (*str >= '0' && *str <= '7')
|
||||
if (*str >= '0' && *str <= '9')
|
||||
{
|
||||
ext = (*str++-'0')*256 + (ext&~CON_COLOURMASK); //change colour only.
|
||||
ext = q3codemasks[*str++-'0'] | (ext&~CON_Q3MASK); //change colour only.
|
||||
continue;
|
||||
}
|
||||
else if (*str == 'a')
|
||||
{
|
||||
str++;
|
||||
ext = (ext & ~CON_2NDCHARSETTEXT) + (CON_2NDCHARSETTEXT - (ext & CON_2NDCHARSETTEXT));
|
||||
ext ^= CON_2NDCHARSETTEXT;
|
||||
continue;
|
||||
}
|
||||
else if (*str == 'b')
|
||||
{
|
||||
str++;
|
||||
ext = (ext & ~CON_BLINKTEXT) + (CON_BLINKTEXT - (ext & CON_BLINKTEXT));
|
||||
ext ^= CON_BLINKTEXT;
|
||||
continue;
|
||||
}
|
||||
else if (*str == 's') //store on stack (it's great for names)
|
||||
|
@ -342,20 +378,20 @@ void Sys_Printf (char *fmt, ...)
|
|||
}
|
||||
else if (*str == '^')
|
||||
{
|
||||
Sys_PrintColouredChar('^' + ext);
|
||||
Sys_PrintColouredChar('^' | ext);
|
||||
str++;
|
||||
}
|
||||
else
|
||||
{
|
||||
Sys_PrintColouredChar('^' + ext);
|
||||
Sys_PrintColouredChar ((*str++) + ext);
|
||||
Sys_PrintColouredChar('^' | ext);
|
||||
Sys_PrintColouredChar ((*str++) | ext);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
Sys_PrintColouredChar ((*str++) + ext);
|
||||
Sys_PrintColouredChar ((*str++) | ext);
|
||||
}
|
||||
|
||||
ApplyColour(7*256);
|
||||
ApplyColour(CON_WHITEMASK);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -31,7 +31,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#endif
|
||||
#define SERVICENAME DISTRIBUTION"SV"
|
||||
|
||||
|
||||
// This is for remapping the Q3 color codes to character masks, including ^9
|
||||
conchar_t q3codemasks[MAXQ3COLOURS] = {
|
||||
0x00000000, // 0, black
|
||||
0x0c000000, // 1, red
|
||||
0x0a000000, // 2, green
|
||||
0x0e000000, // 3, yellow
|
||||
0x09000000, // 4, blue
|
||||
0x0b000000, // 5, cyan
|
||||
0x0d000000, // 6, magenta
|
||||
0x0f000000, // 7, white
|
||||
0x0f100000, // 8, half-alpha white (BX_COLOREDTEXT)
|
||||
0x07000000 // 9, "half-intensity" (BX_COLOREDTEXT)
|
||||
};
|
||||
|
||||
static HANDLE hconsoleout;
|
||||
static HINSTANCE game_library;
|
||||
|
@ -421,75 +433,54 @@ char *Sys_ConsoleInput (void)
|
|||
|
||||
void ApplyColour(unsigned int chr)
|
||||
{
|
||||
static int oldchar = 7*256;
|
||||
chr = chr&~255;
|
||||
static int oldchar = CON_WHITEMASK;
|
||||
chr &= CON_FLAGSMASK;
|
||||
|
||||
if (oldchar == chr)
|
||||
return;
|
||||
oldchar = chr;
|
||||
|
||||
#if 1
|
||||
if (hconsoleout)
|
||||
{
|
||||
int val;
|
||||
val = FOREGROUND_INTENSITY;
|
||||
switch(chr&CON_COLOURMASK)
|
||||
unsigned short val = 0;
|
||||
|
||||
// bits 28-31 of the console chars match up to the attributes for
|
||||
// the CHAR_INFO struct exactly
|
||||
if (chr & CON_NONCLEARBG)
|
||||
val = (chr & (CON_FGMASK|CON_BGMASK) >> CON_FGSHIFT);
|
||||
else
|
||||
{
|
||||
case 0*256:
|
||||
val = FOREGROUND_INTENSITY|FOREGROUND_INTENSITY; //don't allow secret messages (just hard to read)
|
||||
break;
|
||||
case 1*256:
|
||||
val = FOREGROUND_RED|FOREGROUND_INTENSITY;
|
||||
break;
|
||||
case 2*256:
|
||||
val = FOREGROUND_GREEN|FOREGROUND_INTENSITY;
|
||||
break;
|
||||
case 3*256:
|
||||
val = FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_INTENSITY;
|
||||
break;
|
||||
case 4*256:
|
||||
val = FOREGROUND_BLUE|FOREGROUND_INTENSITY;
|
||||
break;
|
||||
case 5*256:
|
||||
val = FOREGROUND_RED|FOREGROUND_BLUE|FOREGROUND_INTENSITY;
|
||||
break;
|
||||
case 6*256:
|
||||
val = FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_INTENSITY;
|
||||
break;
|
||||
case 7*256:
|
||||
val = FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE;
|
||||
break;
|
||||
int fg = (chr & CON_FGMASK) >> CON_FGSHIFT;
|
||||
|
||||
switch (fg)
|
||||
{
|
||||
case COLOR_BLACK: // reverse ^0 like the Linux version
|
||||
val = BACKGROUND_RED|BACKGROUND_GREEN|BACKGROUND_BLUE;
|
||||
break;
|
||||
case COLOR_WHITE: // reset to defaults?
|
||||
val = FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE; // use grey
|
||||
break;
|
||||
case COLOR_GREY:
|
||||
val = FOREGROUND_INTENSITY; // color light grey as dark grey
|
||||
break;
|
||||
default:
|
||||
val = fg; // send RGBI value as is
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ((chr & CON_HALFALPHA) && (val & ~FOREGROUND_INTENSITY))
|
||||
val &= ~FOREGROUND_INTENSITY; // strip intensity to fake alpha
|
||||
|
||||
SetConsoleTextAttribute(hconsoleout, val);
|
||||
}
|
||||
#else
|
||||
//does ansi work?
|
||||
//no?
|
||||
//windows sucks.
|
||||
switch(chr&CON_COLOURMASK)
|
||||
{
|
||||
case 0*256:
|
||||
printf("%c[%s;3%u;4%um", (char)27,
|
||||
(chr & CON_BLINKTEXT)? "01" : "00",
|
||||
(unsigned int)(0),
|
||||
(unsigned int)(0));
|
||||
break;
|
||||
default:
|
||||
printf("%c[%s;3%u;4%um", (char)27,
|
||||
(chr & CON_BLINKTEXT)? "01" : "00",
|
||||
(unsigned int)(7),
|
||||
(unsigned int)(0));
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void Sys_PrintColouredChar(unsigned int chr)
|
||||
{
|
||||
ApplyColour(chr);
|
||||
|
||||
printf("%c", chr&255);
|
||||
printf("%c", chr & CON_CHARMASK);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -551,7 +542,7 @@ void Sys_Printf (char *fmt, ...)
|
|||
|
||||
if (sys_colorconsole.value && hconsoleout)
|
||||
{
|
||||
int ext = COLOR_WHITE<<8;
|
||||
int ext = CON_WHITEMASK;
|
||||
int extstack[4];
|
||||
int extstackdepth = 0;
|
||||
unsigned char *str = (unsigned char*)msg;
|
||||
|
@ -562,21 +553,21 @@ void Sys_Printf (char *fmt, ...)
|
|||
if (*str == '^')
|
||||
{
|
||||
str++;
|
||||
if (*str >= '0' && *str <= '7')
|
||||
if (*str >= '0' && *str <= '9')
|
||||
{
|
||||
ext = (*str++-'0')*256 + (ext&~CON_COLOURMASK); //change colour only.
|
||||
ext = q3codemasks[*str++-'0'] | (ext&~CON_Q3MASK); //change colour only.
|
||||
continue;
|
||||
}
|
||||
else if (*str == 'a')
|
||||
{
|
||||
str++;
|
||||
ext = (ext & ~CON_2NDCHARSETTEXT) + (CON_2NDCHARSETTEXT - (ext & CON_2NDCHARSETTEXT));
|
||||
ext ^= CON_2NDCHARSETTEXT;
|
||||
continue;
|
||||
}
|
||||
else if (*str == 'b')
|
||||
{
|
||||
str++;
|
||||
ext = (ext & ~CON_BLINKTEXT) + (CON_BLINKTEXT - (ext & CON_BLINKTEXT));
|
||||
ext ^= CON_BLINKTEXT;
|
||||
continue;
|
||||
}
|
||||
else if (*str == 's') //store on stack (it's great for names)
|
||||
|
@ -601,20 +592,20 @@ void Sys_Printf (char *fmt, ...)
|
|||
}
|
||||
else if (*str == '^')
|
||||
{
|
||||
Sys_PrintColouredChar('^' + ext);
|
||||
Sys_PrintColouredChar('^' | ext);
|
||||
str++;
|
||||
}
|
||||
else
|
||||
{
|
||||
Sys_PrintColouredChar('^' + ext);
|
||||
Sys_PrintColouredChar ((*str++) + ext);
|
||||
Sys_PrintColouredChar('^' | ext);
|
||||
Sys_PrintColouredChar ((*str++) | ext);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
Sys_PrintColouredChar ((*str++) + ext);
|
||||
Sys_PrintColouredChar ((*str++) | ext);
|
||||
}
|
||||
|
||||
ApplyColour(7*256);
|
||||
ApplyColour(CON_WHITEMASK);
|
||||
}
|
||||
else
|
||||
printf("%s", msg);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue