mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-10 08:00:05 +00:00
Change: Be selective about clearing sprite/font caches on interface scale change. (#11576)
Sprite cache contains all zoom levels anyway, so does not need to be reloaded. Font cache does not need to be clear if the font zoom hasn't changed, i.e. when changing the max sprite zoom level setting.
This commit is contained in:
parent
b62fafc5d4
commit
0a8bcdd344
10
src/gfx.cpp
10
src/gfx.cpp
@ -1982,17 +1982,17 @@ bool AdjustGUIZoom(bool automatic)
|
||||
UpdateGUIZoom();
|
||||
if (old_scale == _gui_scale && old_gui_zoom == _gui_zoom) return false;
|
||||
|
||||
/* Reload sprites if sprite zoom level has changed. */
|
||||
/* Update cursors if sprite zoom level has changed. */
|
||||
if (old_gui_zoom != _gui_zoom) {
|
||||
GfxClearSpriteCache();
|
||||
VideoDriver::GetInstance()->ClearSystemSprites();
|
||||
UpdateCursorSize();
|
||||
} else if (old_font_zoom != _font_zoom) {
|
||||
GfxClearFontSpriteCache();
|
||||
}
|
||||
|
||||
if (old_font_zoom != _font_zoom) {
|
||||
GfxClearFontSpriteCache();
|
||||
ClearFontCache();
|
||||
LoadStringWidthTable();
|
||||
}
|
||||
|
||||
UpdateAllVirtCoords();
|
||||
|
||||
/* Adjust all window sizes to match the new zoom level, so that they don't appear
|
||||
|
Loading…
Reference in New Issue
Block a user