Browse Source

engine: common: remove unused IsBackgroundMap/Demo calls, remove unused gamma function

pull/2/head
Alibek Omarov 2 years ago
parent
commit
4005ef831a
  1. 10
      engine/client/cl_main.c
  2. 3
      engine/common/common.h
  3. 10
      engine/common/dedicated.c
  4. 16
      engine/common/gamma.c

10
engine/client/cl_main.c

@ -150,16 +150,6 @@ qboolean CL_DisableVisibility( void ) @@ -150,16 +150,6 @@ qboolean CL_DisableVisibility( void )
return cls.envshot_disable_vis;
}
qboolean CL_IsBackgroundDemo( void )
{
return ( cls.demoplayback && cls.demonum != -1 );
}
qboolean CL_IsBackgroundMap( void )
{
return ( cl.background && !cls.demoplayback );
}
char *CL_Userinfo( void )
{
return cls.userinfo;

3
engine/common/common.h

@ -780,8 +780,6 @@ int SV_GetMaxClients( void ); @@ -780,8 +780,6 @@ int SV_GetMaxClients( void );
qboolean CL_IsRecordDemo( void );
qboolean CL_IsTimeDemo( void );
qboolean CL_IsPlaybackDemo( void );
qboolean CL_IsBackgroundDemo( void );
qboolean CL_IsBackgroundMap( void );
qboolean SV_Initialized( void );
qboolean CL_LoadProgs( const char *name );
void CL_ProcessFile( qboolean successfully_received, const char *filename );
@ -860,7 +858,6 @@ void S_StopAllSounds( qboolean ambient ); @@ -860,7 +858,6 @@ void S_StopAllSounds( qboolean ambient );
// gamma routines
void BuildGammaTable( float gamma, float brightness );
byte LightToTexGamma( byte b );
byte TextureToGamma( byte b );
//
// identification.c

10
engine/common/dedicated.c

@ -70,16 +70,6 @@ qboolean CL_DisableVisibility( void ) @@ -70,16 +70,6 @@ qboolean CL_DisableVisibility( void )
return false;
}
qboolean CL_IsBackgroundDemo( void )
{
return false;
}
qboolean CL_IsBackgroundMap( void )
{
return false;
}
void CL_Init( void )
{

16
engine/common/gamma.c

@ -20,7 +20,6 @@ GNU General Public License for more details. @@ -20,7 +20,6 @@ GNU General Public License for more details.
//-----------------------------------------------------------------------------
// Gamma conversion support
//-----------------------------------------------------------------------------
static byte texgammatable[256]; // palette is sent through this to convert to screen gamma
static byte lightgammatable[256];
static int lineargammatable[1024];
static int screengammatable[1024];
@ -60,13 +59,6 @@ void BuildGammaTable( float lightgamma, float brightness ) @@ -60,13 +59,6 @@ void BuildGammaTable( float lightgamma, float brightness )
lightgammatable[i] = bound( 0, inf, 255 );
}
for( i = 0; i < 256; i++ )
{
f = 255.0f * pow(( float )i / 255.0f, TEXGAMMA );
inf = (int)(f + 0.5f);
texgammatable[i] = bound( 0, inf, 255 );
}
for( i = 0; i < 1024; i++ )
{
// convert from screen gamma space to linear space
@ -84,11 +76,3 @@ byte LightToTexGamma( byte b ) @@ -84,11 +76,3 @@ byte LightToTexGamma( byte b )
else
return lightgammatable[b];
}
byte TextureToGamma( byte b )
{
if( FBitSet( host.features, ENGINE_LINEAR_GAMMA_SPACE ))
return b;
else
return texgammatable[b];
}

Loading…
Cancel
Save