Framerate will be more stable when picking up items/getting shot/etc.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3025 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2008-07-16 00:19:33 +00:00
parent 887a278bce
commit c29cf3db99
4 changed files with 27 additions and 16 deletions

View File

@ -494,7 +494,7 @@ extern cvar_t gl_cull;
extern cvar_t gl_poly;
extern cvar_t gl_smoothmodels;
extern cvar_t gl_affinemodels;
extern cvar_t gl_polyblend;
extern cvar_t gl_nohwblend;
extern cvar_t gl_keeptjunctions;
extern cvar_t gl_reporttjunctions;
extern cvar_t r_flashblend;

View File

@ -302,7 +302,7 @@ cvar_t gl_overbright_all = SCVARF ("gl_overbright_all", "0",
CVAR_ARCHIVE);
cvar_t gl_picmip = SCVAR ("gl_picmip", "0");
cvar_t gl_picmip2d = SCVAR ("gl_picmip2d", "0");
cvar_t gl_polyblend = SCVAR ("gl_polyblend","1");
cvar_t gl_nohwblend = SCVAR ("gl_nohwblend","1");
cvar_t gl_savecompressedtex = SCVAR ("gl_savecompressedtex", "0");
cvar_t gl_schematics = SCVAR ("gl_schematics", "0");
cvar_t gl_skyboxdist = SCVAR ("gl_skyboxdist", "2300");
@ -389,7 +389,7 @@ void GLRenderer_Init(void)
Cvar_Register (&gl_cull, GLRENDEREROPTIONS);
Cvar_Register (&gl_smoothmodels, GRAPHICALNICETIES);
Cvar_Register (&gl_affinemodels, GLRENDEREROPTIONS);
Cvar_Register (&gl_polyblend, GLRENDEREROPTIONS);
Cvar_Register (&gl_nohwblend, GLRENDEREROPTIONS);
Cvar_Register (&r_flashblend, GLRENDEREROPTIONS);
Cvar_Register (&gl_playermip, GLRENDEREROPTIONS);
Cvar_Register (&gl_nocolors, GLRENDEREROPTIONS);

View File

@ -84,6 +84,7 @@ cvar_t crosshairimage = SCVARF("crosshairimage", "", CVAR_RENDERERCALLBACK);
cvar_t crosshairalpha = SCVAR("crosshairalpha", "1");
cvar_t gl_cshiftpercent = SCVAR("gl_cshiftpercent", "100");
cvar_t gl_cshiftenabled = SCVAR("gl_polyblend", "1");
cvar_t v_bonusflash = SCVAR("v_bonusflash", "1");
@ -652,11 +653,7 @@ void GLV_CalcBlend (void)
{
// if (j != CSHIFT_SERVER)
// {
if (!gl_cshiftpercent.value
#ifdef RGLQUAKE
|| !gl_polyblend.value
#endif
)
if (!gl_cshiftpercent.value || !gl_cshiftenabled.value)
continue;
a2 = ((cl.cshifts[j].percent * gl_cshiftpercent.value) / 100.0) / 255.0;
@ -709,17 +706,28 @@ void GLV_UpdatePalette (qboolean force, double ftime)
for (i=0 ; i<CSHIFT_SERVER ; i++)
{
if (cl.cshifts[i].percent != cl.prev_cshifts[i].percent)
if (gl_nohwblend.value || !gl_cshiftenabled.value)
{
update = true;
cl.prev_cshifts[i].percent = cl.cshifts[i].percent;
}
for (j=0 ; j<3 ; j++)
if (cl.cshifts[i].destcolor[j] != cl.prev_cshifts[i].destcolor[j])
if (0 != cl.prev_cshifts[i].percent)
{
update = true;
cl.prev_cshifts[i].destcolor[j] = cl.cshifts[i].destcolor[j];
cl.prev_cshifts[i].percent = 0;
}
}
else
{
if (cl.cshifts[i].percent != cl.prev_cshifts[i].percent)
{
update = true;
cl.prev_cshifts[i].percent = cl.cshifts[i].percent;
}
for (j=0 ; j<3 ; j++)
if (cl.cshifts[i].destcolor[j] != cl.prev_cshifts[i].destcolor[j])
{
update = true;
cl.prev_cshifts[i].destcolor[j] = cl.cshifts[i].destcolor[j];
}
}
}
// drop the damage value
@ -737,6 +745,8 @@ void GLV_UpdatePalette (qboolean force, double ftime)
GLV_CalcBlend ();
a = v_blend[3];
if (gl_nohwblend.value)
a = 0;
r = 255*v_blend[0]*a;
g = 255*v_blend[1]*a;
b = 255*v_blend[2]*a;
@ -1656,6 +1666,7 @@ void V_Init (void)
Cvar_Register (&cl_crossx, VIEWVARS);
Cvar_Register (&cl_crossy, VIEWVARS);
Cvar_Register (&gl_cshiftpercent, VIEWVARS);
Cvar_Register (&gl_cshiftenabled, VIEWVARS);
Cvar_Register (&cl_rollspeed, VIEWVARS);
Cvar_Register (&cl_rollangle, VIEWVARS);

View File

@ -790,7 +790,7 @@ void R_PolyBlend (void)
{
float shift[4];
extern qboolean gammaworks;
if ((!v_blend[3] || gammaworks) && !cl.cshifts[CSHIFT_SERVER].percent)
if ((!v_blend[3] || !gl_nohwblend.value) && !cl.cshifts[CSHIFT_SERVER].percent)
return;
GLV_CalcBlendServer(shift); //figure out the shift we need (normally just the server specified one)