MCPcopy Create free account
hub / github.com/NetHack/NetHack / term_attr_fixup

Function term_attr_fixup

win/tty/termcap.c:1410–1428  ·  view source on GitHub ↗

suppress nonfunctional highlights so render_status() might be able to optimize more; keep this in sync with s_atr2str() */

Source from the content-addressed store, hash-verified

1408/* suppress nonfunctional highlights so render_status() might be able to
1409 optimize more; keep this in sync with s_atr2str() */
1410int
1411term_attr_fixup(int msk)
1412{
1413 /* underline is converted to bold if its start sequence isn't available */
1414 if ((msk & HL_ULINE) && (!nh_US || !*nh_US)) {
1415 msk |= HL_BOLD;
1416 msk &= ~HL_ULINE;
1417 }
1418 /* blink used to be converted to bold unconditionally; now depends on MB */
1419 if ((msk & HL_BLINK) && (!MB || !*MB)) {
1420 msk |= HL_BOLD;
1421 msk &= ~HL_BLINK;
1422 }
1423 /* dim is ignored if its start sequence isn't available */
1424 if ((msk & HL_DIM) && (!MH || !*MH)) {
1425 msk &= ~HL_DIM;
1426 }
1427 return msk;
1428}
1429
1430void
1431term_start_attr(int attr)

Callers 1

tty_status_updateFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected