mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-26 16:24:35 +01:00
Make setMainView() use ScreenCoordsXY
This commit is contained in:
@@ -488,7 +488,7 @@ public:
|
||||
return std::string(buffer);
|
||||
}
|
||||
|
||||
void SetMainView(int32_t x, int32_t y, int32_t zoom, int32_t rotation) override
|
||||
void SetMainView(const ScreenCoordsXY& viewPos, int32_t zoom, int32_t rotation) override
|
||||
{
|
||||
auto mainWindow = window_get_main();
|
||||
if (mainWindow != nullptr)
|
||||
@@ -497,8 +497,8 @@ public:
|
||||
auto zoomDifference = zoom - viewport->zoom;
|
||||
|
||||
mainWindow->viewport_target_sprite = SPRITE_INDEX_NULL;
|
||||
mainWindow->saved_view_x = x;
|
||||
mainWindow->saved_view_y = y;
|
||||
mainWindow->saved_view_x = viewPos.x;
|
||||
mainWindow->saved_view_y = viewPos.y;
|
||||
viewport->zoom = zoom;
|
||||
gCurrentRotation = rotation;
|
||||
|
||||
|
||||
@@ -452,7 +452,7 @@ private:
|
||||
void PrepareParkForPlayback()
|
||||
{
|
||||
auto windowManager = GetContext()->GetUiContext()->GetWindowManager();
|
||||
windowManager->SetMainView(gSavedViewX, gSavedViewY, gSavedViewZoom, gSavedViewRotation);
|
||||
windowManager->SetMainView({ gSavedViewX, gSavedViewY }, gSavedViewZoom, gSavedViewRotation);
|
||||
reset_sprite_spatial_index();
|
||||
reset_all_sprite_quadrant_placements();
|
||||
auto intent = Intent(INTENT_ACTION_REFRESH_NEW_RIDES);
|
||||
|
||||
@@ -425,7 +425,7 @@ namespace Editor
|
||||
static void FinaliseMainView()
|
||||
{
|
||||
auto windowManager = GetContext()->GetUiContext()->GetWindowManager();
|
||||
windowManager->SetMainView(gSavedViewX, gSavedViewY, gSavedViewZoom, gSavedViewRotation);
|
||||
windowManager->SetMainView({ gSavedViewX, gSavedViewY }, gSavedViewZoom, gSavedViewRotation);
|
||||
|
||||
reset_all_sprite_quadrant_placements();
|
||||
scenery_set_default_placement_configuration();
|
||||
|
||||
@@ -553,7 +553,7 @@ void game_load_init()
|
||||
}
|
||||
|
||||
auto windowManager = GetContext()->GetUiContext()->GetWindowManager();
|
||||
windowManager->SetMainView(gSavedViewX, gSavedViewY, gSavedViewZoom, gSavedViewRotation);
|
||||
windowManager->SetMainView({ gSavedViewX, gSavedViewY }, gSavedViewZoom, gSavedViewRotation);
|
||||
|
||||
if (network_get_mode() != NETWORK_MODE_CLIENT)
|
||||
{
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace OpenRCT2::Ui
|
||||
{
|
||||
return std::string();
|
||||
}
|
||||
void SetMainView(int32_t x, int32_t y, int32_t zoom, int32_t rotation) override
|
||||
void SetMainView(const ScreenCoordsXY& viewPos, int32_t zoom, int32_t rotation) override
|
||||
{
|
||||
}
|
||||
void UpdateMouseWheel() override
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace OpenRCT2::Ui
|
||||
virtual void HandleInput() abstract;
|
||||
virtual void HandleKeyboard(bool isTitle) abstract;
|
||||
virtual std::string GetKeyboardShortcutString(int32_t shortcut) abstract;
|
||||
virtual void SetMainView(int32_t x, int32_t y, int32_t zoom, int32_t rotation) abstract;
|
||||
virtual void SetMainView(const ScreenCoordsXY& viewPos, int32_t zoom, int32_t rotation) abstract;
|
||||
virtual void UpdateMouseWheel() abstract;
|
||||
virtual rct_window* GetOwner(const rct_viewport* viewport) abstract;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user