mirror of
https://github.com/UberGames/ioef.git
synced 2025-01-31 04:50:37 +00:00
Add ColorIndexForNumber macro replacing '& 0x07'
Makes it easier to add more colors.
This commit is contained in:
parent
eeef7cbae7
commit
18e08125dd
2 changed files with 4 additions and 3 deletions
|
@ -583,8 +583,8 @@ void Con_DrawNotify (void)
|
||||||
if ( ( text[x] & 0xff ) == ' ' ) {
|
if ( ( text[x] & 0xff ) == ' ' ) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ( ( (text[x]>>8)&7 ) != currentColor ) {
|
if ( ColorIndexForNumber( text[x]>>8 ) != currentColor ) {
|
||||||
currentColor = (text[x]>>8)&7;
|
currentColor = ColorIndexForNumber( text[x]>>8 );
|
||||||
re.SetColor( g_color_table[currentColor] );
|
re.SetColor( g_color_table[currentColor] );
|
||||||
}
|
}
|
||||||
SCR_DrawSmallChar( cl_conXOffset->integer + con.xadjust + (x+1)*SMALLCHAR_WIDTH, v, text[x] & 0xff );
|
SCR_DrawSmallChar( cl_conXOffset->integer + con.xadjust + (x+1)*SMALLCHAR_WIDTH, v, text[x] & 0xff );
|
||||||
|
|
|
@ -403,7 +403,8 @@ extern vec4_t colorDkGrey;
|
||||||
#define COLOR_CYAN '5'
|
#define COLOR_CYAN '5'
|
||||||
#define COLOR_MAGENTA '6'
|
#define COLOR_MAGENTA '6'
|
||||||
#define COLOR_WHITE '7'
|
#define COLOR_WHITE '7'
|
||||||
#define ColorIndex(c) (((c) - '0') & 0x07)
|
#define ColorIndexForNumber(c) ((c) & 0x07)
|
||||||
|
#define ColorIndex(c) (ColorIndexForNumber((c) - '0'))
|
||||||
|
|
||||||
#define S_COLOR_BLACK "^0"
|
#define S_COLOR_BLACK "^0"
|
||||||
#define S_COLOR_RED "^1"
|
#define S_COLOR_RED "^1"
|
||||||
|
|
Loading…
Reference in a new issue