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

Function getpos_toggle_hilite_state

src/getpos.c:71–91  ·  view source on GitHub ↗

cycle 'getpos_hilite_state' to its next state; when 'bgcolors' is Off, it will alternate between not showing valid positions and showing them via temporary S_goodpos symbol; when 'bgcolors' is On, there are three states and showing them via setting background color becomes the default */

Source from the content-addressed store, hash-verified

69 when 'bgcolors' is On, there are three states and showing them via
70 setting background color becomes the default */
71staticfn void
72getpos_toggle_hilite_state(void)
73{
74 /* getpos_hilitefunc isn't Null */
75 if (getpos_hilite_state == HiliteGoodposSymbol) {
76 /* currently on, finish */
77 (*getpos_hilitefunc)(FALSE); /* tmp_at(DISP_END) */
78 }
79
80 getpos_hilite_state = (getpos_hilite_state + 1)
81 % (iflags.bgcolors ? 3 : 2);
82 /* resetting the callback functions to their current values will draw
83 valid-spots with background color if that is the new state and turn
84 off that color if it was the previous state */
85 getpos_sethilite(getpos_hilitefunc, getpos_getvalid);
86
87 if (getpos_hilite_state == HiliteGoodposSymbol) {
88 /* now on, begin */
89 (*getpos_hilitefunc)(TRUE);
90 }
91}
92
93boolean
94mapxy_valid(coordxy x, coordxy y)

Callers 1

getposFunction · 0.85

Calls 1

getpos_sethiliteFunction · 0.85

Tested by

no test coverage detected