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

Function selection_setpoint

src/selvar.c:180–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178}
179
180void
181selection_setpoint(
182 coordxy x, coordxy y,
183 struct selectionvar *sel,
184 int c)
185{
186 if (!sel || !sel->map)
187 return;
188 if (x < 0 || y < 0 || x >= sel->wid || y >= sel->hei)
189 return;
190
191 if (c && !sel->bounds_dirty) {
192 if (sel->bounds.lx > x)
193 sel->bounds.lx = x;
194 if (sel->bounds.ly > y)
195 sel->bounds.ly = y;
196 if (sel->bounds.hx < x)
197 sel->bounds.hx = x;
198 if (sel->bounds.hy < y)
199 sel->bounds.hy = y;
200
201 /* only set bounds_dirty if changing a point from 1 to 0; if changing
202 a point from 0 to 0, nothing has really changed with the bounds */
203 } else if (sel->map[sel->wid * y + x] != 0) {
204 sel->bounds_dirty = TRUE;
205 }
206
207 sel->map[sel->wid * y + x] = (char) (c + 1);
208}
209
210struct selectionvar *
211selection_not(struct selectionvar *s)

Callers 15

findtravelpathFunction · 0.85
l_selection_setpointFunction · 0.85
l_selection_andFunction · 0.85
l_selection_orFunction · 0.85
l_selection_xorFunction · 0.85
l_selection_subFunction · 0.85
l_selection_fillrectFunction · 0.85
l_selection_matchFunction · 0.85
selection_notFunction · 0.85
selection_filter_percentFunction · 0.85
selection_filter_mapcharFunction · 0.85
selection_rndcoordFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected