From: blub Date: Mon, 28 Dec 2009 12:08:54 +0000 (+0000) Subject: try using imagefont from fallbacks as well (.tga and .width) X-Git-Tag: xonotic-v0.1.0preview~929 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7c3c2380f90efe1407815224051916034c1bba96;p=xonotic%2Fdarkplaces.git try using imagefont from fallbacks as well (.tga and .width) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9719 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_draw.c b/gl_draw.c index 1c5b4ad2..7b835c10 100644 --- a/gl_draw.c +++ b/gl_draw.c @@ -564,8 +564,21 @@ static void LoadFont(qboolean override, const char *name, dp_font_t *fnt) fnt->tex = Draw_CachePic_Flags(fnt->texpath, CACHEPICFLAG_QUIET | CACHEPICFLAG_NOCOMPRESSION)->tex; if(fnt->tex == r_texture_notexture) { - fnt->tex = Draw_CachePic_Flags("gfx/conchars", CACHEPICFLAG_NOCOMPRESSION)->tex; - strlcpy(widthfile, "gfx/conchars.width", sizeof(widthfile)); + for (i = 0; i < MAX_FONT_FALLBACKS; ++i) + { + if (!fnt->fallbacks[i][0]) + break; + fnt->tex = Draw_CachePic_Flags(fnt->fallbacks[i], CACHEPICFLAG_QUIET | CACHEPICFLAG_NOCOMPRESSION)->tex; + if(fnt->tex != r_texture_notexture) + break; + } + if(fnt->tex == r_texture_notexture) + { + fnt->tex = Draw_CachePic_Flags("gfx/conchars", CACHEPICFLAG_NOCOMPRESSION)->tex; + strlcpy(widthfile, "gfx/conchars.width", sizeof(widthfile)); + } + else + dpsnprintf(widthfile, sizeof(widthfile), "%s.width", fnt->fallbacks[i]); } else dpsnprintf(widthfile, sizeof(widthfile), "%s.width", fnt->texpath);