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

Method SetMainView

src/openrct2-ui/WindowManager.cpp:629–646  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

627 }
628
629 void SetMainView(const ScreenCoordsXY& viewPos, ZoomLevel zoom, int32_t rotation) override
630 {
631 auto mainWindow = WindowGetMain();
632 if (mainWindow != nullptr)
633 {
634 auto viewport = WindowGetViewport(mainWindow);
635
636 mainWindow->viewportTargetSprite = EntityId::GetNull();
637 mainWindow->savedViewPos = viewPos;
638 viewport->zoom = zoom;
639 viewport->rotation = rotation;
640
641 mainWindow->savedViewPos.x -= viewport->ViewWidth() / 2;
642 mainWindow->savedViewPos.y -= viewport->ViewHeight() / 2;
643
644 mainWindow->invalidate();
645 }
646 }
647
648 void UpdateMouseWheel() override
649 {

Callers 3

GameLoadInitFunction · 0.45
FinaliseMainViewFunction · 0.45

Calls 5

WindowGetMainFunction · 0.85
WindowGetViewportFunction · 0.85
ViewWidthMethod · 0.80
ViewHeightMethod · 0.80
invalidateMethod · 0.45

Tested by

no test coverage detected