MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / UpdateAll

Function UpdateAll

src/openrct2/world/MapAnimation.cpp:705–734  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

703}
704
705static 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
736static void UpdateAllTemporary(const ViewportList& viewports)
737{

Callers 2

gameStateUpdateLogicFunction · 0.85

Calls 4

IsTileVisibleFunction · 0.85
valueMethod · 0.80
endMethod · 0.65
beginMethod · 0.45

Tested by

no test coverage detected