corridor engravings in black and white

The default engraving-in-corridor character is the same as the default
corridor symbol (and also default lit corridor one), distinguished by
color.  Show it differently (in inverse vidoe, like lava vs water and
sink vs fountain) if color is Off.

It might be better to change the engraving-in-room symbol to be the
same as the room one so that they'll be more consistent with corridors;
color is probably sufficient without resorting to back-tick.  But this
update hasn't done that.
This commit is contained in:
PatR
2023-09-12 01:34:47 -07:00
parent 9016d65df4
commit 6636db94e7
6 changed files with 54 additions and 39 deletions
+1
View File
@@ -1026,6 +1026,7 @@ enum glyph_offsets {
#define MG_BW_ICE 0x00200 /* similar for ice vs floor */ #define MG_BW_ICE 0x00200 /* similar for ice vs floor */
#define MG_BW_SINK 0x00200 /* identical for sink vs fountain [note: someday #define MG_BW_SINK 0x00200 /* identical for sink vs fountain [note: someday
* this may become a distinct flag */ * this may become a distinct flag */
#define MG_BW_ENGR 0x00200 /* likewise for corridor engravings */
#define MG_NOTHING 0x00400 /* char represents GLYPH_NOTHING */ #define MG_NOTHING 0x00400 /* char represents GLYPH_NOTHING */
#define MG_UNEXPL 0x00800 /* char represents GLYPH_UNEXPLORED */ #define MG_UNEXPL 0x00800 /* char represents GLYPH_UNEXPLORED */
#define MG_MALE 0x01000 /* represents a male mon or statue of one */ #define MG_MALE 0x01000 /* represents a male mon or statue of one */
+33 -26
View File
@@ -2727,34 +2727,35 @@ reset_glyphmap(enum glyphmap_change_triggers trigger)
zap_color((offset >> 2)); zap_color((offset >> 2));
} else if ((offset = (glyph - GLYPH_CMAP_B_OFF)) >= 0) { } else if ((offset = (glyph - GLYPH_CMAP_B_OFF)) >= 0) {
int cmap = S_grave + offset; int cmap = S_grave + offset;
int sym = gs.showsyms[cmap + SYM_OFF_P];
gmap->sym.symidx = cmap + SYM_OFF_P; gmap->sym.symidx = cmap + SYM_OFF_P;
cmap_color(cmap); cmap_color(cmap);
if (!iflags.use_color) { if (!iflags.use_color) {
unsigned spec_cmap = 0;
/* try to provide a visible difference between water and lava /* try to provide a visible difference between water and lava
if they use the same symbol and color is disabled */ if they use the same symbol and color is disabled;
if ((cmap == S_lava || cmap == S_lavawall) similar for floor and ice, for fountain vs sink, and for
&& (gs.showsyms[gmap->sym.symidx] corridor engravings (CMAP_A below) */
== gs.showsyms[S_pool + SYM_OFF_P] switch (cmap) {
|| gs.showsyms[gmap->sym.symidx] case S_lava:
== gs.showsyms[S_water + SYM_OFF_P])) { case S_lavawall:
gmap->glyphflags |= MG_BW_LAVA; if (sym == gs.showsyms[S_pool + SYM_OFF_P]
|| sym == gs.showsyms[S_water + SYM_OFF_P])
/* similar for floor [what about empty doorway?] and ice */ spec_cmap = MG_BW_LAVA;
} else if (cmap == S_ice break;
&& (gs.showsyms[gmap->sym.symidx] case S_ice:
== gs.showsyms[S_room + SYM_OFF_P] if (sym == gs.showsyms[S_room + SYM_OFF_P]
|| gs.showsyms[gmap->sym.symidx] || sym == gs.showsyms[S_darkroom + SYM_OFF_P])
== gs.showsyms[S_darkroom spec_cmap = MG_BW_ICE;
+ SYM_OFF_P])) { break;
gmap->glyphflags |= MG_BW_ICE; case S_sink:
if (sym == gs.showsyms[S_fountain + SYM_OFF_P])
/* and for fountain vs sink */ spec_cmap = MG_BW_SINK;
} else if (cmap == S_sink break;
&& (gs.showsyms[gmap->sym.symidx]
== gs.showsyms[S_fountain + SYM_OFF_P])) {
gmap->glyphflags |= MG_BW_SINK;
} }
gmap->glyphflags |= spec_cmap;
} else if (has_rogue_color) { } else if (has_rogue_color) {
color = cmap_to_roguecolor(cmap); color = cmap_to_roguecolor(cmap);
} }
@@ -2766,9 +2767,11 @@ reset_glyphmap(enum glyphmap_change_triggers trigger)
else else
altar_color(offset); altar_color(offset);
} else if ((offset = (glyph - GLYPH_CMAP_A_OFF)) >= 0) { } else if ((offset = (glyph - GLYPH_CMAP_A_OFF)) >= 0) {
int cmap = S_ndoor + offset; int sym, cmap = S_ndoor + offset;
gmap->sym.symidx = cmap + SYM_OFF_P; gmap->sym.symidx = cmap + SYM_OFF_P;
cmap_color(cmap); cmap_color(cmap);
sym = gs.showsyms[gmap->sym.symidx];
/* /*
* Some specialty color mappings not hardcoded in data init * Some specialty color mappings not hardcoded in data init
*/ */
@@ -2777,11 +2780,15 @@ reset_glyphmap(enum glyphmap_change_triggers trigger)
#ifdef TEXTCOLOR #ifdef TEXTCOLOR
/* provide a visible difference if normal and lit corridor /* provide a visible difference if normal and lit corridor
use the same symbol */ use the same symbol */
} else if ((cmap == S_litcorr) } else if (cmap == S_litcorr
&& gs.showsyms[gmap->sym.symidx] && sym == gs.showsyms[S_corr + SYM_OFF_P]) {
== gs.showsyms[S_corr + SYM_OFF_P]) {
color = CLR_WHITE; color = CLR_WHITE;
#endif #endif
/* likewise for corridor and engraving-in-corridor */
} else if (cmap == S_engrcorr
&& (sym == gs.showsyms[S_corr + SYM_OFF_P]
|| sym == gs.showsyms[S_litcorr + SYM_OFF_P])) {
gmap->glyphflags |= MG_BW_ENGR;
} }
} else if ((offset = (glyph - GLYPH_CMAP_SOKO_OFF)) >= 0) { } else if ((offset = (glyph - GLYPH_CMAP_SOKO_OFF)) >= 0) {
gmap->sym.symidx = S_vwall + offset + SYM_OFF_P; gmap->sym.symidx = S_vwall + offset + SYM_OFF_P;
+4 -2
View File
@@ -154,12 +154,14 @@ X11_print_glyph(
co_ptr = &map_info->text_map.colors[y][x]; co_ptr = &map_info->text_map.colors[y][x];
colordif = (((special & MG_PET) != 0 && iflags.hilite_pet) colordif = (((special & MG_PET) != 0 && iflags.hilite_pet)
|| ((special & MG_OBJPILE) != 0 && iflags.hilite_pile) || ((special & MG_OBJPILE) != 0 && iflags.hilite_pile)
|| ((special & (MG_DETECT | MG_BW_LAVA | MG_BW_ICE)) != 0 || ((special & (MG_DETECT | MG_BW_LAVA | MG_BW_ICE
| MG_BW_SINK | MG_BW_ENGR)) != 0
&& iflags.use_inverse)) && iflags.use_inverse))
? CLR_MAX : 0; ? CLR_MAX : 0;
color += colordif; color += colordif;
#ifdef ENHANCED_SYMBOLS #ifdef ENHANCED_SYMBOLS
if (SYMHANDLING(H_UTF8) && glyphinfo->gm.u != NULL && glyphinfo->gm.u->ucolor != 0) { if (SYMHANDLING(H_UTF8) && glyphinfo->gm.u != NULL
&& glyphinfo->gm.u->ucolor != 0) {
color = glyphinfo->gm.u->ucolor | 0x80000000; color = glyphinfo->gm.u->ucolor | 0x80000000;
if (colordif != 0) { if (colordif != 0) {
color |= 0x40000000; color |= 0x40000000;
+6 -3
View File
@@ -882,9 +882,12 @@ curses_print_glyph(
else /* if (iflags.use_inverse) */ else /* if (iflags.use_inverse) */
attr = A_REVERSE; attr = A_REVERSE;
} }
/* water and lava look the same except for color; when color is off, /* water and lava look the same except for color; when color is off
render lava in inverse video so that they look different */ (checked by core), render lava in inverse video so that it looks
if ((special & (MG_BW_LAVA | MG_BW_ICE)) != 0 && iflags.use_inverse) { different from water; similar for floor vs ice, fountain vs sink,
and corridor vs engranving-in-corridor */
if ((special & (MG_BW_LAVA | MG_BW_ICE | MG_BW_SINK | MG_BW_ENGR))
!= 0 && iflags.use_inverse) {
/* reset_glyphmap() only sets MG_BW_foo if color is off */ /* reset_glyphmap() only sets MG_BW_foo if color is off */
attr = A_REVERSE; attr = A_REVERSE;
} }
+7 -6
View File
@@ -3518,7 +3518,7 @@ tty_print_glyph(
} /* iflags.use_color aka iflags.wc_color */ } /* iflags.use_color aka iflags.wc_color */
/* must be after color check; term_end_color may turn off inverse too; /* must be after color check; term_end_color may turn off inverse too;
BW_LAVA and BW_ICE won't ever be set when color is on; BW_LAVA, BW_ICE, BW_SINK, BW_ENGR won't ever be set when color is on;
(tried bold for ice but it didn't look very good; inverse is easier (tried bold for ice but it didn't look very good; inverse is easier
to see although the Valkyrie quest ends up being hard on the eyes) */ to see although the Valkyrie quest ends up being hard on the eyes) */
if (iflags.use_color if (iflags.use_color
@@ -3527,11 +3527,12 @@ tty_print_glyph(
ttyDisplay->framecolor = bkglyphinfo->framecolor; ttyDisplay->framecolor = bkglyphinfo->framecolor;
term_start_bgcolor(bkglyphinfo->framecolor); term_start_bgcolor(bkglyphinfo->framecolor);
#endif #endif
} else if (((special & MG_PET) != 0 && iflags.hilite_pet) } else if ((((special & MG_PET) != 0 && iflags.hilite_pet)
|| ((special & MG_OBJPILE) != 0 && iflags.hilite_pile) || ((special & MG_OBJPILE) != 0 && iflags.hilite_pile)
|| ((special & MG_FEMALE) != 0 && wizard && iflags.wizmgender) || ((special & MG_FEMALE) != 0 && wizard && iflags.wizmgender)
|| ((special & (MG_DETECT | MG_BW_LAVA | MG_BW_ICE | MG_BW_SINK)) != 0 || ((special & (MG_DETECT | MG_BW_LAVA | MG_BW_ICE
&& iflags.use_inverse)) { | MG_BW_SINK | MG_BW_ENGR)) != 0))
&& iflags.use_inverse) {
term_start_attr(ATR_INVERSE); term_start_attr(ATR_INVERSE);
inverse_on = TRUE; inverse_on = TRUE;
} }
+3 -2
View File
@@ -986,8 +986,9 @@ paintGlyph(PNHMapWindow data, int i, int j, RECT * rect)
} }
#endif #endif
if (((data->map[i][j].gm.glyphflags & MG_PET) && iflags.hilite_pet) if (((data->map[i][j].gm.glyphflags & MG_PET) && iflags.hilite_pet)
|| ((data->map[i][j].gm.glyphflags & (MG_DETECT | MG_BW_LAVA)) || ((data->map[i][j].gm.glyphflags & (MG_DETECT | MG_BW_LAVA
&& iflags.use_inverse)) { | MW_BW_ICE | MG_BW_SINK
| MG_BW_ENGR)) != 0)) {
back_brush = back_brush =
CreateSolidBrush(nhcolor_to_RGB(CLR_GRAY)); CreateSolidBrush(nhcolor_to_RGB(CLR_GRAY));
FillRect(data->backBufferDC, rect, back_brush); FillRect(data->backBufferDC, rect, back_brush);