From 02bb0549fadc965f8d298434120fb09e960f1b77 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Thu, 19 Jan 2012 20:22:29 +0000 Subject: [PATCH] some form of a workaround for recursive calling of TexMgr_Anisotropy_f() git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@614 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/gl_texmgr.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Quake/gl_texmgr.c b/Quake/gl_texmgr.c index 72948a47..07eaf7f7 100644 --- a/Quake/gl_texmgr.c +++ b/Quake/gl_texmgr.c @@ -184,12 +184,20 @@ FIXME: this is getting called twice (becuase of the recursive Cvar_SetValue call */ static void TexMgr_Anisotropy_f (cvar_t *var) { - gltexture_t *glt; - - Cvar_SetValue ("gl_texture_anisotropy", CLAMP (1.0f, gl_texture_anisotropy.value, gl_max_anisotropy)); - - for (glt = active_gltextures; glt; glt = glt->next) - TexMgr_SetFilterModes (glt); + if (gl_texture_anisotropy.value < 1) + { + Cvar_SetQuick (&gl_texture_anisotropy, "1"); + } + else if (gl_texture_anisotropy.value > gl_max_anisotropy) + { + Cvar_SetValueQuick (&gl_texture_anisotropy, gl_max_anisotropy); + } + else + { + gltexture_t *glt; + for (glt = active_gltextures; glt; glt = glt->next) + TexMgr_SetFilterModes (glt); + } } /*