mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Re-init GUI zoom only when really changed.
parent
22f5aeab07
commit
33099355b8
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue