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:
@@ -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 = {};
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user