From 5ff076c4e040563be94726ba8104444713c8a546 Mon Sep 17 00:00:00 2001 From: Nathan Vance Date: Sun, 7 Feb 2016 17:56:45 -0500 Subject: Bug fixes dealing with color --- io.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'io.c') diff --git a/io.c b/io.c index 0f39881..e7d99ac 100644 --- a/io.c +++ b/io.c @@ -50,6 +50,14 @@ int io_getkey() { } } +static void turn_off_attributes() { + int i; + for(i = 31; i <= 38; i++) + attroff(COLOR_PAIR(i)); + attroff(A_BLINK); + attroff(A_REVERSE); +} + void io_clearscreen() { clear(); } @@ -59,7 +67,8 @@ void io_printname(int x, int y, int era, int card) { attron(COLOR_PAIR(gettypecolor(cards_gettype(era, card)))); char array[40]; printw("%-23s", cards_getname(era, card, array)); - attrset(A_NORMAL); + //attrset(A_NORMAL); + turn_off_attributes(); printw(" #"); } @@ -227,5 +236,6 @@ void io_printplain(int x, int y, char *s) { void io_printcolor(int x, int y, int color, char *s) { attron(COLOR_PAIR(color)); io_printplain(x, y, s); - attrset(A_NORMAL); + //attrset(A_NORMAL); + turn_off_attributes(); } -- cgit