From 8709f8ec1fca3ff497f9b548cf52db5575195068 Mon Sep 17 00:00:00 2001 From: TimeServ Date: Sun, 16 Apr 2006 07:22:56 +0000 Subject: [PATCH] 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 --- engine/gl/gl_draw.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/engine/gl/gl_draw.c b/engine/gl/gl_draw.c index 2a980c87f..bebda6cc3 100644 --- a/engine/gl/gl_draw.c +++ b/engine/gl/gl_draw.c @@ -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, ""); }