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

Function Map_Update

src/map.c:590–632  ·  view source on GitHub ↗

* Updates ??. * * @param packed The packed tile. * @param type The type of update. * @param ignoreInvisible Wether to ignore tile visibility check. */

Source from the content-addressed store, hash-verified

588 * @param ignoreInvisible Wether to ignore tile visibility check.
589 */
590void Map_Update(uint16 packed, uint16 type, bool ignoreInvisible)
591{
592 static const int16 offsets[9] = {
593 -64, /* up */
594 -63, /* up right */
595 1, /* right */
596 65, /* down rigth */
597 64, /* down */
598 63, /* down left */
599 -1, /* left */
600 -65, /* up left */
601 0
602 };
603
604 if (!ignoreInvisible && !Map_IsTileVisible(packed)) return;
605
606 switch (type) {
607 default:
608 case 0: {
609 uint8 i;
610 uint16 curPacked;
611
612 if (BitArray_Test(g_dirtyMinimap, packed)) return;
613
614 g_dirtyViewportCount++;
615
616 for (i = 0; i < 9; i++) {
617 curPacked = (packed + offsets[i]) & 0xFFF;
618 BitArray_Set(g_dirtyViewport, curPacked);
619 if (BitArray_Test(g_displayedViewport, curPacked)) g_selectionRectangleNeedRepaint = true;
620 }
621
622 BitArray_Set(g_dirtyMinimap, curPacked);
623 return;
624 }
625
626 case 1:
627 case 2:
628 case 3:
629 BitArray_Set(g_dirtyViewport, packed);
630 return;
631 }
632}
633
634/**
635 * Make a deviator missile explosion on the given position, of a certain type. All units in the

Callers 15

Structure_PlaceFunction · 0.85
Structure_ConnectWallFunction · 0.85
Structure_UpdateMapFunction · 0.85
Animation_Func_StopFunction · 0.85
Animation_Func_AbortFunction · 0.85
Map_InvalidateSelectionFunction · 0.85
Map_UpdateWallFunction · 0.85
Map_FixupSpiceEdgesFunction · 0.85
Map_Bloom_ExplodeSpecialFunction · 0.85

Calls 3

Map_IsTileVisibleFunction · 0.85
BitArray_TestFunction · 0.85
BitArray_SetFunction · 0.85

Tested by

no test coverage detected