1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Use ZoomLevel for viewport and ride window

This commit is contained in:
Hielke Morsink
2021-09-28 18:09:40 +02:00
parent 95ba1654c7
commit f3735dc076
3 changed files with 5 additions and 5 deletions

View File

@@ -778,7 +778,7 @@ static std::unique_ptr<TrackDesign> _trackDesign;
struct RideOverallView
{
CoordsXYZ loc;
uint8_t zoom;
ZoomLevel zoom;
};
static std::vector<RideOverallView> ride_overall_views = {};

View File

@@ -177,8 +177,8 @@ void viewport_create(rct_window* w, const ScreenCoordsXY& screenCoords, int32_t
viewport->height = height;
const auto zoom = focus.zoom;
viewport->view_width = width << zoom;
viewport->view_height = height << zoom;
viewport->view_width = width << static_cast<int8_t>(zoom);
viewport->view_height = height << static_cast<int8_t>(zoom);
viewport->zoom = zoom;
viewport->flags = 0;

View File

@@ -200,10 +200,10 @@ struct Focus
using CoordinateFocus = CoordsXYZ;
using EntityFocus = uint16_t;
uint8_t zoom = 0;
ZoomLevel zoom{};
std::variant<CoordinateFocus, EntityFocus> data;
template<typename T> constexpr explicit Focus(T newValue, uint8_t newZoom = 0)
template<typename T> constexpr explicit Focus(T newValue, ZoomLevel newZoom = {})
{
data = newValue;
zoom = newZoom;