From 86ad3590d558235f9e5fb7a9ad0072c4bd98787d Mon Sep 17 00:00:00 2001 From: Pan7 Date: Thu, 28 Aug 2014 19:15:54 -0500 Subject: Add ColorIndexForNumber macro replacing '& 0x07' Makes it easier to add more colors. --- src/qcommon/q_shared.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/qcommon') diff --git a/src/qcommon/q_shared.h b/src/qcommon/q_shared.h index 3f4f0780..9de2d8f2 100644 --- a/src/qcommon/q_shared.h +++ b/src/qcommon/q_shared.h @@ -395,7 +395,8 @@ extern vec4_t colorDkGrey; #define COLOR_CYAN '5' #define COLOR_MAGENTA '6' #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_RED "^1" -- cgit