forked from mirror/OpenTTD
Feature: Multiple rotating views on title screen
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user