Skip to content

Commit e7f27b2

Browse files
committed
Remove lingering traces of hilite_hidden_stairs
This was removed as an option some time ago, but there were still a couple bits of code sticking around involving that system. As part of this, MG_PEACEFUL is shifted back one bit (tested it, peacefuls are still highlighted appropriately, no changes). Also, I noticed a comment in map_glyphinfo was somewhat out of date, so I updated it to reflect what it currently does and doesn't cover.
1 parent 8cde40a commit e7f27b2

File tree

3 files changed

+10
-17
lines changed

3 files changed

+10
-17
lines changed

include/display.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,8 +1114,7 @@ enum glyph_offsets {
11141114
#define MG_FEMALE 0x02000 /* represents a female mon or statue of one */
11151115
#define MG_BADXY 0x04000 /* bad coordinates were passed */
11161116
/* xNetHack added ones start here */
1117-
#define MG_STAIRS 0x08000 /* hidden stairs */
1118-
#define MG_PEACEFUL 0x10000 /* peaceful monster */
1117+
#define MG_PEACEFUL 0x08000 /* peaceful monster */
11191118

11201119
/* docrt(): re-draw whole screen; docrt_flags(): docrt() with more control */
11211120
enum docrt_flags_bits {

src/display.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2686,13 +2686,14 @@ map_glyphinfo(
26862686
/* NetHack 3.7 commit 1f6c1d0 instated a system in which variants of a
26872687
* single S_foo defsym that should render as different colors in text
26882688
* windowports now need to be their own glyphs, optionally allowing each
2689-
* glyph to be its own tile. (This is how altars are now treated.)
2690-
* xNetHack has additional color variants of a single defsym (iron doors and
2691-
* most notably object materials) which were not covered by this change, so
2692-
* for the time being the on-the-fly color computations have been re-added
2693-
* here. Likely the ones for object materials will be permanent, since
2694-
* adding glyphs and tiles for every material variant of every object would
2695-
* be an enormous amount of work. */
2689+
* glyph to be its own tile. (This is how altars are now treated, and in
2690+
* xNetHack magic platforms and engravings also use that method.)
2691+
* xNetHack has additional color variants of a single defsym (most notably
2692+
* object materials, but also colored walls and floors) which were not
2693+
* covered by this change, so for the time being, the on-the-fly color
2694+
* computations have been re-added here. Likely the ones for object
2695+
* materials will be permanent, since adding glyphs and tiles for every
2696+
* material variant of every object would be an enormous amount of work. */
26962697
/* isok is used because this is sometimes called with 0,0 */
26972698
if (iflags.use_color && isok(x, y)) {
26982699
/* object or statue, which might be made of a non-default material or on
@@ -2703,8 +2704,6 @@ map_glyphinfo(
27032704
if (otmp) {
27042705
if (otmp && otmp->material != objects[otmp->otyp].oc_material)
27052706
glyphinfo->gm.sym.color = materialclr[otmp->material];
2706-
if (On_stairs(x,y))
2707-
glyphinfo->gm.glyphflags |= MG_STAIRS;
27082707
}
27092708
/* !otmp is not actually impossible, because this is called from
27102709
* tmp_at(), in which an object is flying through the air above

win/curses/cursmain.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -976,11 +976,6 @@ curses_print_glyph(
976976
ch = curses_convert_glyph(ch, glyph);
977977

978978
if (wid == NHW_MAP) {
979-
/* hilite stairs not in 3.6, yet
980-
if ((special & MG_STAIRS) && iflags.hilite_hidden_stairs) {
981-
color = 16 + (color * 2);
982-
} else
983-
*/
984979
if ((special & MG_OBJPILE) && iflags.hilite_pile) {
985980
if (iflags.wc_color)
986981
color = get_framecolor(color, CLR_BLUE);
@@ -1006,7 +1001,7 @@ curses_print_glyph(
10061001
#ifdef ENHANCED_SYMBOLS
10071002
(SYMHANDLING(H_UTF8)
10081003
&& glyphinfo->gm.u && glyphinfo->gm.u->utf8str)
1009-
? glyphinfo->gm.u : NULL,
1004+
? glyphinfo->gm.u : NULL,
10101005
#endif
10111006
(nhcolor != 0) ? nhcolor : color,
10121007
bkglyphinfo->framecolor, attr);

0 commit comments

Comments
 (0)