| 156 | } |
| 157 | |
| 158 | void FixTitleGameZoom(int zoom_adjust) |
| 159 | { |
| 160 | if (_game_mode != GM_MENU) return; |
| 161 | |
| 162 | Viewport &vp = *GetMainWindow()->viewport; |
| 163 | |
| 164 | /* Adjust the zoom in/out. |
| 165 | * Can't simply add, since operator+ is not defined on the ZoomLevel type. */ |
| 166 | vp.zoom = _gui_zoom; |
| 167 | while (zoom_adjust < 0 && vp.zoom != _settings_client.gui.zoom_min) { |
| 168 | vp.zoom--; |
| 169 | zoom_adjust++; |
| 170 | } |
| 171 | while (zoom_adjust > 0 && vp.zoom != _settings_client.gui.zoom_max) { |
| 172 | vp.zoom++; |
| 173 | zoom_adjust--; |
| 174 | } |
| 175 | |
| 176 | vp.virtual_width = ScaleByZoom(vp.width, vp.zoom); |
| 177 | vp.virtual_height = ScaleByZoom(vp.height, vp.zoom); |
| 178 | } |
| 179 | |
| 180 | static constexpr std::initializer_list<NWidgetPart> _nested_main_window_widgets = { |
| 181 | NWidget(NWID_VIEWPORT, INVALID_COLOUR, WID_M_VIEWPORT), SetResize(1, 1), |
no test coverage detected