mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
Add constant for maximum zoom level
This commit is contained in:
@@ -814,11 +814,16 @@ static void window_top_toolbar_invalidate(rct_window *w)
|
||||
window_top_toolbar_widgets[WIDX_MUTE].image = IMAGE_TYPE_REMAP | SPR_G2_TOOLBAR_UNMUTE;
|
||||
|
||||
// Zoomed out/in disable. Not sure where this code is in the original.
|
||||
if (window_get_main()->viewport->zoom == 0){
|
||||
if (window_get_main()->viewport->zoom == 0)
|
||||
{
|
||||
w->disabled_widgets |= (1 << WIDX_ZOOM_IN);
|
||||
} else if (window_get_main()->viewport->zoom == 3){
|
||||
}
|
||||
else if (window_get_main()->viewport->zoom >= MAX_ZOOM_LEVEL)
|
||||
{
|
||||
w->disabled_widgets |= (1 << WIDX_ZOOM_OUT);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
w->disabled_widgets &= ~((1 << WIDX_ZOOM_IN) | (1 << WIDX_ZOOM_OUT));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,6 +88,7 @@ typedef struct viewport_interaction_info {
|
||||
} viewport_interaction_info;
|
||||
|
||||
#define MAX_VIEWPORT_COUNT WINDOW_LIMIT_MAX
|
||||
#define MAX_ZOOM_LEVEL 3
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -1511,7 +1511,7 @@ void window_zoom_set(rct_window *w, sint32 zoomLevel, bool atCursor)
|
||||
{
|
||||
rct_viewport* v = w->viewport;
|
||||
|
||||
zoomLevel = clamp(0, zoomLevel, 3);
|
||||
zoomLevel = clamp(0, zoomLevel, MAX_ZOOM_LEVEL);
|
||||
if (v->zoom == zoomLevel)
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user