rename gl_anisotropic to r_anisotropic

This commit is contained in:
Denis Pauk 2018-08-10 23:33:46 +03:00
parent ba38bf4f88
commit 49af62477a
11 changed files with 68 additions and 67 deletions

View file

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

View file

@ -202,18 +202,18 @@ R_TextureMode(char *string)
/* clamp selected anisotropy */
if (gl_config.anisotropic)
{
if (gl_anisotropic->value > gl_config.max_anisotropy)
if (r_anisotropic->value > gl_config.max_anisotropy)
{
ri.Cvar_SetValue("gl_anisotropic", gl_config.max_anisotropy);
ri.Cvar_SetValue("r_anisotropic", gl_config.max_anisotropy);
}
else if (gl_anisotropic->value < 1.0)
else if (r_anisotropic->value < 1.0)
{
ri.Cvar_SetValue("gl_anisotropic", 1.0);
ri.Cvar_SetValue("r_anisotropic", 1.0);
}
}
else
{
ri.Cvar_SetValue("gl_anisotropic", 0.0);
ri.Cvar_SetValue("r_anisotropic", 0.0);
}
/* change all the existing mipmap texture objects */
@ -228,10 +228,10 @@ R_TextureMode(char *string)
gl_filter_max);
/* Set anisotropic filter if supported and enabled */
if (gl_config.anisotropic && gl_anisotropic->value)
if (gl_config.anisotropic && r_anisotropic->value)
{
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT,
gl_anisotropic->value);
r_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);
}
if (mipmap && gl_config.anisotropic && gl_anisotropic->value)
if (mipmap && gl_config.anisotropic && r_anisotropic->value)
{
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT,
gl_anisotropic->value);
r_anisotropic->value);
}
return res;
}

View file

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

View file

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

View file

@ -74,18 +74,18 @@ GL3_TextureMode(char *string)
/* clamp selected anisotropy */
if (gl3config.anisotropic)
{
if (gl_anisotropic->value > gl3config.max_anisotropy)
if (r_anisotropic->value > gl3config.max_anisotropy)
{
ri.Cvar_SetValue("gl_anisotropic", gl3config.max_anisotropy);
ri.Cvar_SetValue("r_anisotropic", gl3config.max_anisotropy);
}
else if (gl_anisotropic->value < 1.0)
else if (r_anisotropic->value < 1.0)
{
ri.Cvar_SetValue("gl_anisotropic", 1.0);
ri.Cvar_SetValue("r_anisotropic", 1.0);
}
}
else
{
ri.Cvar_SetValue("gl_anisotropic", 0.0);
ri.Cvar_SetValue("r_anisotropic", 0.0);
}
gl3image_t *glt;
@ -101,9 +101,9 @@ GL3_TextureMode(char *string)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max);
/* Set anisotropic filter if supported and enabled */
if (gl3config.anisotropic && gl_anisotropic->value)
if (gl3config.anisotropic && r_anisotropic->value)
{
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, gl_anisotropic->value);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, r_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);
}
if (mipmap && gl3config.anisotropic && gl_anisotropic->value)
if (mipmap && gl3config.anisotropic && r_anisotropic->value)
{
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, gl_anisotropic->value);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, r_anisotropic->value);
}
return res;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -163,15 +163,15 @@ Graphics (all renderers):
* **r_vsync**: Enables the vsync: frames are synchronized with
display refresh rate, should (but doesn't always) prevent tearing.
Graphics (GL renderers only):
-----------------------------
* **gl_anisotropic**: Anisotropic filtering. Possible values are
* **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):
-----------------------------
* **gl_msaa_samples**: Full scene anti aliasing samples. The number of
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