MIRC colors >=16 changed to work as in MIRC (color %= 16)

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1066 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-01-04 19:20:09 +00:00 committed by cras
parent 93c0086d41
commit 59d46dcadf

View File

@ -33,7 +33,7 @@
#define TEXT_CHUNK_USABLE_SIZE (LINE_TEXT_CHUNK_SIZE-2-(int)sizeof(char*)) #define TEXT_CHUNK_USABLE_SIZE (LINE_TEXT_CHUNK_SIZE-2-(int)sizeof(char*))
int mirc_colors[] = { 15, 0, 1, 2, 12, 6, 5, 4, 14, 10, 3, 11, 9, 13, 8, 7, 15 }; int mirc_colors[] = { 15, 0, 1, 2, 12, 6, 5, 4, 14, 10, 3, 11, 9, 13, 8, 7 };
static int scrollback_lines, scrollback_hours; static int scrollback_lines, scrollback_hours;
static int scrollback_save_formats; static int scrollback_save_formats;
@ -247,10 +247,11 @@ static void remove_old_lines(WINDOW_REC *window)
static void get_colors(int flags, int *fg, int *bg) static void get_colors(int flags, int *fg, int *bg)
{ {
if (flags & PRINTFLAG_MIRC_COLOR) { if (flags & PRINTFLAG_MIRC_COLOR) {
/* mirc colors */ /* mirc colors - real range is 0..15, but after 16
*fg = *fg < 0 || *fg > 16 ? colors wrap to 0, 1, ... */
/*current_theme->default_color*/0 : mirc_colors[*fg]; *fg = *fg < 0 ?
*bg = *bg < 0 || *bg > 16 ? 0 : mirc_colors[*bg]; /*current_theme->default_color*/0 : mirc_colors[*fg % 16];
*bg = *bg < 0 ? 0 : mirc_colors[*bg % 16];
} else { } else {
/* default colors */ /* default colors */
*fg = *fg < 0 || *fg > 15 ? *fg = *fg < 0 || *fg > 15 ?