Revert "rename gl_anisotropic to r_anisotropic"

This reverts commit 49af62477a.
This commit is contained in:
Denis Pauk 2018-09-03 21:22:01 +03:00
parent ff6a40ee8c
commit 6adc4cc81c
11 changed files with 67 additions and 68 deletions

View File

@ -42,7 +42,7 @@ extern cvar_t *vid_gamma;
extern cvar_t *vid_fullscreen; extern cvar_t *vid_fullscreen;
extern cvar_t *vid_renderer; extern cvar_t *vid_renderer;
static cvar_t *r_vsync; static cvar_t *r_vsync;
static cvar_t *r_anisotropic; static cvar_t *gl_anisotropic;
static cvar_t *gl_msaa_samples; static cvar_t *gl_msaa_samples;
static menuframework_s s_opengl_menu; static menuframework_s s_opengl_menu;
@ -126,11 +126,11 @@ AnisotropicCallback(void *s)
if (list->curvalue == 0) if (list->curvalue == 0)
{ {
Cvar_SetValue("r_anisotropic", 0); Cvar_SetValue("gl_anisotropic", 0);
} }
else else
{ {
Cvar_SetValue("r_anisotropic", pow(2, list->curvalue)); Cvar_SetValue("gl_anisotropic", pow(2, list->curvalue));
} }
} }
@ -362,9 +362,9 @@ VID_MenuInit(void)
r_vsync = Cvar_Get("r_vsync", "1", CVAR_ARCHIVE); r_vsync = Cvar_Get("r_vsync", "1", CVAR_ARCHIVE);
} }
if (!r_anisotropic) if (!gl_anisotropic)
{ {
r_anisotropic = Cvar_Get("r_anisotropic", "0", CVAR_ARCHIVE); gl_anisotropic = Cvar_Get("gl_anisotropic", "0", CVAR_ARCHIVE);
} }
if (!gl_msaa_samples) if (!gl_msaa_samples)
@ -462,13 +462,13 @@ VID_MenuInit(void)
s_af_list.generic.callback = AnisotropicCallback; s_af_list.generic.callback = AnisotropicCallback;
s_af_list.itemnames = pow2_names; s_af_list.itemnames = pow2_names;
s_af_list.curvalue = 0; s_af_list.curvalue = 0;
if (r_anisotropic->value) if (gl_anisotropic->value)
{ {
do do
{ {
s_af_list.curvalue++; s_af_list.curvalue++;
} while (pow2_names[s_af_list.curvalue] && } while (pow2_names[s_af_list.curvalue] &&
pow(2, s_af_list.curvalue) <= r_anisotropic->value); pow(2, s_af_list.curvalue) <= gl_anisotropic->value);
s_af_list.curvalue--; s_af_list.curvalue--;
} }

View File

@ -202,18 +202,18 @@ R_TextureMode(char *string)
/* clamp selected anisotropy */ /* clamp selected anisotropy */
if (gl_config.anisotropic) if (gl_config.anisotropic)
{ {
if (r_anisotropic->value > gl_config.max_anisotropy) if (gl_anisotropic->value > gl_config.max_anisotropy)
{ {
ri.Cvar_SetValue("r_anisotropic", gl_config.max_anisotropy); ri.Cvar_SetValue("gl_anisotropic", gl_config.max_anisotropy);
} }
else if (r_anisotropic->value < 1.0) else if (gl_anisotropic->value < 1.0)
{ {
ri.Cvar_SetValue("r_anisotropic", 1.0); ri.Cvar_SetValue("gl_anisotropic", 1.0);
} }
} }
else else
{ {
ri.Cvar_SetValue("r_anisotropic", 0.0); ri.Cvar_SetValue("gl_anisotropic", 0.0);
} }
/* change all the existing mipmap texture objects */ /* change all the existing mipmap texture objects */
@ -228,10 +228,10 @@ R_TextureMode(char *string)
gl_filter_max); gl_filter_max);
/* Set anisotropic filter if supported and enabled */ /* Set anisotropic filter if supported and enabled */
if (gl_config.anisotropic && r_anisotropic->value) if (gl_config.anisotropic && gl_anisotropic->value)
{ {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT,
r_anisotropic->value); gl_anisotropic->value);
} }
} }
} }
@ -788,10 +788,10 @@ R_Upload32(unsigned *data, int width, int height, qboolean mipmap)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max);
} }
if (mipmap && gl_config.anisotropic && r_anisotropic->value) if (mipmap && gl_config.anisotropic && gl_anisotropic->value)
{ {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT,
r_anisotropic->value); gl_anisotropic->value);
} }
return res; return res;
} }

