1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-28 22:54:29 +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

@@ -245,7 +245,7 @@ static void RealChangeBlitter(std::string_view repl_blitter)
/* Clear caches that might have sprites for another blitter. */
VideoDriver::GetInstance()->ClearSystemSprites();
ClearFontCache();
ClearFontCache(FONTSIZES_ALL);
GfxClearSpriteCache();
ReInitAllWindows(false);
}
@@ -326,7 +326,7 @@ void CheckBlitter()
{
if (!SwitchNewGRFBlitter()) return;
ClearFontCache();
ClearFontCache(FONTSIZES_ALL);
GfxClearSpriteCache();
ReInitAllWindows(false);
}
@@ -338,7 +338,7 @@ void GfxLoadSprites()
SwitchNewGRFBlitter();
VideoDriver::GetInstance()->ClearSystemSprites();
ClearFontCache();
ClearFontCache(FONTSIZES_ALL);
GfxInitSpriteMem();
LoadSpriteTables();
GfxInitPalettes();