* Updates ??. * * @param packed The packed tile. * @param type The type of update. * @param ignoreInvisible Wether to ignore tile visibility check. */
| 588 | * @param ignoreInvisible Wether to ignore tile visibility check. |
| 589 | */ |
| 590 | void 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 |
no test coverage detected