View File

@ -124,7 +124,7 @@ cvar_t *r_vsync;
cvar_t *gl_texturemode; cvar_t *gl_texturemode;
cvar_t *gl1_texturealphamode; cvar_t *gl1_texturealphamode;
cvar_t *gl1_texturesolidmode; cvar_t *gl1_texturesolidmode;
cvar_t *r_anisotropic; cvar_t *gl_anisotropic;
cvar_t *r_lockpvs; cvar_t *r_lockpvs;
cvar_t *gl_msaa_samples; cvar_t *gl_msaa_samples;
@ -1241,7 +1241,7 @@ R_Register(void)
gl_texturemode = ri.Cvar_Get("gl_texturemode", "GL_LINEAR_MIPMAP_NEAREST", CVAR_ARCHIVE); gl_texturemode = ri.Cvar_Get("gl_texturemode", "GL_LINEAR_MIPMAP_NEAREST", CVAR_ARCHIVE);
gl1_texturealphamode = ri.Cvar_Get("gl1_texturealphamode", "default", CVAR_ARCHIVE); gl1_texturealphamode = ri.Cvar_Get("gl1_texturealphamode", "default", CVAR_ARCHIVE);
gl1_texturesolidmode = ri.Cvar_Get("gl1_texturesolidmode", "default", CVAR_ARCHIVE); gl1_texturesolidmode = ri.Cvar_Get("gl1_texturesolidmode", "default", CVAR_ARCHIVE);
r_anisotropic = ri.Cvar_Get("r_anisotropic", "0", CVAR_ARCHIVE); gl_anisotropic = ri.Cvar_Get("gl_anisotropic", "0", CVAR_ARCHIVE);
r_lockpvs = ri.Cvar_Get("r_lockpvs", "0", 0); r_lockpvs = ri.Cvar_Get("r_lockpvs", "0", 0);
gl1_palettedtexture = ri.Cvar_Get("gl1_palettedtexture", "0", CVAR_ARCHIVE); gl1_palettedtexture = ri.Cvar_Get("gl1_palettedtexture", "0", CVAR_ARCHIVE);
@ -1676,11 +1676,11 @@ RI_BeginFrame(float camera_separation)
} }
/* texturemode stuff */ /* texturemode stuff */
if (gl_texturemode->modified || (gl_config.anisotropic && r_anisotropic->modified)) if (gl_texturemode->modified || (gl_config.anisotropic && gl_anisotropic->modified))
{ {
R_TextureMode(gl_texturemode->string); R_TextureMode(gl_texturemode->string);
gl_texturemode->modified = false; gl_texturemode->modified = false;
r_anisotropic->modified = false; gl_anisotropic->modified = false;
} }
if (gl1_texturealphamode->modified) if (gl1_texturealphamode->modified)

View File

@ -215,7 +215,7 @@ extern cvar_t *gl1_flashblend;
extern cvar_t *r_modulate; extern cvar_t *r_modulate;
extern cvar_t *gl_drawbuffer; extern cvar_t *gl_drawbuffer;
extern cvar_t *r_vsync; extern cvar_t *r_vsync;
extern cvar_t *r_anisotropic; extern cvar_t *gl_anisotropic;
extern cvar_t *gl_texturemode; extern cvar_t *gl_texturemode;
extern cvar_t *gl1_texturealphamode; extern cvar_t *gl1_texturealphamode;
extern cvar_t *gl1_texturesolidmode; extern cvar_t *gl1_texturesolidmode;

