1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-24 04:34:16 +01:00

Codechange: Initialise/reset font cache with FontSizes bitset. (#14448)

Instead of choosing either "Normal/Small/Large" or "Monospace", use an EnumBitSet to allow any combination.
This commit is contained in:
Peter Nelson
2025-07-18 18:23:28 +01:00
committed by GitHub
parent 03672ed8eb
commit 0dc40877fd
11 changed files with 36 additions and 31 deletions

View File

@@ -1036,9 +1036,8 @@ struct GameOptionsWindow : Window {
this->SetWidgetDisabledState(WID_GO_GUI_FONT_AA, _fcsettings.prefer_sprite);
this->SetDirty();
InitFontCache(false);
InitFontCache(true);
ClearFontCache();
InitFontCache(FONTSIZES_ALL);
ClearFontCache(FONTSIZES_ALL);
CheckForMissingGlyphs();
SetupWidgetDimensions();
UpdateAllVirtCoords();
@@ -1051,7 +1050,7 @@ struct GameOptionsWindow : Window {
this->SetWidgetLoweredState(WID_GO_GUI_FONT_AA, _fcsettings.global_aa);
MarkWholeScreenDirty();
ClearFontCache();
ClearFontCache(FONTSIZES_ALL);
break;
#endif /* HAS_TRUETYPE_FONT */