From df54f25efe5817e35c4eba9b95c5b8718d3a7551 Mon Sep 17 00:00:00 2001 From: frosch Date: Sat, 25 Feb 2012 17:20:02 +0000 Subject: (svn r23987) -Fix (r23000): Also reset the font glyph cache when switching blitters. --- src/fontcache.cpp | 8 ++++++++ src/fontcache.h | 1 + src/gfxinit.cpp | 1 + 3 files changed, 10 insertions(+) (limited to 'src') diff --git a/src/fontcache.cpp b/src/fontcache.cpp index bed9bc4b0..a8448be4b 100644 --- a/src/fontcache.cpp +++ b/src/fontcache.cpp @@ -974,6 +974,14 @@ void UninitFreeType() _library = NULL; } +/** + * Reset cached glyphs. + */ +void ClearFontCache() +{ + ResetGlyphCache(true); + ResetGlyphCache(false); +} static FT_Face GetFontFace(FontSize size) { diff --git a/src/fontcache.h b/src/fontcache.h index bfb547332..32cfdb9b6 100644 --- a/src/fontcache.h +++ b/src/fontcache.h @@ -44,6 +44,7 @@ extern FreeTypeSettings _freetype; void InitFreeType(bool monospace); void UninitFreeType(); +void ClearFontCache(); const Sprite *GetGlyph(FontSize size, uint32 key); uint GetGlyphWidth(FontSize size, uint32 key); bool GetDrawGlyphShadow(); diff --git a/src/gfxinit.cpp b/src/gfxinit.cpp index b2feb63a8..50efd9ad8 100644 --- a/src/gfxinit.cpp +++ b/src/gfxinit.cpp @@ -256,6 +256,7 @@ void GfxLoadSprites() DEBUG(sprite, 2, "Loading sprite set %d", _settings_game.game_creation.landscape); SwitchNewGRFBlitter(); + ClearFontCache(); GfxInitSpriteMem(); LoadSpriteTables(); GfxInitPalettes(); -- cgit v1.2.3-70-g09d2