| 703 | } |
| 704 | |
| 705 | static void UpdateAll(const ViewportList& viewports) |
| 706 | { |
| 707 | // Currently nothing updates on odd ticks. |
| 708 | if (getGameState().currentTicks & 1) |
| 709 | return; |
| 710 | |
| 711 | auto it = _mapAnimationsUpdate.begin(); |
| 712 | while (it != _mapAnimationsUpdate.end()) |
| 713 | { |
| 714 | const bool isVisible = IsTileVisible(viewports, *it); |
| 715 | const auto result = isVisible ? UpdateTile<true, true>(*it, nullptr) : UpdateTile<false, true>(*it, nullptr); |
| 716 | if (result) |
| 717 | { |
| 718 | if (result.value() == UpdateType::invalidate) |
| 719 | { |
| 720 | const auto& coords = *it; |
| 721 | _mapAnimationsInvalidate[coords.x + (coords.y * kMaximumMapSizeTechnical)] = true; |
| 722 | it = _mapAnimationsUpdate.erase(it); |
| 723 | } |
| 724 | else |
| 725 | { |
| 726 | ++it; |
| 727 | } |
| 728 | } |
| 729 | else |
| 730 | { |
| 731 | it = _mapAnimationsUpdate.erase(it); |
| 732 | } |
| 733 | } |
| 734 | } |
| 735 | |
| 736 | static void UpdateAllTemporary(const ViewportList& viewports) |
| 737 | { |
no test coverage detected