View File

@ -74,18 +74,18 @@ GL3_TextureMode(char *string)
/* clamp selected anisotropy */ /* clamp selected anisotropy */
if (gl3config.anisotropic) if (gl3config.anisotropic)
{ {
if (r_anisotropic->value > gl3config.max_anisotropy) if (gl_anisotropic->value > gl3config.max_anisotropy)
{ {
ri.Cvar_SetValue("r_anisotropic", gl3config.max_anisotropy); ri.Cvar_SetValue("gl_anisotropic", gl3config.max_anisotropy);
} }
else if (r_anisotropic->value < 1.0) else if (gl_anisotropic->value < 1.0)
{ {
ri.Cvar_SetValue("r_anisotropic", 1.0); ri.Cvar_SetValue("gl_anisotropic", 1.0);
} }
} }
else else
{ {
ri.Cvar_SetValue("r_anisotropic", 0.0); ri.Cvar_SetValue("gl_anisotropic", 0.0);
} }
gl3image_t *glt; gl3image_t *glt;
@ -101,9 +101,9 @@ GL3_TextureMode(char *string)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max);
/* Set anisotropic filter if supported and enabled */ /* Set anisotropic filter if supported and enabled */
if (gl3config.anisotropic && r_anisotropic->value) if (gl3config.anisotropic && gl_anisotropic->value)
{ {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, r_anisotropic->value); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, gl_anisotropic->value);
} }
} }
} }
@ -200,9 +200,9 @@ GL3_Upload32(unsigned *data, int width, int height, qboolean mipmap)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max);
} }
if (mipmap && gl3config.anisotropic && r_anisotropic->value) if (mipmap && gl3config.anisotropic && gl_anisotropic->value)
{ {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, r_anisotropic->value); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, gl_anisotropic->value);
} }
return res; return res;

View File

