From b00e18fe9f5baa835fbc2d9a1f10bb914b0e1c58 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sat, 17 Sep 2022 23:23:51 +0100 Subject: [PATCH] Cleanup: Remove unused GetUnicodeGlyph() --- src/fontcache.h | 13 ------------- src/fontcache/spritefontcache.h | 2 +- src/fontcache/truetypefontcache.h | 1 - 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/fontcache.h b/src/fontcache.h index c52ebec1ca..8eb6535a53 100644 --- a/src/fontcache.h +++ b/src/fontcache.h @@ -71,13 +71,6 @@ public: */ virtual int GetFontSize() const { return this->height; } - /** - * Get the SpriteID mapped to the given key - * @param key The key to get the sprite for. - * @return The sprite. - */ - virtual SpriteID GetUnicodeGlyph(WChar key) = 0; - /** * Map a SpriteID to the key * @param key The key to map to. @@ -166,12 +159,6 @@ public: virtual bool IsBuiltInFont() = 0; }; -/** Get the SpriteID mapped to the given font size and key */ -static inline SpriteID GetUnicodeGlyph(FontSize size, WChar key) -{ - return FontCache::Get(size)->GetUnicodeGlyph(key); -} - /** Map a SpriteID to the font size and key */ static inline void SetUnicodeGlyph(FontSize size, WChar key, SpriteID sprite) { diff --git a/src/fontcache/spritefontcache.h b/src/fontcache/spritefontcache.h index 3d67ff5744..a47b4ac18f 100644 --- a/src/fontcache/spritefontcache.h +++ b/src/fontcache/spritefontcache.h @@ -17,12 +17,12 @@ class SpriteFontCache : public FontCache { private: SpriteID **glyph_to_spriteid_map; ///< Mapping of glyphs to sprite IDs. + SpriteID GetUnicodeGlyph(WChar key); void ClearGlyphToSpriteMap(); public: SpriteFontCache(FontSize fs); ~SpriteFontCache(); - virtual SpriteID GetUnicodeGlyph(WChar key); virtual void SetUnicodeGlyph(WChar key, SpriteID sprite); virtual void InitializeUnicodeGlyphMap(); virtual void ClearFontCache(); diff --git a/src/fontcache/truetypefontcache.h b/src/fontcache/truetypefontcache.h index 2c2f848da5..f8ef423909 100644 --- a/src/fontcache/truetypefontcache.h +++ b/src/fontcache/truetypefontcache.h @@ -63,7 +63,6 @@ public: TrueTypeFontCache(FontSize fs, int pixels); virtual ~TrueTypeFontCache(); int GetFontSize() const override { return this->used_size; } - SpriteID GetUnicodeGlyph(WChar key) override { return this->parent->GetUnicodeGlyph(key); } void SetUnicodeGlyph(WChar key, SpriteID sprite) override { this->parent->SetUnicodeGlyph(key, sprite); } void InitializeUnicodeGlyphMap() override { this->parent->InitializeUnicodeGlyphMap(); } const Sprite *GetGlyph(GlyphID key) override;