summaryrefslogtreecommitdiff
path: root/src/fontcache.cpp
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2020-05-17 23:31:49 +0200
committerMichael Lutz <michi@icosahedron.de>2020-05-21 20:02:34 +0200
commit808c8198d5ab61c457d0351ff7971b75ee17c10a (patch)
tree70459dfbd4c69dd9e82282eed2c6fe68383774f3 /src/fontcache.cpp
parent43cd892e0c2c012355d7eb6d47cfa4ad4b7e68eb (diff)
downloadopenttd-808c8198d5ab61c457d0351ff7971b75ee17c10a.tar.xz
Codechange: Consistently use WChar when passing characters around, and also define it as char32_t.
Diffstat (limited to 'src/fontcache.cpp')
-rw-r--r--src/fontcache.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fontcache.cpp b/src/fontcache.cpp
index 6cdac1fab..051c4ee1d 100644
--- a/src/fontcache.cpp
+++ b/src/fontcache.cpp
@@ -105,13 +105,13 @@ SpriteFontCache::~SpriteFontCache()
this->ClearGlyphToSpriteMap();
}
-SpriteID SpriteFontCache::GetUnicodeGlyph(GlyphID key)
+SpriteID SpriteFontCache::GetUnicodeGlyph(WChar key)
{
if (this->glyph_to_spriteid_map[GB(key, 8, 8)] == nullptr) return 0;
return this->glyph_to_spriteid_map[GB(key, 8, 8)][GB(key, 0, 8)];
}
-void SpriteFontCache::SetUnicodeGlyph(GlyphID key, SpriteID sprite)
+void SpriteFontCache::SetUnicodeGlyph(WChar key, SpriteID sprite)
{
if (this->glyph_to_spriteid_map == nullptr) this->glyph_to_spriteid_map = CallocT<SpriteID*>(256);
if (this->glyph_to_spriteid_map[GB(key, 8, 8)] == nullptr) this->glyph_to_spriteid_map[GB(key, 8, 8)] = CallocT<SpriteID>(256);