summaryrefslogtreecommitdiff
path: root/src/fontcache.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-10-13 13:28:06 +0000
committerfrosch <frosch@openttd.org>2013-10-13 13:28:06 +0000
commitdcec8b9abdf4c7fb87d6aa29e407bdf182ab6864 (patch)
tree21ca81181232bfbef3b0263a4b8a0f5b174cc774 /src/fontcache.cpp
parent122158b4d857e50d7d4dd4cd41dc0a8f7a077ae3 (diff)
downloadopenttd-dcec8b9abdf4c7fb87d6aa29e407bdf182ab6864.tar.xz
(svn r25860) -Fix [FS#5737] (r25570): When clearing font cache, also clear layout cache. (adf88)
Diffstat (limited to 'src/fontcache.cpp')
-rw-r--r--src/fontcache.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/fontcache.cpp b/src/fontcache.cpp
index cf4aa0765..9e95fee64 100644
--- a/src/fontcache.cpp
+++ b/src/fontcache.cpp
@@ -75,7 +75,7 @@ public:
virtual SpriteID GetUnicodeGlyph(WChar key);
virtual void SetUnicodeGlyph(WChar key, SpriteID sprite);
virtual void InitializeUnicodeGlyphMap();
- virtual void ClearFontCache() {}
+ virtual void ClearFontCache();
virtual const Sprite *GetGlyph(GlyphID key);
virtual uint GetGlyphWidth(GlyphID key);
virtual bool GetDrawGlyphShadow();
@@ -162,6 +162,11 @@ void SpriteFontCache::ClearGlyphToSpriteMap()
this->glyph_to_spriteid_map = NULL;
}
+void SpriteFontCache::ClearFontCache()
+{
+ Layouter::ResetFontCache(this->fs);
+}
+
const Sprite *SpriteFontCache::GetGlyph(GlyphID key)
{
SpriteID sprite = this->GetUnicodeGlyph(key);
@@ -392,6 +397,8 @@ void FreeTypeFontCache::ClearFontCache()
free(this->glyph_to_sprite);
this->glyph_to_sprite = NULL;
+
+ Layouter::ResetFontCache(this->fs);
}
FreeTypeFontCache::GlyphEntry *FreeTypeFontCache::GetGlyphPtr(GlyphID key)