From 0602ff7869df0e58e02522c1318d8254866a9cc6 Mon Sep 17 00:00:00 2001 From: Sander van Dijk Date: Mon, 23 Jan 2012 18:51:12 +0000 Subject: [PATCH] gl_texmgr.c: some small improvements and cleanup. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@621 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/gl_texmgr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Quake/gl_texmgr.c b/Quake/gl_texmgr.c index 0cecd96b..43ee0ce6 100644 --- a/Quake/gl_texmgr.c +++ b/Quake/gl_texmgr.c @@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. const int gl_solid_format = 3; const int gl_alpha_format = 4; -static cvar_t gl_texturemode = {"gl_texturemode", "GL_LINEAR_MIPMAP_LINEAR", CVAR_ARCHIVE}; +static cvar_t gl_texturemode = {"gl_texturemode", "", CVAR_ARCHIVE}; static cvar_t gl_texture_anisotropy = {"gl_texture_anisotropy", "1", CVAR_ARCHIVE}; static cvar_t gl_max_size = {"gl_max_size", "0", CVAR_NONE}; static cvar_t gl_picmip = {"gl_picmip", "0", CVAR_NONE}; @@ -66,8 +66,8 @@ static glmode_t modes[] = { {GL_LINEAR, GL_LINEAR_MIPMAP_NEAREST, "GL_LINEAR_MIPMAP_NEAREST"}, {GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, "GL_LINEAR_MIPMAP_LINEAR"}, }; -#define NUM_GLMODES 6 -static int mode = 5; // bilinear +#define NUM_GLMODES ( sizeof(modes)/sizeof(modes[0]) ) +static int mode = NUM_GLMODES - 1; /* trilinear */ /* =============== @@ -584,8 +584,8 @@ void TexMgr_Init (void) Cvar_RegisterVariable (&gl_picmip); Cvar_RegisterVariable (&gl_texture_anisotropy); Cvar_SetCallback (&gl_texture_anisotropy, &TexMgr_Anisotropy_f); + gl_texturemode.string = modes[mode].name; Cvar_RegisterVariable (&gl_texturemode); - Cvar_SetQuick (&gl_texturemode, modes[mode].name); // sync with mode Cvar_SetCallback (&gl_texturemode, &TexMgr_TextureMode_f); Cmd_AddCommand ("gl_describetexturemodes", &TexMgr_DescribeTextureModes_f); Cmd_AddCommand ("imagelist", &TexMgr_Imagelist_f);