1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 05:53:02 +01:00

More efficiently search viewports

This commit is contained in:
Harry Hopkinson
2025-05-22 21:04:14 +01:00
parent 5fe3f7b97f
commit 371dcc28f5
3 changed files with 16 additions and 2 deletions

View File

@@ -916,6 +916,18 @@ static constexpr float kWindowScrollLocations[][2] = {
});
}
std::vector<Viewport*> WindowGetActiveViewports()
{
std::vector<Viewport*> viewports;
WindowVisitEach([&viewports](WindowBase* w) {
if (w->viewport != nullptr && !(w->flags & WF_DEAD))
{
viewports.push_back(w->viewport);
}
});
return viewports;
}
Viewport* WindowGetPreviousViewport(Viewport* current)
{
bool foundPrevious = (current == nullptr);