From 8bb8d3262596a5fccb08cea1edc854839ce02c3b Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 2 Jul 2019 01:37:04 -0700 Subject: [PATCH] tty status highlighting via attributes Highlighting via attributes got broken three months ago. May or may not have been noticeable depending upon which attributes are supported. Too many variations of attribute designations... --- doc/fixes36.3 | 4 +++- win/tty/termcap.c | 18 +++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/doc/fixes36.3 b/doc/fixes36.3 index 261215b97..47f9a162b 100644 --- a/doc/fixes36.3 +++ b/doc/fixes36.3 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.80 $ $NHDT-Date: 1561920590 2019/06/30 18:49:50 $ +$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.81 $ $NHDT-Date: 1562056615 2019/07/02 08:36:55 $ This fixes36.3 file is here to capture information about updates in the 3.6.x lineage following the release of 3.6.2 in May 2019. Please note, however, @@ -191,6 +191,8 @@ tty: re-do one optimization used when status conditions have all been removed tty: take two, if/when autodecribe feedback wraps past top line, clear continuation lines and redraw map if needed when top line is cleared ['exposed by git' section has an entry for reversal of 'take one'] +tty: video attributes (bold, inverse, &c) for status highlighting sometimes + were scrambled Windows: some startup error messages were not being delivered successfully diff --git a/win/tty/termcap.c b/win/tty/termcap.c index ca1e08b02..9e0a76eb9 100644 --- a/win/tty/termcap.c +++ b/win/tty/termcap.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 termcap.c $NHDT-Date: 1554841008 2019/04/09 20:16:48 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.30 $ */ +/* NetHack 3.6 termcap.c $NHDT-Date: 1562056615 2019/07/02 08:36:55 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.31 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Pasi Kallinen, 2018. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1216,18 +1216,18 @@ term_attr_fixup(msk) int msk; { /* underline is converted to bold if its start sequence isn't available */ - if ((msk & (1 << ATR_ULINE)) && (!nh_US || !*nh_US)) { - msk |= (1 << ATR_BOLD); - msk &= ~(1 << ATR_ULINE); + if ((msk & HL_ULINE) && (!nh_US || !*nh_US)) { + msk |= HL_BOLD; + msk &= ~HL_ULINE; } /* blink used to be converted to bold unconditionally; now depends on MB */ - if (msk & (1 << ATR_BLINK) && (!MB || !*MB)) { - msk |= (1 << ATR_BOLD); - msk &= ~(1 << ATR_BLINK); + if ((msk & HL_BLINK) && (!MB || !*MB)) { + msk |= HL_BOLD; + msk &= ~HL_BLINK; } /* dim is ignored if its start sequence isn't available */ - if (msk & (1 << ATR_DIM) && (!MH || !*MH)) { - msk &= ~(1 << ATR_DIM); + if ((msk & HL_DIM) && (!MH || !*MH)) { + msk &= ~HL_DIM; } return msk; }