diff --git a/src/p_setup.c b/src/p_setup.c index 96a1cc129..21738ff88 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -329,10 +329,10 @@ static void P_ClearSingleMapHeaderInfo(INT16 i) static void P_ClearDirectionalLightMapHeaderInfo(INT16 i) // lol dont always reset this on every map load { - mapheaderinfo[i]->light_contrast = M_RandomRange(0, 58); + mapheaderinfo[i]->light_contrast = cv_randomdirlight.value ? M_RandomRange(0, 58) : 8; mapheaderinfo[i]->sprite_backlight = 0; - mapheaderinfo[i]->use_light_angle = true; - mapheaderinfo[i]->light_angle = M_RandomRange(-382, 382); + mapheaderinfo[i]->use_light_angle = cv_randomdirlight.value ? true : false; + mapheaderinfo[i]->light_angle = cv_randomdirlight.value ? M_RandomRange(-382, 382) : 0; } /** Allocates a new map-header structure. diff --git a/src/r_main.c b/src/r_main.c index b68bde658..d33f2cb2f 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -205,6 +205,8 @@ consvar_t cv_homremoval = {"homremoval", "Yes", CV_SAVE, homremoval_cons_t, NULL consvar_t cv_maxportals = {"maxportals", "2", CV_SAVE, maxportals_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_randomdirlight = {"randomdirectionallight", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; + void SplitScreen_OnChange(void) { UINT8 i; @@ -1579,6 +1581,8 @@ void R_RegisterEngineStuff(void) CV_RegisterVar(&cv_maxportals); + CV_RegisterVar(&cv_randomdirlight); + CV_RegisterVar(&cv_maxinterpdist); CV_RegisterVar(&cv_ripplewater); diff --git a/src/r_main.h b/src/r_main.h index 553f6a79f..c63c3d1e4 100644 --- a/src/r_main.h +++ b/src/r_main.h @@ -158,6 +158,8 @@ extern consvar_t cv_tailspickup; extern consvar_t cv_maxinterpdist; extern consvar_t cv_ripplewater; +extern consvar_t cv_randomdirlight; + // Called by startup code. void R_Init(void);