ref_soft: Add macro to disable texture filter preventing slowdown on cvar checking

This commit is contained in:
mittorn 2019-04-03 23:24:10 +07:00
parent c52453faa3
commit 8f5c72c510
2 changed files with 15 additions and 11 deletions

View File

@ -2064,8 +2064,9 @@ qboolean R_Init()
sw_notransbrushes = gEngfuncs.Cvar_Get( "sw_notransbrushes", "0", FCVAR_ARCHIVE, "do not apply transparency to water/glasses (faster)");
sw_noalphabrushes = gEngfuncs.Cvar_Get( "sw_noalphabrushes", "0", FCVAR_ARCHIVE, "do not draw brush holes (faster)");
r_traceglow = gEngfuncs.Cvar_Get( "r_traceglow", "1", FCVAR_ARCHIVE, "cull flares behind models" );
#ifndef DISABLE_TEXFILTER
sw_texfilt = gEngfuncs.Cvar_Get ("sw_texfilt", "0", 0, "texture dither");
#endif
//r_lefthand = ri.Cvar_Get( "hand", "0", FCVAR_USERINFO | FCVAR_ARCHIVE );
// r_speeds = ri.Cvar_Get ("r_speeds", "0", 0);
r_decals = gEngfuncs.pfnGetCvarPointer( "r_decals", 0 );

View File

@ -564,7 +564,6 @@ void NonTurbulent8 (espan_t *pspan)
#if !id386
int kernel[2][2][2] =
{
{
@ -577,7 +576,11 @@ int kernel[2][2][2] =
{0,16384}
}
};
#ifndef DISABLE_TEXFILTER
#define SW_TEXFILT (sw_texfilt->value == 1.0f)
#else
#define SW_TEXFILT 0
#endif
/*
=============
D_DrawSpans16
@ -700,7 +703,7 @@ void D_DrawSpans16 (espan_t *pspan)
// Drawing phrase
if (sw_texfilt->value == 0.0f)
if (!SW_TEXFILT)
{
do
{
@ -709,7 +712,7 @@ void D_DrawSpans16 (espan_t *pspan)
t += tstep;
} while (--spancount > 0);
}
else if (sw_texfilt->value == 1.0f)
else
{
do
{
@ -871,7 +874,7 @@ void D_AlphaSpans16 (espan_t *pspan)
// Drawing phrase
if (sw_texfilt->value == 0.0f)
if (!SW_TEXFILT)
{
do
{
@ -893,7 +896,7 @@ void D_AlphaSpans16 (espan_t *pspan)
t += tstep;
} while (--spancount > 0);
}
else if (sw_texfilt->value == 1.0f)
else
{
do
{
@ -1067,7 +1070,7 @@ void D_BlendSpans16 (espan_t *pspan, int alpha)
// Drawing phrase
if (sw_texfilt->value == 0.0f)
if (!SW_TEXFILT)
{
do
{
@ -1089,7 +1092,7 @@ void D_BlendSpans16 (espan_t *pspan, int alpha)
t += tstep;
} while (--spancount > 0);
}
else if (sw_texfilt->value == 1.0f)
else
{
do
{
@ -1263,7 +1266,7 @@ void D_AddSpans16 (espan_t *pspan)
// Drawing phrase
if (sw_texfilt->value == 0.0f)
if (!SW_TEXFILT)
{
do
{
@ -1284,7 +1287,7 @@ void D_AddSpans16 (espan_t *pspan)
t += tstep;
} while (--spancount > 0);
}
else if (sw_texfilt->value == 1.0f)
else
{
do
{