Integrated ncurses color functions to replace my raw escape characters I used for color.

modified:   src/nms.h
This commit is contained in:
Brian Barto 2016-04-14 16:25:16 -04:00
parent 46fc803fe7
commit a82d55717a

View File

@ -12,10 +12,6 @@
#define NEWLINE 10 #define NEWLINE 10
#define TAB 9 #define TAB 9
#define KNRM "\x1B[0m"
#define KMAG "\x1B[35m"
#define KCYN "\x1B[36m"
struct winpos { struct winpos {
char source; char source;
char mask; char mask;
@ -176,11 +172,17 @@ void nmsexec(void) {
list_pointer->mask = getMaskChar(); list_pointer->mask = getMaskChar();
} else { } else {
list_pointer->mask = list_pointer->source; list_pointer->mask = list_pointer->source;
//printf(KCYN); attron(A_BOLD);
if (has_colors())
attron(COLOR_PAIR(1));
} }
mvaddch(list_pointer->row, list_pointer->col, list_pointer->mask); mvaddch(list_pointer->row, list_pointer->col, list_pointer->mask);
refresh(); refresh();
list_pointer = list_pointer->next; list_pointer = list_pointer->next;
attroff(A_BOLD);
if (has_colors())
attroff(COLOR_PAIR(1));
} }
usleep(ms * 1000); usleep(ms * 1000);
} }