From 1955d1acd6b7fa24e47784a1c282c288b6cee8f4 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Fri, 24 Nov 2006 20:47:29 +0000 Subject: [PATCH] (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 | 3 --- gfxinit.c | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gfx.c b/gfx.c index 41c072d628..314de65d7f 100644 --- a/gfx.c +++ b/gfx.c @@ -1613,9 +1613,6 @@ void LoadStringWidthTable(void) { 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); diff --git a/gfxinit.c b/gfxinit.c index 5b88eaf3f5..bc4e3bb4fd 100644 --- a/gfxinit.c +++ b/gfxinit.c @@ -13,6 +13,7 @@ #include "newgrf.h" #include "md5.h" #include "variables.h" +#include "fontcache.h" #include typedef struct MD5File { @@ -372,6 +373,9 @@ static void LoadSpriteTables(void) 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); }