]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
try using imagefont from fallbacks as well (.tga and .width)
authorblub <blub@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 28 Dec 2009 12:08:54 +0000 (12:08 +0000)
committerblub <blub@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 28 Dec 2009 12:08:54 +0000 (12:08 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9719 d7cf8633-e32d-0410-b094-e92efae38249

gl_draw.c

index 1c5b4ad2dd85a995c8b494f99f445c25ee79851c..7b835c1018a8d63eacf8c025a787b50cc4a3cceb 100644 (file)
--- 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);