summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2011-11-24 12:20:14 +0000
committerpeter1138 <peter1138@openttd.org>2011-11-24 12:20:14 +0000
commit4e97261315211c65459b91685537f82e5c454604 (patch)
tree155bbd8a8a459ba9b0a74c4ca230a2ab99cb99fd /src/saveload
parent00db8b800866b47f0ee6a7f4ad2c227eab97bd53 (diff)
downloadopenttd-4e97261315211c65459b91685537f82e5c454604.tar.xz
(svn r23314) -Add: Add settings to restrict viewport zoom levels.
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/misc_sl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/saveload/misc_sl.cpp b/src/saveload/misc_sl.cpp
index ccfc7a2d3..9ca806701 100644
--- a/src/saveload/misc_sl.cpp
+++ b/src/saveload/misc_sl.cpp
@@ -56,6 +56,10 @@ 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);
+
DoZoomInOutWindow(ZOOM_NONE, w); // update button status
MarkWholeScreenDirty();
}