mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-06 06:32:56 +01:00
Move update all temporary map animations to own function
This commit is contained in:
@@ -671,6 +671,22 @@ static void UpdateAll(const ViewportList& viewports)
|
||||
}
|
||||
}
|
||||
|
||||
static void UpdateAllTemporary()
|
||||
{
|
||||
auto it = _temporaryMapAnimations.begin();
|
||||
while (it != _temporaryMapAnimations.end())
|
||||
{
|
||||
if (UpdateTemporaryAnimation(*it))
|
||||
{
|
||||
++it;
|
||||
}
|
||||
else
|
||||
{
|
||||
it = _temporaryMapAnimations.erase(it);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MapAnimations::InvalidateAndUpdateAll()
|
||||
{
|
||||
PROFILED_FUNCTION();
|
||||
@@ -678,21 +694,7 @@ void MapAnimations::InvalidateAndUpdateAll()
|
||||
const auto viewports = GetVisibleViewports();
|
||||
InvalidateAll(viewports);
|
||||
UpdateAll(viewports);
|
||||
|
||||
{
|
||||
auto it = _temporaryMapAnimations.begin();
|
||||
while (it != _temporaryMapAnimations.end())
|
||||
{
|
||||
if (UpdateTemporaryAnimation(*it))
|
||||
{
|
||||
++it;
|
||||
}
|
||||
else
|
||||
{
|
||||
it = _temporaryMapAnimations.erase(it);
|
||||
}
|
||||
}
|
||||
}
|
||||
UpdateAllTemporary();
|
||||
}
|
||||
|
||||
void MapAnimations::ClearAll()
|
||||
|
||||
Reference in New Issue
Block a user