1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-16 08:52:40 +01:00

Codechange: Use ProviderManager interface to register FontCache factories.

This removes use of #ifdefs to select the appropriate loader, and also replaces FontCache self-registration.
This commit is contained in:
Peter Nelson
2025-08-07 18:13:35 +01:00
committed by Peter Nelson
parent ed1262cab9
commit 140f2b291a
14 changed files with 409 additions and 326 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(FONTSIZES_ALL);
FontCache::ClearFontCaches(FONTSIZES_ALL);
GfxClearSpriteCache();
ReInitAllWindows(false);
}
@@ -326,7 +326,7 @@ void CheckBlitter()
{
if (!SwitchNewGRFBlitter()) return;
ClearFontCache(FONTSIZES_ALL);
FontCache::ClearFontCaches(FONTSIZES_ALL);
GfxClearSpriteCache();
ReInitAllWindows(false);
}
@@ -338,7 +338,7 @@ void GfxLoadSprites()
SwitchNewGRFBlitter();
VideoDriver::GetInstance()->ClearSystemSprites();
ClearFontCache(FONTSIZES_ALL);
FontCache::ClearFontCaches(FONTSIZES_ALL);
GfxInitSpriteMem();
LoadSpriteTables();
GfxInitPalettes();