(svn r7254) -Fix (r7250): move unicode glyph map initialisation to just before newgrf files are loaded, else newgrf glyphs will be cleared out too. (thanks Hadez)
authorpeter1138
Fri, 24 Nov 2006 20:47:29 +0000
changeset 5156 5edaa8f9b295
parent 5155 64f930853bea
child 5157 4ffb95a16b96
(svn r7254) -Fix (r7250): move unicode glyph map initialisation to just before newgrf files are loaded, else newgrf glyphs will be cleared out too. (thanks Hadez)
gfx.c
gfxinit.c
--- a/gfx.c	Fri Nov 24 18:39:22 2006 +0000
+++ b/gfx.c	Fri Nov 24 20:47:29 2006 +0000
@@ -1613,9 +1613,6 @@
 {
 	uint i;
 
-	/* Initialize the unicode to sprite mapping table */
-	InitializeUnicodeGlyphMap();
-
 	/* Normal font */
 	for (i = 0; i != 224; i++) {
 		_stringwidth_table[FS_NORMAL][i] = GetGlyphWidth(FS_NORMAL, i + 32);
--- a/gfxinit.c	Fri Nov 24 18:39:22 2006 +0000
+++ b/gfxinit.c	Fri Nov 24 20:47:29 2006 +0000
@@ -13,6 +13,7 @@
 #include "newgrf.h"
 #include "md5.h"
 #include "variables.h"
+#include "fontcache.h"
 #include <string.h>
 
 typedef struct MD5File {
@@ -372,6 +373,9 @@
 	assert(load_index == SPR_AIRPORTX_BASE);
 	load_index += LoadGrfFile("airports.grf", load_index, i++);
 
+	/* Initialize the unicode to sprite mapping table */
+	InitializeUnicodeGlyphMap();
+
 	LoadNewGRF(load_index, i);
 }