summaryrefslogtreecommitdiff
path: root/fontcache.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-11-24 18:35:59 +0000
committerpeter1138 <peter1138@openttd.org>2006-11-24 18:35:59 +0000
commit6fabaeeb23f975126d165709be2643c27405a692 (patch)
tree40b0f751ab0b1f19816a41a2798c2cf9f16c74ab /fontcache.c
parentb3edc8b42e23f7aedc56b94fe8de0cb50166a370 (diff)
downloadopenttd-6fabaeeb23f975126d165709be2643c27405a692.tar.xz
(svn r7248) -Codechange: Support reinitializing the unicode glyph map.
Diffstat (limited to 'fontcache.c')
-rw-r--r--fontcache.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fontcache.c b/fontcache.c
index 7d4d76920..2d02da9d3 100644
--- a/fontcache.c
+++ b/fontcache.c
@@ -367,6 +367,14 @@ void InitializeUnicodeGlyphMap(void)
uint i;
for (size = FS_NORMAL; size != FS_END; size++) {
+ /* Clear out existing glyph map if it exists */
+ if (_unicode_glyph_map[size] != NULL) {
+ for (i = 0; i < 256; i++) {
+ if (_unicode_glyph_map[size][i] != NULL) free(_unicode_glyph_map[size][i]);
+ }
+ _unicode_glyph_map[size] = NULL;
+ }
+
base = GetFontBase(size);
for (i = ASCII_LETTERSTART; i < 256; i++) {
sprite = base + i - ASCII_LETTERSTART;