mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-11 15:47:55 +00:00
engine: client: move reseting gamma changed flag to the end of the frame for custom renderers
This commit is contained in:
parent
618ec83c9d
commit
33da68b013
@ -553,4 +553,6 @@ void V_PostRender( void )
|
||||
ref.dllFuncs.R_AllowFog( true );
|
||||
Platform_SetTimer( 0.0f );
|
||||
ref.dllFuncs.R_EndFrame();
|
||||
|
||||
V_CheckGammaEnd();
|
||||
}
|
||||
|
@ -106,7 +106,6 @@ static void V_ValidateGammaCvars( void )
|
||||
void V_CheckGamma( void )
|
||||
{
|
||||
static qboolean dirty = false;
|
||||
qboolean notify_refdll = false;
|
||||
|
||||
// because these cvars were defined as archive
|
||||
// but wasn't doing anything useful
|
||||
@ -132,20 +131,25 @@ void V_CheckGamma( void )
|
||||
V_ValidateGammaCvars();
|
||||
|
||||
dirty = false;
|
||||
|
||||
BuildGammaTable( v_gamma.value, v_brightness.value, v_texgamma.value, v_lightgamma.value );
|
||||
|
||||
// force refdll to recalculate lightmaps
|
||||
notify_refdll = true;
|
||||
if( ref.initialized )
|
||||
ref.dllFuncs.R_GammaChanged( false );
|
||||
}
|
||||
}
|
||||
|
||||
// unfortunately, recalculating textures isn't possible yet
|
||||
void V_CheckGammaEnd( void )
|
||||
{
|
||||
// keep the flags until the end of frame so client.dll will catch these changes
|
||||
if( FBitSet( v_texgamma.flags|v_lightgamma.flags|v_brightness.flags|v_gamma.flags, FCVAR_CHANGED ))
|
||||
{
|
||||
ClearBits( v_texgamma.flags, FCVAR_CHANGED );
|
||||
ClearBits( v_lightgamma.flags, FCVAR_CHANGED );
|
||||
ClearBits( v_brightness.flags, FCVAR_CHANGED );
|
||||
ClearBits( v_gamma.flags, FCVAR_CHANGED );
|
||||
}
|
||||
|
||||
if( notify_refdll && ref.initialized )
|
||||
ref.dllFuncs.R_GammaChanged( false );
|
||||
}
|
||||
|
||||
void V_Init( void )
|
||||
|
@ -795,6 +795,7 @@ uint ScreenGammaTable( uint );
|
||||
uint LinearGammaTable( uint );
|
||||
void V_Init( void );
|
||||
void V_CheckGamma( void );
|
||||
void V_CheckGammaEnd( void );
|
||||
|
||||
//
|
||||
// identification.c
|
||||
|
Loading…
Reference in New Issue
Block a user