diff options
author | Michael Lutz <michi@icosahedron.de> | 2021-01-16 16:43:31 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2021-02-22 22:16:07 +0100 |
commit | 6776229047c0f5aac540fc9c367e4abbf5302322 (patch) | |
tree | 7fbb643e28155e37d784770894f419383a6bc8e9 /src/fontcache.cpp | |
parent | 70aa3b401145ec6bb98073a2758206cf63e15da1 (diff) | |
download | openttd-6776229047c0f5aac540fc9c367e4abbf5302322.tar.xz |
Codechange: Make the simple Malloc sprite allocator globally usable.
Diffstat (limited to 'src/fontcache.cpp')
-rw-r--r-- | src/fontcache.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/fontcache.cpp b/src/fontcache.cpp index 8ed8708aa..0ae597fa9 100644 --- a/src/fontcache.cpp +++ b/src/fontcache.cpp @@ -277,11 +277,6 @@ void TrueTypeFontCache::SetGlyphPtr(GlyphID key, const GlyphEntry *glyph, bool d this->glyph_to_sprite[GB(key, 8, 8)][GB(key, 0, 8)].duplicate = duplicate; } -void *AllocateFont(size_t size) -{ - return MallocT<byte>(size); -} - /* Check if a glyph should be rendered with anti-aliasing. */ static bool GetFontAAState(FontSize size) @@ -355,7 +350,7 @@ const Sprite *TrueTypeFontCache::GetGlyph(GlyphID key) builtin_questionmark_data }; - Sprite *spr = BlitterFactory::GetCurrentBlitter()->Encode(&builtin_questionmark, AllocateFont); + Sprite *spr = BlitterFactory::GetCurrentBlitter()->Encode(&builtin_questionmark, SimpleSpriteAlloc); assert(spr != nullptr); GlyphEntry new_glyph; new_glyph.sprite = spr; @@ -643,7 +638,7 @@ const Sprite *FreeTypeFontCache::InternalGetGlyph(GlyphID key, bool aa) } GlyphEntry new_glyph; - new_glyph.sprite = BlitterFactory::GetCurrentBlitter()->Encode(&sprite, AllocateFont); + new_glyph.sprite = BlitterFactory::GetCurrentBlitter()->Encode(&sprite, SimpleSpriteAlloc); new_glyph.width = slot->advance.x >> 6; this->SetGlyphPtr(key, &new_glyph); |