Feature: Multiple rotating views on title screen

This commit is contained in:
Niels Martin Hansen
2021-04-09 20:39:56 +02:00
parent 710b758b81
commit 6bd3106681
3 changed files with 210 additions and 2 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);
}