@ -87,7 +87,7 @@ cvar_t *r_mode;
cvar_t *r_customwidth; cvar_t *r_customwidth;
cvar_t *r_customheight; cvar_t *r_customheight;
cvar_t *vid_gamma; cvar_t *vid_gamma;
cvar_t *r_anisotropic; cvar_t *gl_anisotropic;
cvar_t *gl_texturemode; cvar_t *gl_texturemode;
cvar_t *gl_drawbuffer; cvar_t *gl_drawbuffer;
cvar_t *r_clear; cvar_t *r_clear;
@ -216,7 +216,7 @@ GL3_Register(void)
gl_nobind = ri.Cvar_Get("gl_nobind", "0", 0); gl_nobind = ri.Cvar_Get("gl_nobind", "0", 0);
gl_texturemode = ri.Cvar_Get("gl_texturemode", "GL_LINEAR_MIPMAP_NEAREST", CVAR_ARCHIVE); gl_texturemode = ri.Cvar_Get("gl_texturemode", "GL_LINEAR_MIPMAP_NEAREST", CVAR_ARCHIVE);
r_anisotropic = ri.Cvar_Get("r_anisotropic", "0", CVAR_ARCHIVE); gl_anisotropic = ri.Cvar_Get("gl_anisotropic", "0", CVAR_ARCHIVE);
vid_fullscreen = ri.Cvar_Get("vid_fullscreen", "0", CVAR_ARCHIVE); vid_fullscreen = ri.Cvar_Get("vid_fullscreen", "0", CVAR_ARCHIVE);
vid_gamma = ri.Cvar_Get("vid_gamma", "1.2", CVAR_ARCHIVE); vid_gamma = ri.Cvar_Get("vid_gamma", "1.2", CVAR_ARCHIVE);
@ -276,7 +276,7 @@ GL3_Register(void)
//gl_texturemode = ri.Cvar_Get("gl_texturemode", "GL_LINEAR_MIPMAP_NEAREST", CVAR_ARCHIVE); //gl_texturemode = ri.Cvar_Get("gl_texturemode", "GL_LINEAR_MIPMAP_NEAREST", CVAR_ARCHIVE);
gl1_texturealphamode = ri.Cvar_Get("gl1_texturealphamode", "default", CVAR_ARCHIVE); gl1_texturealphamode = ri.Cvar_Get("gl1_texturealphamode", "default", CVAR_ARCHIVE);
gl1_texturesolidmode = ri.Cvar_Get("gl1_texturesolidmode", "default", CVAR_ARCHIVE); gl1_texturesolidmode = ri.Cvar_Get("gl1_texturesolidmode", "default", CVAR_ARCHIVE);
//r_anisotropic = ri.Cvar_Get("r_anisotropic", "0", CVAR_ARCHIVE); //gl_anisotropic = ri.Cvar_Get("gl_anisotropic", "0", CVAR_ARCHIVE);
//r_lockpvs = ri.Cvar_Get("r_lockpvs", "0", 0); //r_lockpvs = ri.Cvar_Get("r_lockpvs", "0", 0);
//gl1_palettedtexture = ri.Cvar_Get("gl1_palettedtexture", "0", CVAR_ARCHIVE); NOPE. //gl1_palettedtexture = ri.Cvar_Get("gl1_palettedtexture", "0", CVAR_ARCHIVE); NOPE.
@ -1657,11 +1657,11 @@ GL3_BeginFrame(float camera_separation)
} }
/* texturemode stuff */ /* texturemode stuff */
if (gl_texturemode->modified || (gl3config.anisotropic && r_anisotropic->modified)) if (gl_texturemode->modified || (gl3config.anisotropic && gl_anisotropic->modified))
{ {
GL3_TextureMode(gl_texturemode->string); GL3_TextureMode(gl_texturemode->string);
gl_texturemode->modified = false; gl_texturemode->modified = false;
r_anisotropic->modified = false; gl_anisotropic->modified = false;
} }
if (r_vsync->modified) if (r_vsync->modified)

View File

@ -498,7 +498,7 @@ extern cvar_t *r_drawworld;
extern cvar_t *vid_gamma; extern cvar_t *vid_gamma;
extern cvar_t *gl3_intensity; extern cvar_t *gl3_intensity;
extern cvar_t *gl3_intensity_2D; extern cvar_t *gl3_intensity_2D;
extern cvar_t *r_anisotropic; extern cvar_t *gl_anisotropic;
extern cvar_t *r_lightlevel; extern cvar_t *r_lightlevel;
extern cvar_t *gl3_overbrightbits; extern cvar_t *gl3_overbrightbits;

View File

@ -133,7 +133,7 @@ cvar_t *sw_surfcacheoverride;
cvar_t *sw_waterwarp; cvar_t *sw_waterwarp;
static cvar_t *sw_overbrightbits; static cvar_t *sw_overbrightbits;
cvar_t *sw_custom_particles; cvar_t *sw_custom_particles;
cvar_t *r_anisotropic; cvar_t *sw_texture_filtering;
cvar_t *r_drawworld; cvar_t *r_drawworld;
static cvar_t *r_drawentities; static cvar_t *r_drawentities;
@ -283,7 +283,7 @@ R_Register (void)
sw_waterwarp = ri.Cvar_Get ("sw_waterwarp", "1", 0); sw_waterwarp = ri.Cvar_Get ("sw_waterwarp", "1", 0);
sw_overbrightbits = ri.Cvar_Get("sw_overbrightbits", "1.0", CVAR_ARCHIVE); sw_overbrightbits = ri.Cvar_Get("sw_overbrightbits", "1.0", CVAR_ARCHIVE);
sw_custom_particles = ri.Cvar_Get("sw_custom_particles", "0", CVAR_ARCHIVE); sw_custom_particles = ri.Cvar_Get("sw_custom_particles", "0", CVAR_ARCHIVE);
r_anisotropic = ri.Cvar_Get("r_anisotropic", "0", CVAR_ARCHIVE); sw_texture_filtering = ri.Cvar_Get("sw_texture_filtering", "0", CVAR_ARCHIVE);
r_mode = ri.Cvar_Get( "r_mode", "0", CVAR_ARCHIVE ); r_mode = ri.Cvar_Get( "r_mode", "0", CVAR_ARCHIVE );
r_lefthand = ri.Cvar_Get( "hand", "0", CVAR_USERINFO | CVAR_ARCHIVE ); r_lefthand = ri.Cvar_Get( "hand", "0", CVAR_USERINFO | CVAR_ARCHIVE );

