(svn r23316) -Feature: Add ability to zoom in to 2x and 4x level.
This commit is contained in:
@@ -2688,6 +2688,13 @@ bool AfterLoadGame()
|
||||
}
|
||||
}
|
||||
|
||||
if (IsSavegameVersionBefore(165)) {
|
||||
/* Adjust zoom level to account for new levels */
|
||||
_saved_scrollpos_zoom = _saved_scrollpos_zoom + ZOOM_LVL_SHIFT;
|
||||
_saved_scrollpos_x *= ZOOM_LVL_BASE;
|
||||
_saved_scrollpos_y *= ZOOM_LVL_BASE;
|
||||
}
|
||||
|
||||
/* When any NewGRF has been changed the availability of some vehicles might
|
||||
* have been changed too. e->company_avail must be set to 0 in that case
|
||||
* which is done by StartupEngines(). */
|
||||
|
@@ -56,9 +56,12 @@ void ResetViewportAfterLoadGame()
|
||||
vp->virtual_width = ScaleByZoom(vp->width, vp->zoom);
|
||||
vp->virtual_height = ScaleByZoom(vp->height, vp->zoom);
|
||||
|
||||
/* Ensure zoom level is allowed */
|
||||
while (vp->zoom < _settings_client.gui.zoom_min) DoZoomInOutWindow(ZOOM_OUT, w);
|
||||
while (vp->zoom > _settings_client.gui.zoom_max) DoZoomInOutWindow(ZOOM_IN, w);
|
||||
/* If zoom_max is ZOOM_LVL_MIN then the setting has not been loaded yet, therefore all levels are allowed. */
|
||||
if (_settings_client.gui.zoom_max != ZOOM_LVL_MIN) {
|
||||
/* Ensure zoom level is allowed */
|
||||
while (vp->zoom < _settings_client.gui.zoom_min) DoZoomInOutWindow(ZOOM_OUT, w);
|
||||
while (vp->zoom > _settings_client.gui.zoom_max) DoZoomInOutWindow(ZOOM_IN, w);
|
||||
}
|
||||
|
||||
DoZoomInOutWindow(ZOOM_NONE, w); // update button status
|
||||
MarkWholeScreenDirty();
|
||||
|
Reference in New Issue
Block a user