diff --git a/doc/fixes37.0 b/doc/fixes37.0 index d8545d64f..1cad98681 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -748,6 +748,7 @@ curses: for vertical status, line up conditions in columns; usually two but used to align entries in their columns--that's a feature...] curses: indent items in perm_invent window by one space curses: don't change the terminal's default colors +curses: remove unnecessary special handling for dark gray macOS: Xcode project was failing to build if the path to the NetHack source tree contained a space; the issue was within some shell script code contained within the project diff --git a/win/curses/cursinit.c b/win/curses/cursinit.c index fa8ebd638..43324b724 100644 --- a/win/curses/cursinit.c +++ b/win/curses/cursinit.c @@ -358,6 +358,11 @@ curses_init_nhcolors(void) if (COLORS >= 16) { +# ifdef USE_DARKGRAY + if (iflags.wc2_darkgray) { + init_pair(1, COLOR_BLACK + 8, -1); + } +# endif init_pair(9, COLOR_WHITE, -1); init_pair(10, COLOR_RED + 8, -1); init_pair(11, COLOR_GREEN + 8, -1); @@ -367,18 +372,6 @@ curses_init_nhcolors(void) init_pair(15, COLOR_CYAN + 8, -1); init_pair(16, COLOR_WHITE + 8, -1); } - - if (can_change_color()) { -# ifdef USE_DARKGRAY - if (COLORS > 16) { - color_content(CURSES_DARK_GRAY, &orig_darkgray.r, - &orig_darkgray.g, &orig_darkgray.b); - init_color(CURSES_DARK_GRAY, 300, 300, 300); - /* just override black colorpair entry here */ - init_pair(1, CURSES_DARK_GRAY, -1); - } -# endif - } } #endif } @@ -857,14 +850,4 @@ curses_display_splash_window(void) void curses_cleanup(void) { -#ifdef TEXTCOLOR - if (has_colors() && can_change_color()) { -# ifdef USE_DARKGRAY - if (COLORS > 16) { - init_color(CURSES_DARK_GRAY, orig_darkgray.r, - orig_darkgray.g, orig_darkgray.b); - } -# endif - } -#endif } diff --git a/win/curses/cursmisc.c b/win/curses/cursmisc.c index 50703c0b9..b65364a58 100644 --- a/win/curses/cursmisc.c +++ b/win/curses/cursmisc.c @@ -100,7 +100,7 @@ curses_toggle_color_attr(WINDOW *win, int color, int attr, int onoff) if (color == 0) { /* make black fg visible */ # ifdef USE_DARKGRAY if (iflags.wc2_darkgray) { - if (can_change_color() && (COLORS > 16)) { + if (COLORS > 16) { /* colorpair for black is already darkgray */ } else { /* Use bold for a bright black */ wattron(win, A_BOLD); @@ -135,7 +135,7 @@ curses_toggle_color_attr(WINDOW *win, int color, int attr, int onoff) wattroff(win, A_BOLD); } # ifdef USE_DARKGRAY - if ((color == 0) && (!can_change_color() || (COLORS <= 16))) { + if ((color == 0) && (COLORS <= 16)) { wattroff(win, A_BOLD); } # else diff --git a/win/curses/cursstat.c b/win/curses/cursstat.c index b526da112..c754d75ee 100644 --- a/win/curses/cursstat.c +++ b/win/curses/cursstat.c @@ -1553,7 +1553,7 @@ curses_color_attr(int nh_color, int bg_color) if (!nh_color) { #ifdef USE_DARKGRAY if (iflags.wc2_darkgray) { - if (!can_change_color() || COLORS <= 16) + if (COLORS <= 16) cattr |= A_BOLD; } else #endif