MCPcopy Create free account
hub / github.com/OpenDUNE/OpenDUNE / Map_InvalidateSelection

Function Map_InvalidateSelection

src/map.c:181–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179}
180
181static void Map_InvalidateSelection(uint16 packed, bool enable)
182{
183 uint16 x, y;
184
185 if (packed == 0xFFFF) return;
186
187 for (y = 0; y < g_selectionHeight; y++) {
188 for (x = 0; x < g_selectionWidth; x++) {
189 uint16 curPacked;
190
191 curPacked = packed + Tile_PackXY(x, y);
192
193 Map_Update(curPacked, 0, false);
194
195 if (enable) {
196 BitArray_Set(g_displayedViewport, curPacked);
197 } else {
198 BitArray_Clear(g_displayedViewport, curPacked);
199 }
200 }
201 }
202}
203
204/**
205 * Sets the selection object to the given position.

Callers 1

Calls 3

Map_UpdateFunction · 0.85
BitArray_SetFunction · 0.85
BitArray_ClearFunction · 0.85

Tested by

no test coverage detected