View File

@ -486,7 +486,7 @@ NonTurbulentPow2 (espan_t *pspan)
//==================== //====================
// Enable custom filtering // Enable custom filtering
extern cvar_t *r_anisotropic; extern cvar_t *sw_texture_filtering;
static const int filtering_kernel[2][2][2] = { static const int filtering_kernel[2][2][2] = {
{ {
{0x1 << (SHIFT16XYZ-2), 0x0}, {0x1 << (SHIFT16XYZ-2), 0x0},
@ -604,7 +604,7 @@ D_DrawSpansPow2 (espan_t *pspan)
pbase = (unsigned char *)cacheblock; pbase = (unsigned char *)cacheblock;
texture_filtering = (int)r_anisotropic->value; texture_filtering = (int)sw_texture_filtering->value;
sdivzpow2stepu = d_sdivzstepu * spanstep_value; sdivzpow2stepu = d_sdivzstepu * spanstep_value;
tdivzpow2stepu = d_tdivzstepu * spanstep_value; tdivzpow2stepu = d_tdivzstepu * spanstep_value;
zipow2stepu = d_zistepu * spanstep_value; zipow2stepu = d_zistepu * spanstep_value;

View File

@ -39,7 +39,6 @@ typedef struct
replacement_t replacements[] = { replacement_t replacements[] = {
{"cd_shuffle", "ogg_shuffle"}, {"cd_shuffle", "ogg_shuffle"},
{"cl_drawfps", "cl_showfps"}, {"cl_drawfps", "cl_showfps"},
{"gl_anisotropic", "r_anisotropic"},
{"gl_drawentities", "r_drawentities"}, {"gl_drawentities", "r_drawentities"},
{"gl_drawworld", "r_drawworld"}, {"gl_drawworld", "r_drawworld"},
{"gl_fullbright", "r_fullbright"}, {"gl_fullbright", "r_fullbright"},

View File

@ -163,15 +163,15 @@ Graphics (all renderers):
* **r_vsync**: Enables the vsync: frames are synchronized with * **r_vsync**: Enables the vsync: frames are synchronized with
display refresh rate, should (but doesn't always) prevent tearing. display refresh rate, should (but doesn't always) prevent tearing.
* **r_anisotropic**: Anisotropic filtering. Possible values are
dependent on the GPU driver, most of them support `1`, `2`, `4`, `8`
and `16`. Anisotropic filtering gives a huge improvement to texture
quality by a negligible performance impact.
Graphics (GL renderers only): Graphics (GL renderers only):
----------------------------- -----------------------------
* **gl_anisotropic**: Anisotropic filtering. Possible values are
dependent on the GPU driver, most of them support `1`, `2`, `4`, `8`
and `16`. Anisotropic filtering gives a huge improvement to texture
quality by a negligible performance impact.
* **gl_msaa_samples**: Full scene anti aliasing samples. The number of * **gl_msaa_samples**: Full scene anti aliasing samples. The number of
samples depends on the GPU driver, most drivers support at least samples depends on the GPU driver, most drivers support at least
`2`, `4` and `8` samples. If an invalid value is set, the value is `2`, `4` and `8` samples. If an invalid value is set, the value is