Changeset - r24795:fb103e787dac
[Not reviewed]
master
0 1 0
Michael Lutz - 3 years ago 2021-02-13 18:24:11
michi@icosahedron.de
Codechange: Re-init GUI zoom only when really changed.
1 file changed with 23 insertions and 15 deletions:
0 comments (0 inline, 0 general)
src/settings_gui.cpp
Show inline comments
 
@@ -538,24 +538,32 @@ struct GameOptionsWindow : Window {
 
				}
 
				break;
 

	
 
			case WID_GO_GUI_ZOOM_DROPDOWN:
 
				GfxClearSpriteCache();
 
				_gui_zoom_cfg = index > 0 ? ZOOM_LVL_OUT_4X - index + 1 : ZOOM_LVL_CFG_AUTO;
 
				UpdateGUIZoom();
 
				UpdateCursorSize();
 
				UpdateAllVirtCoords();
 
				FixTitleGameZoom();
 
				ReInitAllWindows();
 
			case WID_GO_GUI_ZOOM_DROPDOWN: {
 
				int8 new_zoom = index > 0 ? ZOOM_LVL_OUT_4X - index + 1 : ZOOM_LVL_CFG_AUTO;
 
				if (new_zoom != _gui_zoom_cfg) {
 
					GfxClearSpriteCache();
 
					_gui_zoom_cfg = new_zoom;
 
					UpdateGUIZoom();
 
					UpdateCursorSize();
 
					UpdateAllVirtCoords();
 
					FixTitleGameZoom();
 
					ReInitAllWindows();
 
				}
 
				break;
 
			}
 

	
 
			case WID_GO_FONT_ZOOM_DROPDOWN:
 
				GfxClearSpriteCache();
 
				_font_zoom_cfg = index > 0 ? ZOOM_LVL_OUT_4X - index + 1 : ZOOM_LVL_CFG_AUTO;
 
				UpdateGUIZoom();
 
				ClearFontCache();
 
				LoadStringWidthTable();
 
				UpdateAllVirtCoords();
 
			case WID_GO_FONT_ZOOM_DROPDOWN: {
 
				int8 new_zoom = index > 0 ? ZOOM_LVL_OUT_4X - index + 1 : ZOOM_LVL_CFG_AUTO;
 
				if (new_zoom != _font_zoom_cfg) {
 
					GfxClearSpriteCache();
 
					_font_zoom_cfg = new_zoom;
 
					UpdateGUIZoom();
 
					ClearFontCache();
 
					LoadStringWidthTable();
 
					UpdateAllVirtCoords();
 
				}
 
				break;
 
			}
 

	
 
			case WID_GO_BASE_GRF_DROPDOWN:
 
				this->SetMediaSet<BaseGraphics>(index);
0 comments (0 inline, 0 general)