diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 00c8c61ee..c66d38f77 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -295,7 +295,7 @@ void HWR_Lighting(FSurfaceInfo *Surface, INT32 light_level, extracolormap_t *col } // Clamp the light level, since it can sometimes go out of the 0-255 range from animations - light_level = min(max(light_level, 0), 255); + light_level = min(max(light_level, cv_glsecbright.value), 255); V_CubeApply(&tint_color.s.red, &tint_color.s.green, &tint_color.s.blue); V_CubeApply(&fade_color.s.red, &fade_color.s.green, &fade_color.s.blue); @@ -6152,10 +6152,12 @@ static CV_PossibleValue_t glfiltermode_cons_t[]= {{HWD_SET_TEXTUREFILTER_POINTSA {HWD_SET_TEXTUREFILTER_MIXED3, "Nearest_Mipmap"}, {0, NULL}}; CV_PossibleValue_t glanisotropicmode_cons_t[] = {{1, "MIN"}, {16, "MAX"}, {0, NULL}}; +static CV_PossibleValue_t glsecbright_cons_t[] = {{0, "MIN"}, {255, "MAX"}, {0, NULL}}; consvar_t cv_glshaders = CVAR_INIT ("gr_shaders", "On", CV_SAVE, glshaders_cons_t, NULL); consvar_t cv_glallowshaders = CVAR_INIT ("gr_allowclientshaders", "On", CV_NETVAR, CV_OnOff, NULL); consvar_t cv_fovchange = CVAR_INIT ("gr_fovchange", "Off", CV_SAVE, CV_OnOff, NULL); +consvar_t cv_glsecbright = CVAR_INIT("gr_secbright", "0", CV_SAVE, glsecbright_cons_t, NULL); #ifdef ALAM_LIGHTING consvar_t cv_gldynamiclighting = CVAR_INIT ("gr_dynamiclighting", "On", CV_SAVE, CV_OnOff, NULL); @@ -6217,6 +6219,7 @@ void HWR_AddCommands(void) CV_RegisterVar(&cv_glspritebillboarding); CV_RegisterVar(&cv_glshearing); CV_RegisterVar(&cv_glshaders); + CV_RegisterVar(&cv_glsecbright); CV_RegisterVar(&cv_glallowshaders); CV_RegisterVar(&cv_glfiltermode); diff --git a/src/hardware/hw_main.h b/src/hardware/hw_main.h index aa239c62c..a247cd60a 100644 --- a/src/hardware/hw_main.h +++ b/src/hardware/hw_main.h @@ -99,6 +99,7 @@ extern consvar_t cv_glcoronasize; #endif extern consvar_t cv_glshaders, cv_glallowshaders; +extern consvar_t cv_glsecbright; extern consvar_t cv_glmodels; // SRB2Kart: We don't like these options.