fix use_inverse (aka wc_inverse) for curses
Highlighting for monsters shown due to extended monster detection and for lava shown in black and white didn't work because that keys off of 'iflags.use_inverse' (actually a macro for 'iflags.wc_inverse') and curses wasn't enabling that window-capability option. To be fair, it was probably unconditional at the time the curses interface was first developed. It checked for whether a monster was supposed to be drawn with inverse highlighting but wouldn't draw it that way because the flag was always false. Inverse b&w lava is relatively new and curses hadn't been taught about it. Various other things such as pets (if hilite_pet is on) and object piles (if hilite_pile is on) get highlighted with inverse video when use_color is off, regardless of whether use_inverse is on or off. That's probably a bug.
This commit is contained in:
@@ -29,7 +29,8 @@ extern long curs_mesg_suppress_turn; /* from cursmesg.c */
|
||||
/* Interface definition, for windows.c */
|
||||
struct window_procs curses_procs = {
|
||||
"curses",
|
||||
(WC_ALIGN_MESSAGE | WC_ALIGN_STATUS | WC_COLOR | WC_HILITE_PET
|
||||
(WC_ALIGN_MESSAGE | WC_ALIGN_STATUS | WC_COLOR | WC_INVERSE
|
||||
| WC_HILITE_PET
|
||||
#ifdef NCURSES_MOUSE_VERSION /* (this macro name works for PDCURSES too) */
|
||||
| WC_MOUSE_SUPPORT
|
||||
#endif
|
||||
@@ -675,6 +676,11 @@ curses_print_glyph(winid wid, XCHAR_P x, XCHAR_P y, int glyph,
|
||||
else
|
||||
attr = A_REVERSE;
|
||||
}
|
||||
/* water and lava look the same except for color; when color is off,
|
||||
render lava in inverse video so that they look different */
|
||||
if ((special & MG_BW_LAVA) && iflags.use_inverse) {
|
||||
attr = A_REVERSE; /* mapglyph() only sets this if color is off */
|
||||
}
|
||||
}
|
||||
|
||||
curses_putch(wid, x, y, ch, color, attr);
|
||||
|
||||
Reference in New Issue
Block a user