1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-10 09:32:29 +01:00

Remove unused function WindowViewportCentreTileAroundCursor

This commit is contained in:
mix
2025-08-27 09:13:05 +01:00
parent fa92008548
commit 677f6c0717
2 changed files with 0 additions and 25 deletions

View File

@@ -411,30 +411,6 @@ static constexpr float kWindowScrollLocations[][2] = {
}
}
void WindowViewportCentreTileAroundCursor(WindowBase& w, int32_t map_x, int32_t map_y, int32_t offset_x, int32_t offset_y)
{
// Get viewport coordinates centring around the tile.
int32_t z = TileElementHeight({ map_x, map_y });
auto centreLoc = centre_2d_coordinates({ map_x, map_y, z }, w.viewport);
if (!centreLoc.has_value())
{
LOG_ERROR("Invalid location.");
return;
}
// Get mouse position to offset against.
auto mouseCoords = ContextGetCursorPositionScaled();
// Rebase mouse position onto centre of window, and compensate for zoom level.
int32_t rebased_x = w.viewport->zoom.ApplyTo((w.width >> 1) - mouseCoords.x);
int32_t rebased_y = w.viewport->zoom.ApplyTo((w.height >> 1) - mouseCoords.y);
// Apply offset to the viewport.
w.savedViewPos = { centreLoc->x + rebased_x + w.viewport->zoom.ApplyInversedTo(offset_x),
centreLoc->y + rebased_y + w.viewport->zoom.ApplyInversedTo(offset_y) };
}
/**
* For all windows with viewports, ensure they do not have a zoom level less than the minimum.
*/

View File

@@ -306,7 +306,6 @@ namespace OpenRCT2
WindowBase* WindowGetMain();
void WindowScrollToLocation(WindowBase& w, const CoordsXYZ& coords);
void WindowViewportCentreTileAroundCursor(WindowBase& w, int32_t map_x, int32_t map_y, int32_t offset_x, int32_t offset_y);
void WindowCheckAllValidZoom();
void WindowZoomSet(WindowBase& w, ZoomLevel zoomLevel, bool atCursor);