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;
}
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
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++;
}