From 4005ef831a69b907e022a301a3448f97e1f12061 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 3 Apr 2023 04:31:12 +0300 Subject: [PATCH] engine: common: remove unused IsBackgroundMap/Demo calls, remove unused gamma function --- engine/client/cl_main.c | 10 ---------- engine/common/common.h | 3 --- engine/common/dedicated.c | 10 ---------- engine/common/gamma.c | 16 ---------------- 4 files changed, 39 deletions(-) diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index 78aefe9f..a162b884 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -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; diff --git a/engine/common/common.h b/engine/common/common.h index 0aa2ebbc..0d6f7e94 100644 --- a/engine/common/common.h +++ b/engine/common/common.h @@ -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 ); // gamma routines void BuildGammaTable( float gamma, float brightness ); byte LightToTexGamma( byte b ); -byte TextureToGamma( byte b ); // // identification.c diff --git a/engine/common/dedicated.c b/engine/common/dedicated.c index a7d4ba8b..39ea7c4a 100644 --- a/engine/common/dedicated.c +++ b/engine/common/dedicated.c @@ -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 ) { diff --git a/engine/common/gamma.c b/engine/common/gamma.c index 87fd772c..aac4a6c4 100644 --- a/engine/common/gamma.c +++ b/engine/common/gamma.c @@ -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 ) 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 ) else return lightgammatable[b]; } - -byte TextureToGamma( byte b ) -{ - if( FBitSet( host.features, ENGINE_LINEAR_GAMMA_SPACE )) - return b; - else - return texgammatable[b]; -}