Skip to content

Commit

Permalink
Remove the no_dark_brand option (|amethyst)
Browse files Browse the repository at this point in the history
The option was retooled as a workaround for terminals with a broken
 bright black colour.  For these terminals, darkgrey may be displayed
 as black due to the terminal's implementation or a bogus default colour
 palette.

However:

 * These terminals are quite rare.

 * The default values for the other bright color assumption options
   provide protection against invisible darkgrey-on-black glyphs.

 * no_dark_brand's dependence on other rendering options is not
   obvious at first glance.

   This creates an additional configuration burden for users who wish
   to allow rendering of darkgrey-on-black on capable terminals.

 * If a user insists on using a terminal with a broken darkgrey while
   enabling bright colour assumptions, invisible glyphs may be avoided
   by setting the colour.darkgrey option to any non-darkgrey colour.
  • Loading branch information
John Olender committed Nov 23, 2016
1 parent 05fa499 commit e35ada9
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 39 deletions.
13 changes: 2 additions & 11 deletions crawl-ref/docs/options_guide.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ The contents of this text are:
5-b DOS and Windows.
dos_use_background_intensity
5-c Unix.
no_dark_brand, blink_brightens_background,
bold_brightens_foreground, best_effort_brighten_background,
blink_brightens_background, bold_brightens_foreground,
best_effort_brighten_background,
best_effort_brighten_foreground, background_colour,
foreground_colour, use_fake_cursor

Expand Down Expand Up @@ -2508,15 +2508,6 @@ dos_use_background_intensity = false

5-c Unix.
-------------
no_dark_brand = true
Assume that dark grey will end up rendered identically to black.
I.e., bright black rendering is assumed to be broken for the terminal.

For a value of false to take effect, appropriate rendering assumptions
must also be enabled. See the blink_brightens_background,
bold_brightens_foreground, and allow_extended_colours options for more
details.

blink_brightens_background = false
For 8-colour mode, assume that a blink text attribute will end up
brightening the background colour.
Expand Down
5 changes: 0 additions & 5 deletions crawl-ref/source/initfile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,6 @@ const vector<GameOption*> game_options::build_options_list()
new BoolGameOption(SIMPLE_NAME(auto_butcher), false),
new BoolGameOption(SIMPLE_NAME(easy_eat_chunks), false),
new BoolGameOption(SIMPLE_NAME(auto_eat_chunks), true),
// This is useful for terms where dark grey does
// not have standout modes (since it's black on black).
// This option will use light-grey instead in these cases.
new BoolGameOption(SIMPLE_NAME(no_dark_brand), true),
new BoolGameOption(SIMPLE_NAME(blink_brightens_background), false),
new BoolGameOption(SIMPLE_NAME(bold_brightens_foreground), false),
new BoolGameOption(SIMPLE_NAME(best_effort_brighten_background), true),
Expand Down Expand Up @@ -229,7 +225,6 @@ const vector<GameOption*> game_options::build_options_list()
CHATTR_HILITE | (YELLOW << 8)),
new CursesGameOption(SIMPLE_NAME(feature_item_brand), CHATTR_REVERSE),
new CursesGameOption(SIMPLE_NAME(trap_item_brand), CHATTR_REVERSE),
// no_dark_brand applies here as well.
new CursesGameOption(SIMPLE_NAME(heap_brand), CHATTR_REVERSE),
new IntGameOption(SIMPLE_NAME(note_hp_percent), 5, 0, 100),
new IntGameOption(SIMPLE_NAME(hp_warning), 30, 0, 100),
Expand Down
1 change: 0 additions & 1 deletion crawl-ref/source/l_option.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ static option_handler handlers[] =
{ "easy_unequip", &Options.easy_unequip, option_hboolean },
{ "note_skill_max", &Options.note_skill_max, option_hboolean },
{ "clear_messages", &Options.clear_messages, option_hboolean },
{ "no_dark_brand", &Options.no_dark_brand, option_hboolean },
{ "blink_brightens_background", &Options.blink_brightens_background,
option_hboolean },
{ "bold_brightens_foreground", &Options.bold_brightens_foreground,
Expand Down
21 changes: 0 additions & 21 deletions crawl-ref/source/libunix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1115,27 +1115,6 @@ static short curs_get_fg_color_non_identical(short fg, short bg)
}
}

// Special case: bright black, due to the history of broken terminals.
if (Options.no_dark_brand)
{
const short curses_black = translate_colour(BLACK);
const short curses_darkgrey = translate_colour(DARKGREY);
short * colours_to_change[] =
{
&fg_to_compare,
&bg_to_compare,
&fg_default_to_compare,
&bg_default_to_compare
};

// Convert any darkgreys to black.
for (size_t i = 0; i < ARRAYSZ(colours_to_change); i++)
{
if (*(colours_to_change[i]) == curses_darkgrey)
*(colours_to_change[i]) = curses_black;
}
}

// Got the adjusted colors -- resolve any conflict.
if (fg_to_compare == bg_to_compare)
{
Expand Down
1 change: 0 additions & 1 deletion crawl-ref/source/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ struct game_options
bool small_more; // Show one-char more prompts.
unsigned friend_brand; // Attribute for branding friendly monsters
unsigned neutral_brand; // Attribute for branding neutral monsters
bool no_dark_brand; // Assume dark grey is displayed as black.
bool blink_brightens_background; // Assume blink will brighten bg.
bool bold_brightens_foreground; // Assume bold will brighten fg.
bool best_effort_brighten_background; // Allow bg brighten attempts.
Expand Down

0 comments on commit e35ada9

Please sign in to comment.