Merge remote-tracking branch 'upstream/master'

This commit is contained in:
dP
2021-09-27 19:53:01 +03:00
173 changed files with 31132 additions and 9502 deletions

View File

@@ -152,12 +152,24 @@ void ZoomInOrOutToCursorWindow(bool in, Window *w)
}
}
void FixTitleGameZoom()
void FixTitleGameZoom(int zoom_adjust)
{
if (_game_mode != GM_MENU) return;
Viewport *vp = FindWindowByClass(WC_MAIN_WINDOW)->viewport;
/* Adjust the zoom in/out.
* Can't simply add, since operator+ is not defined on the ZoomLevel type. */
vp->zoom = _gui_zoom;
while (zoom_adjust < 0 && vp->zoom != ZOOM_LVL_MIN) {
vp->zoom--;
zoom_adjust++;
}
while (zoom_adjust > 0 && vp->zoom != ZOOM_LVL_MAX) {
vp->zoom++;
zoom_adjust--;
}
vp->virtual_width = ScaleByZoom(vp->width, vp->zoom);
vp->virtual_height = ScaleByZoom(vp->height, vp->zoom);
}