added gl_smoothcrosshair, defaults to 1, 0 = don't smooth, 1 = old behavior (smooth on crosshairsize > 16 or using image)

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2212 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2006-04-15 07:10:49 +00:00
parent 960b2b8d96
commit 70d31d2617
2 changed files with 17 additions and 15 deletions

View file

@ -110,6 +110,7 @@ cvar_t gl_font = SCVARF("gl_font", "", CVAR_RENDERERCALLBACK);
//gl blends. Set this to 1 to stop the outside of your conchars from being visible
cvar_t gl_fontedgeclamp = SCVAR("gl_fontedgeclamp", "0");
cvar_t gl_smoothfont = SCVAR("gl_smoothfont", "1");
cvar_t gl_smoothcrosshair = SCVAR("gl_smoothcrosshair", "1");
#endif
cvar_t gl_motionblur = SCVARF("gl_motionblur", "0", CVAR_ARCHIVE);
cvar_t gl_motionblurscale = SCVAR("gl_motionblurscale", "1");
@ -318,6 +319,7 @@ void GLRenderer_Init(void)
Cvar_Register (&gl_font, GRAPHICALNICETIES);
Cvar_Register (&gl_conback, GRAPHICALNICETIES);
Cvar_Register (&gl_smoothfont, GRAPHICALNICETIES);
Cvar_Register (&gl_smoothcrosshair, GRAPHICALNICETIES);
Cvar_Register (&gl_bump, GRAPHICALNICETIES);
Cvar_Register (&r_shadow_glsl_offsetmapping, GRAPHICALNICETIES);

View file

@ -61,7 +61,7 @@ extern cvar_t gl_lerpimages;
extern cvar_t gl_picmip2d;
extern cvar_t r_drawdisk;
extern cvar_t gl_compress;
extern cvar_t gl_smoothfont, gl_fontedgeclamp;
extern cvar_t gl_smoothfont, gl_smoothcrosshair, gl_fontedgeclamp;
extern cvar_t gl_texturemode;
extern cvar_t cl_noblink;
@ -1399,7 +1399,7 @@ void GLDraw_Crosshair(void)
float x1, x2, y1, y2;
float size, chc;
int usecolor = 0;
qboolean usingimage = false;
if (crosshair.value == 1 && !*crosshairimage.string)
{
@ -1414,7 +1414,7 @@ void GLDraw_Crosshair(void)
if (*crosshairimage.string)
{
usecolor = 1;
usingimage = true;
GL_Bind (externalhair);
chc = 0;
@ -1430,17 +1430,6 @@ void GLDraw_Crosshair(void)
if (crosshair.value >= FIRSTANIMATEDCROSHAIR)
GLCrosshair_Callback(&crosshair, "");
if (crosshairsize.value <= 16)
{
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
}
else
{
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
}
if (crosshairalpha.value<1)
{
qglEnable (GL_BLEND);
@ -1455,7 +1444,7 @@ void GLDraw_Crosshair(void)
else
return;
if (usecolor)
if (usingimage)
qglColor4f(chcolor[0], chcolor[1], chcolor[2], crosshairalpha.value);
else
qglColor4f(1, 1, 1, crosshairalpha.value);
@ -1463,6 +1452,17 @@ void GLDraw_Crosshair(void)
size = crosshairsize.value;
chc = size * chc;
if (gl_smoothcrosshair.value && (size > 16 || usingimage))
{
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
}
else
{
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
}
for (sc = 0; sc < cl.splitclients; sc++)
{
SCR_CrosshairPosition(sc, &x, &y);