From 135842b87d8e3eda3af6ea61b29c92bd03a7f321 Mon Sep 17 00:00:00 2001 From: John Zaitseff Date: Tue, 16 Aug 2011 16:25:28 +1000 Subject: [PATCH] Bug fix for non-colour mode If the background has A_REVERSE, then A_NORMAL will have no effect. For that reason, specify A_NORMAL as the default background after creating a new window. --- src/intf.c | 8 +++++++- src/intf.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/intf.c b/src/intf.c index 6896fa2..db3021f 100644 --- a/src/intf.c +++ b/src/intf.c @@ -86,6 +86,7 @@ struct convspec { ************************************************************************/ WINDOW *curwin = NULL; // Top-most (current) window +bool use_color = true; // True to use colour // Character renditions (attributes) used by Star Traders @@ -293,7 +294,8 @@ void init_screen (void) raw(); // Initialise all character renditions used in the game - if (! option_no_color && has_colors()) { + use_color = ! option_no_color && has_colors(); + if (use_color) { start_color(); init_pair(1, COLOR_BLACK, COLOR_WHITE); @@ -491,6 +493,10 @@ WINDOW *newtxwin (int nlines, int ncols, int begin_y, int begin_x, box(win, 0, 0); } + if (! use_color) { + wbkgdset(win, A_NORMAL); + } + return win; } diff --git a/src/intf.h b/src/intf.h index 5601ab3..f975dcf 100644 --- a/src/intf.h +++ b/src/intf.h @@ -118,6 +118,7 @@ typedef enum curs_type { ************************************************************************/ extern WINDOW *curwin; // Top-most (current) window +extern bool use_color; // True to use colour // Character renditions (attributes) used by Star Traders