curses: don't change the terminal's default colors
The curses port changed some of the basic 8 terminal colors and all 8 bright colors on terminals supporting changing colors.
This commit is contained in:
@@ -747,6 +747,7 @@ curses: for vertical status, line up conditions in columns; usually two but
|
||||
[at present, highlighting with inverse video includes trailing spaces
|
||||
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
|
||||
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
|
||||
|
||||
@@ -369,52 +369,15 @@ curses_init_nhcolors(void)
|
||||
}
|
||||
|
||||
if (can_change_color()) {
|
||||
/* Preserve initial terminal colors */
|
||||
color_content(COLOR_YELLOW, &orig_yellow.r, &orig_yellow.g,
|
||||
&orig_yellow.b);
|
||||
color_content(COLOR_WHITE, &orig_white.r, &orig_white.g,
|
||||
&orig_white.b);
|
||||
|
||||
/* Set colors to appear as NetHack expects */
|
||||
init_color(COLOR_YELLOW, 500, 300, 0);
|
||||
init_color(COLOR_WHITE, 600, 600, 600);
|
||||
if (COLORS >= 16) {
|
||||
/* Preserve initial terminal colors */
|
||||
color_content(COLOR_RED + 8, &orig_hired.r,
|
||||
&orig_hired.g, &orig_hired.b);
|
||||
color_content(COLOR_GREEN + 8, &orig_higreen.r,
|
||||
&orig_higreen.g, &orig_higreen.b);
|
||||
color_content(COLOR_YELLOW + 8, &orig_hiyellow.r,
|
||||
&orig_hiyellow.g, &orig_hiyellow.b);
|
||||
color_content(COLOR_BLUE + 8, &orig_hiblue.r,
|
||||
&orig_hiblue.g, &orig_hiblue.b);
|
||||
color_content(COLOR_MAGENTA + 8, &orig_himagenta.r,
|
||||
&orig_himagenta.g, &orig_himagenta.b);
|
||||
color_content(COLOR_CYAN + 8, &orig_hicyan.r,
|
||||
&orig_hicyan.g, &orig_hicyan.b);
|
||||
color_content(COLOR_WHITE + 8, &orig_hiwhite.r,
|
||||
&orig_hiwhite.g, &orig_hiwhite.b);
|
||||
|
||||
/* Set colors to appear as NetHack expects */
|
||||
init_color(COLOR_RED + 8, 1000, 500, 0);
|
||||
init_color(COLOR_GREEN + 8, 0, 1000, 0);
|
||||
init_color(COLOR_YELLOW + 8, 1000, 1000, 0);
|
||||
init_color(COLOR_BLUE + 8, 0, 0, 1000);
|
||||
init_color(COLOR_MAGENTA + 8, 1000, 0, 1000);
|
||||
init_color(COLOR_CYAN + 8, 0, 1000, 1000);
|
||||
init_color(COLOR_WHITE + 8, 1000, 1000, 1000);
|
||||
# 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
|
||||
} else {
|
||||
/* Set flag to use bold for bright colors */
|
||||
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
|
||||
@@ -896,30 +859,12 @@ curses_cleanup(void)
|
||||
{
|
||||
#ifdef TEXTCOLOR
|
||||
if (has_colors() && can_change_color()) {
|
||||
init_color(COLOR_YELLOW, orig_yellow.r, orig_yellow.g, orig_yellow.b);
|
||||
init_color(COLOR_WHITE, orig_white.r, orig_white.g, orig_white.b);
|
||||
|
||||
if (COLORS >= 16) {
|
||||
init_color(COLOR_RED + 8, orig_hired.r, orig_hired.g, orig_hired.b);
|
||||
init_color(COLOR_GREEN + 8, orig_higreen.r, orig_higreen.g,
|
||||
orig_higreen.b);
|
||||
init_color(COLOR_YELLOW + 8, orig_hiyellow.r,
|
||||
orig_hiyellow.g, orig_hiyellow.b);
|
||||
init_color(COLOR_BLUE + 8, orig_hiblue.r, orig_hiblue.g,
|
||||
orig_hiblue.b);
|
||||
init_color(COLOR_MAGENTA + 8, orig_himagenta.r,
|
||||
orig_himagenta.g, orig_himagenta.b);
|
||||
init_color(COLOR_CYAN + 8, orig_hicyan.r, orig_hicyan.g,
|
||||
orig_hicyan.b);
|
||||
init_color(COLOR_WHITE + 8, orig_hiwhite.r, orig_hiwhite.g,
|
||||
orig_hiwhite.b);
|
||||
# ifdef USE_DARKGRAY
|
||||
if (COLORS > 16) {
|
||||
init_color(CURSES_DARK_GRAY, orig_darkgray.r,
|
||||
orig_darkgray.g, orig_darkgray.b);
|
||||
}
|
||||
# endif
|
||||
if (COLORS > 16) {
|
||||
init_color(CURSES_DARK_GRAY, orig_darkgray.r,
|
||||
orig_darkgray.g, orig_darkgray.b);
|
||||
}
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user