]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_draw.c
adding my own IPv6 master server: dpmaster.div0.qc.to - default master server 4 ...
[xonotic/darkplaces.git] / gl_draw.c
index 6697db4263d7c1d1e096e1deebcb334fb650ad9f..5c06e4938416c95d9682e12541bf37075136b967 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -334,7 +334,12 @@ cachepic_t *Draw_CachePic_Flags(const char *path, unsigned int cachepicflags)
                        if(!((pic->texflags ^ texflags) & ~(TEXF_COMPRESS))) // ignore TEXF_COMPRESS when comparing, because fallback pics remove the flag
                        {
                                if(!(cachepicflags & CACHEPICFLAG_NOTPERSISTENT))
-                                       pic->autoload = false; // persist it
+                               {
+                                       if(pic->tex)
+                                               pic->autoload = false; // persist it
+                                       else
+                                               goto reload; // load it below, and then persist
+                               }
                                return pic;
                        }
 
@@ -350,6 +355,7 @@ cachepic_t *Draw_CachePic_Flags(const char *path, unsigned int cachepicflags)
        pic->chain = cachepichash[hashkey];
        cachepichash[hashkey] = pic;
 
+reload:
        // check whether it is an dynamic texture (if so, we can directly use its texture handler)
        pic->tex = CL_GetDynTexture( path );
        // if so, set the width/height, too
@@ -888,10 +894,28 @@ static void LoadFont_f(void)
                                        voffset = atof(Cmd_Argv(i));
                                continue;
                        }
+
+                       if (sizes == -1)
+                               continue; // no slot for other sizes
+
                        // parse one of sizes
                        sz = atof(Cmd_Argv(i));
                        if (sz > 0.001f && sz < 1000.0f) // do not use crap sizes
                        {
+                               // search for duplicated sizes
+                               int j;
+                               for (j=0; j<sizes; j++)
+                                       if (f->req_sizes[j] == sz)
+                                               break;
+                               if (j != sizes)
+                                       continue; // sz already in req_sizes, don't add it again
+
+                               if (sizes == MAX_FONT_SIZES)
+                               {
+                                       Con_Printf("Warning: specified more than %i different font sizes, exceding ones are ignored\n", MAX_FONT_SIZES);
+                                       sizes = -1;
+                                       continue;
+                               }
                                f->req_sizes[sizes] = sz;
                                sizes++;
                        }