1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-22 15:23:01 +01:00

Remove unused code

This commit is contained in:
ζeh Matt
2024-02-18 20:37:48 +02:00
parent 462bb33234
commit 47d346ee81
2 changed files with 0 additions and 61 deletions

View File

@@ -889,66 +889,6 @@ void WindowScrollToLocation(WindowBase& w, const CoordsXYZ& coords)
}
}
/**
*
* rct2: 0x00688956
*/
static void call_event_viewport_rotate_on_all_windows()
{
WindowVisitEach([](WindowBase* w) { w->OnViewportRotate(); });
}
/**
*
* rct2: 0x0068881A
* direction can be used to alter the camera rotation:
* 1: clockwise
* -1: anti-clockwise
*/
void WindowRotateCamera(WindowBase& w, int32_t direction)
{
Viewport* viewport = w.viewport;
if (viewport == nullptr)
return;
auto windowPos = ScreenCoordsXY{ (viewport->width >> 1), (viewport->height >> 1) } + viewport->pos;
// has something to do with checking if middle of the viewport is obstructed
Viewport* other;
auto mapXYCoords = ScreenGetMapXY(windowPos, &other);
CoordsXYZ coords{};
// other != viewport probably triggers on viewports in ride or guest window?
// naoXYCoords is nullopt if middle of viewport is obstructed by another window?
if (!mapXYCoords.has_value() || other != viewport)
{
auto viewPos = ScreenCoordsXY{ (viewport->view_width >> 1), (viewport->view_height >> 1) } + viewport->viewPos;
coords = ViewportAdjustForMapHeight(viewPos, viewport->rotation);
}
else
{
coords.x = mapXYCoords->x;
coords.y = mapXYCoords->y;
coords.z = TileElementHeight(coords);
}
viewport->rotation = (viewport->rotation + direction) & 3;
auto centreLoc = centre_2d_coordinates(coords, viewport);
if (centreLoc.has_value())
{
w.savedViewPos = centreLoc.value();
viewport->viewPos = *centreLoc;
}
w.Invalidate();
call_event_viewport_rotate_on_all_windows();
ResetAllSpriteQuadrantPlacements();
}
void WindowViewportGetMapCoordsByCursor(
const WindowBase& w, int32_t* map_x, int32_t* map_y, int32_t* offset_x, int32_t* offset_y)
{