Skip to content

Commit

Permalink
Cleanup: Remove unused GetUnicodeGlyph()
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterN committed Sep 25, 2022
1 parent 2cdd8b7 commit b00e18f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 15 deletions.
13 changes: 0 additions & 13 deletions src/fontcache.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,6 @@ class FontCache {
*/
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.
Expand Down Expand Up @@ -166,12 +159,6 @@ class FontCache {
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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/fontcache/spritefontcache.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 0 additions & 1 deletion src/fontcache/truetypefontcache.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ class TrueTypeFontCache : public FontCache {
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;
Expand Down

0 comments on commit b00e18f

Please sign in to comment.