MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / R_CheckCvars

Function R_CheckCvars

neo/renderer/RenderSystem.cpp:240–273  ·  view source on GitHub ↗

============= R_CheckCvars See if some cvars that we watch have changed ============= */

Source from the content-addressed store, hash-verified

238=============
239*/
240static void R_CheckCvars( void ) {
241 globalImages->CheckCvars();
242
243 // gamma stuff
244 if ( r_gamma.IsModified() || r_brightness.IsModified() ) {
245 r_gamma.ClearModified();
246 r_brightness.ClearModified();
247 R_SetColorMappings();
248 }
249
250 if ( r_gammaInShader.IsModified() ) {
251 r_gammaInShader.ClearModified();
252 // reload shaders so they either add or remove the code for setting gamma/brightness in shader
253 R_ReloadARBPrograms_f( idCmdArgs() );
254
255 if ( r_gammaInShader.GetBool() ) {
256 common->Printf( "Will apply r_gamma and r_brightness in shaders\n" );
257 GLimp_ResetGamma(); // reset hardware gamma
258 } else {
259 common->Printf( "Will apply r_gamma and r_brightness in hardware (possibly on all screens)\n" );
260 R_SetColorMappings();
261 }
262 }
263
264 if ( r_swapInterval.IsModified() ) {
265 GLimp_SetSwapInterval( r_swapInterval.GetInteger() );
266 r_swapInterval.ClearModified();
267 }
268
269 if ( r_windowResizable.IsModified() ) {
270 GLimp_SetWindowResizable( r_windowResizable.GetBool() );
271 r_windowResizable.ClearModified();
272 }
273}
274
275/*
276=============

Callers 1

EndFrameMethod · 0.85

Calls 12

R_SetColorMappingsFunction · 0.85
R_ReloadARBPrograms_fFunction · 0.85
GLimp_SetSwapIntervalFunction · 0.85
CheckCvarsMethod · 0.80
ClearModifiedMethod · 0.80
GetIntegerMethod · 0.80
idCmdArgsClass · 0.50
GLimp_ResetGammaFunction · 0.50
GLimp_SetWindowResizableFunction · 0.50
IsModifiedMethod · 0.45
GetBoolMethod · 0.45
PrintfMethod · 0.45

Tested by

no test coverage detected