mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-11 15:47:55 +00:00
engine: gamma: fix gamma changes not caught if gamma cvar was set during frame
This commit is contained in:
parent
d3e60c7d84
commit
31fa990d44
@ -21,6 +21,7 @@ GNU General Public License for more details.
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Gamma conversion support
|
// Gamma conversion support
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
static qboolean gamma_rebuilt;
|
||||||
static byte texgammatable[256];
|
static byte texgammatable[256];
|
||||||
static uint lightgammatable[1024];
|
static uint lightgammatable[1024];
|
||||||
static uint lineargammatable[1024];
|
static uint lineargammatable[1024];
|
||||||
@ -131,6 +132,7 @@ void V_CheckGamma( void )
|
|||||||
V_ValidateGammaCvars();
|
V_ValidateGammaCvars();
|
||||||
|
|
||||||
dirty = false;
|
dirty = false;
|
||||||
|
gamma_rebuilt = true;
|
||||||
|
|
||||||
BuildGammaTable( v_gamma.value, v_brightness.value, v_texgamma.value, v_lightgamma.value );
|
BuildGammaTable( v_gamma.value, v_brightness.value, v_texgamma.value, v_lightgamma.value );
|
||||||
|
|
||||||
@ -142,6 +144,13 @@ void V_CheckGamma( void )
|
|||||||
|
|
||||||
void V_CheckGammaEnd( void )
|
void V_CheckGammaEnd( void )
|
||||||
{
|
{
|
||||||
|
// don't reset changed flag if it was set during frame
|
||||||
|
// keep it for next frame
|
||||||
|
if( !gamma_rebuilt )
|
||||||
|
return;
|
||||||
|
|
||||||
|
gamma_rebuilt = false;
|
||||||
|
|
||||||
// keep the flags until the end of frame so client.dll will catch these changes
|
// 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 ))
|
if( FBitSet( v_texgamma.flags|v_lightgamma.flags|v_brightness.flags|v_gamma.flags, FCVAR_CHANGED ))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user