From 7652448e2836a8d99c3d432bc7b11a161dedd60e Mon Sep 17 00:00:00 2001 From: tankefugl Date: Wed, 22 Jun 2005 12:27:50 +0000 Subject: [PATCH] Mantis 0001070: o Added new option to the Advanced menu: "Enable gamma ramp". The cvar for it is cl_gammaramp which defaults to 1. Setting it to 0 will disable the forced gamma ramp changes. git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@206 67975925-1194-0748-b3d5-c16f83f1a3a1 --- main/source/cl_dll/hud.cpp | 1 + main/source/mod/AvHClientVariables.h | 3 +++ main/source/mod/AvHHud.cpp | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/main/source/cl_dll/hud.cpp b/main/source/cl_dll/hud.cpp index 192e4d5d..aedba002 100644 --- a/main/source/cl_dll/hud.cpp +++ b/main/source/cl_dll/hud.cpp @@ -208,6 +208,7 @@ void CHud :: Init( void ) CVAR_CREATE( "cl_showspeed", "0", 0); CVAR_CREATE( kvLabelMaps, "0", FCVAR_ARCHIVE); + CVAR_CREATE( kvGammaRamp, "0", FCVAR_ARCHIVE); m_pSpriteList = NULL; diff --git a/main/source/mod/AvHClientVariables.h b/main/source/mod/AvHClientVariables.h index a2ae5017..118e1efc 100644 --- a/main/source/mod/AvHClientVariables.h +++ b/main/source/mod/AvHClientVariables.h @@ -38,6 +38,9 @@ extern cvar_t* cl_musicdir; // puzl: 1064 The cl var that controls the display of labelled minimaps #define kvLabelMaps "cl_labelmaps" // :puzl +// tankefugl: 0001070 - enables forced gamma ramp loading +#define kvGammaRamp "cl_gammaramp" +// :tankefugl #define kvCMHotKeys "cl_cmhotkeys" #define kvForceDefaultFOV "cl_forcedefaultfov" #define kvCenterEntityID "cl_centerentityid" diff --git a/main/source/mod/AvHHud.cpp b/main/source/mod/AvHHud.cpp index 6eaf9f80..de561133 100644 --- a/main/source/mod/AvHHud.cpp +++ b/main/source/mod/AvHHud.cpp @@ -1817,7 +1817,8 @@ bool AvHHud::SetGamma(float inSlope) theGammaToTry -= kGammaIncrement; sGameGammaTable.ProcessSlope(theGammaToTry); - if(sGameGammaTable.InitializeToVideoState()) + // tankefugl: fakes a successful gamma ramp change if cl_gammaramp is set to 0 + if((CVAR_GET_FLOAT(kvGammaRamp) == 0) || sGameGammaTable.InitializeToVideoState()) { // Tell UI components so they can change shading to look the same this->GetManager().NotifyGammaChange(theGammaToTry);