1
0
Fork 0
forked from fte/fteqw

gl_font should now update the menu cache conchars texture

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2224 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2006-04-16 07:22:56 +00:00
parent ba38acd1ce
commit 8709f8ec1f

View file

@ -2279,6 +2279,9 @@ void GL_Fontedgeclamp_Callback(struct cvar_s *var, char *oldvalue)
void GL_Font_Callback(struct cvar_s *var, char *oldvalue)
{
mpic_t *pic;
int old_char_texture = char_texture;
if (!*var->string
|| (!(char_texture=Mod_LoadHiResTexture(var->string, "fonts", false, true, true))
&& !(char_texture=Mod_LoadHiResTexture(var->string, "charsets", false, true, true))))
@ -2289,6 +2292,19 @@ void GL_Font_Callback(struct cvar_s *var, char *oldvalue)
else
custom_char_instep = 0.5f/((image_width+image_height)/2);
// update the conchars texture within the menu cache
if (old_char_texture != char_texture)
{
pic = GLDraw_IsCached("conchars");
if (pic)
{
glpic_t *gl = (glpic_t *)pic->data;
gl->texnum = char_texture;
}
else
Con_Printf(S_ERROR "ERROR: Unable to update conchars texture!");
}
GL_Smoothfont_Callback(&gl_smoothfont, "");
GL_Fontedgeclamp_Callback(&gl_fontedgeclamp, "");
}