mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-04 13:42:55 +01:00
Add ViewportGetMain
This commit is contained in:
@@ -229,6 +229,16 @@ void ViewportRemove(Viewport* viewport)
|
||||
_viewports.erase(it);
|
||||
}
|
||||
|
||||
Viewport* ViewportGetMain()
|
||||
{
|
||||
auto mainWindow = WindowGetMain();
|
||||
if (mainWindow == nullptr)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
return mainWindow->viewport;
|
||||
}
|
||||
|
||||
void ViewportsInvalidate(const ScreenRect& screenRect, ZoomLevel maxZoom)
|
||||
{
|
||||
for (auto& vp : _viewports)
|
||||
|
||||
@@ -129,6 +129,7 @@ void ViewportInitAll();
|
||||
std::optional<ScreenCoordsXY> centre_2d_coordinates(const CoordsXYZ& loc, Viewport* viewport);
|
||||
void ViewportCreate(WindowBase* w, const ScreenCoordsXY& screenCoords, int32_t width, int32_t height, const Focus& focus);
|
||||
void ViewportRemove(Viewport* viewport);
|
||||
Viewport* ViewportGetMain();
|
||||
void ViewportsInvalidate(const ScreenRect& screenRect, ZoomLevel maxZoom = ZoomLevel{ -1 });
|
||||
void ViewportUpdatePosition(WindowBase* window);
|
||||
void ViewportUpdateFollowSprite(WindowBase* window);
|
||||
|
||||
Reference in New Issue
Block a user