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

Function getpos_sethilite

src/getpos.c:40–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38 defaultHiliteState = HiliteNormalMap;
39
40void
41getpos_sethilite(
42 void (*gp_hilitef)(boolean),
43 boolean (*gp_getvalidf)(coordxy, coordxy))
44{
45 boolean (*old_getvalid)(coordxy, coordxy) = getpos_getvalid;
46 uint32 old_map_frame_color = gw.wsettings.map_frame_color;
47 struct selectionvar *sel = selection_new();
48
49 defaultHiliteState = iflags.bgcolors ? HiliteBackground : HiliteNormalMap;
50 if (gp_getvalidf != old_getvalid)
51 getpos_hilite_state = defaultHiliteState;
52
53 getpos_getvalids_selection(sel, getpos_getvalid);
54 getpos_hilitefunc = gp_hilitef;
55 getpos_getvalid = gp_getvalidf;
56 getpos_getvalids_selection(sel, getpos_getvalid);
57 gw.wsettings.map_frame_color = (getpos_hilite_state == HiliteBackground)
58 ? HI_ZAP : NO_COLOR;
59
60 if (getpos_getvalid != old_getvalid
61 || gw.wsettings.map_frame_color != old_map_frame_color)
62 selection_force_newsyms(sel);
63 selection_free(sel, TRUE);
64}
65
66/* cycle 'getpos_hilite_state' to its next state;
67 when 'bgcolors' is Off, it will alternate between not showing valid

Callers 9

throwspellFunction · 0.85
jumpFunction · 0.85
use_poleFunction · 0.85
use_grappleFunction · 0.85
getpos_refreshFunction · 0.85
getposFunction · 0.85
seffect_fireFunction · 0.85
do_stinking_cloudFunction · 0.85

Calls 4

selection_newFunction · 0.85
selection_force_newsymsFunction · 0.85
selection_freeFunction · 0.85

Tested by

no test coverage detected