changeset 5153:00915e32cd0b draft

(svn r7248) -Codechange: Support reinitializing the unicode glyph map.
author peter1138 <peter1138@openttd.org>
date Fri, 24 Nov 2006 18:35:59 +0000
parents a6ef8dcad92b
children 66cac24e8682
files fontcache.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/fontcache.c
+++ b/fontcache.c
@@ -367,6 +367,14 @@
 	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;