mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-12 18:40:29 +00:00
(svn r25860) -Fix [FS#5737] (r25570): When clearing font cache, also clear layout cache. (adf88)
This commit is contained in:
parent
122158b4d8
commit
dcec8b9abd
@ -75,7 +75,7 @@ public:
|
|||||||
virtual SpriteID GetUnicodeGlyph(WChar key);
|
virtual SpriteID GetUnicodeGlyph(WChar key);
|
||||||
virtual void SetUnicodeGlyph(WChar key, SpriteID sprite);
|
virtual void SetUnicodeGlyph(WChar key, SpriteID sprite);
|
||||||
virtual void InitializeUnicodeGlyphMap();
|
virtual void InitializeUnicodeGlyphMap();
|
||||||
virtual void ClearFontCache() {}
|
virtual void ClearFontCache();
|
||||||
virtual const Sprite *GetGlyph(GlyphID key);
|
virtual const Sprite *GetGlyph(GlyphID key);
|
||||||
virtual uint GetGlyphWidth(GlyphID key);
|
virtual uint GetGlyphWidth(GlyphID key);
|
||||||
virtual bool GetDrawGlyphShadow();
|
virtual bool GetDrawGlyphShadow();
|
||||||
@ -162,6 +162,11 @@ void SpriteFontCache::ClearGlyphToSpriteMap()
|
|||||||
this->glyph_to_spriteid_map = NULL;
|
this->glyph_to_spriteid_map = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SpriteFontCache::ClearFontCache()
|
||||||
|
{
|
||||||
|
Layouter::ResetFontCache(this->fs);
|
||||||
|
}
|
||||||
|
|
||||||
const Sprite *SpriteFontCache::GetGlyph(GlyphID key)
|
const Sprite *SpriteFontCache::GetGlyph(GlyphID key)
|
||||||
{
|
{
|
||||||
SpriteID sprite = this->GetUnicodeGlyph(key);
|
SpriteID sprite = this->GetUnicodeGlyph(key);
|
||||||
@ -392,6 +397,8 @@ void FreeTypeFontCache::ClearFontCache()
|
|||||||
|
|
||||||
free(this->glyph_to_sprite);
|
free(this->glyph_to_sprite);
|
||||||
this->glyph_to_sprite = NULL;
|
this->glyph_to_sprite = NULL;
|
||||||
|
|
||||||
|
Layouter::ResetFontCache(this->fs);
|
||||||
}
|
}
|
||||||
|
|
||||||
FreeTypeFontCache::GlyphEntry *FreeTypeFontCache::GetGlyphPtr(GlyphID key)
|
FreeTypeFontCache::GlyphEntry *FreeTypeFontCache::GetGlyphPtr(GlyphID key)
|
||||||
|
@ -159,7 +159,8 @@ static inline void InitializeUnicodeGlyphMap()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void ClearFontCache() {
|
static inline void ClearFontCache()
|
||||||
|
{
|
||||||
for (FontSize fs = FS_BEGIN; fs < FS_END; fs++) {
|
for (FontSize fs = FS_BEGIN; fs < FS_END; fs++) {
|
||||||
FontCache::Get(fs)->ClearFontCache();
|
FontCache::Get(fs)->ClearFontCache();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user