mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-22 15:23:01 +01:00
Remove unused code
This commit is contained in:
@@ -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(
|
void WindowViewportGetMapCoordsByCursor(
|
||||||
const WindowBase& w, int32_t* map_x, int32_t* map_y, int32_t* offset_x, int32_t* offset_y)
|
const WindowBase& w, int32_t* map_x, int32_t* map_y, int32_t* offset_x, int32_t* offset_y)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -579,7 +579,6 @@ void WindowPushOthersBelow(WindowBase& w1);
|
|||||||
WindowBase* WindowGetMain();
|
WindowBase* WindowGetMain();
|
||||||
|
|
||||||
void WindowScrollToLocation(WindowBase& w, const CoordsXYZ& coords);
|
void WindowScrollToLocation(WindowBase& w, const CoordsXYZ& coords);
|
||||||
void WindowRotateCamera(WindowBase& w, int32_t direction);
|
|
||||||
void WindowViewportGetMapCoordsByCursor(
|
void WindowViewportGetMapCoordsByCursor(
|
||||||
const WindowBase& w, int32_t* map_x, int32_t* map_y, int32_t* offset_x, int32_t* offset_y);
|
const WindowBase& w, int32_t* map_x, int32_t* map_y, int32_t* offset_x, int32_t* offset_y);
|
||||||
void WindowViewportCentreTileAroundCursor(WindowBase& w, int32_t map_x, int32_t map_y, int32_t offset_x, int32_t offset_y);
|
void WindowViewportCentreTileAroundCursor(WindowBase& w, int32_t map_x, int32_t map_y, int32_t offset_x, int32_t offset_y);
|
||||||
|
|||||||
Reference in New Issue
Block a user