Browse Source

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

pull/2/head
mittorn 6 years ago
parent
commit
8f5c72c510
  1. 3
      r_main.c
  2. 23
      r_scan.c

3
r_main.c

@ -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_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)"); 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" ); 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"); sw_texfilt = gEngfuncs.Cvar_Get ("sw_texfilt", "0", 0, "texture dither");
#endif
//r_lefthand = ri.Cvar_Get( "hand", "0", FCVAR_USERINFO | FCVAR_ARCHIVE ); //r_lefthand = ri.Cvar_Get( "hand", "0", FCVAR_USERINFO | FCVAR_ARCHIVE );
// r_speeds = ri.Cvar_Get ("r_speeds", "0", 0); // r_speeds = ri.Cvar_Get ("r_speeds", "0", 0);
r_decals = gEngfuncs.pfnGetCvarPointer( "r_decals", 0 ); r_decals = gEngfuncs.pfnGetCvarPointer( "r_decals", 0 );

23
r_scan.c

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

Loading…
Cancel
Save