diff --git a/src/common/rendering/hwrenderer/data/hw_shadowmap.cpp b/src/common/rendering/hwrenderer/data/hw_shadowmap.cpp index bca545b3b9..9b0de864f2 100644 --- a/src/common/rendering/hwrenderer/data/hw_shadowmap.cpp +++ b/src/common/rendering/hwrenderer/data/hw_shadowmap.cpp @@ -25,7 +25,6 @@ #include "hw_dynlightdata.h" #include "buffers.h" #include "shaderuniforms.h" -#include "g_cvars.h" #include "hwrenderer/postprocessing/hw_postprocess.h" /* diff --git a/src/common/rendering/v_video.h b/src/common/rendering/v_video.h index c9124e05f5..255cfa70cc 100644 --- a/src/common/rendering/v_video.h +++ b/src/common/rendering/v_video.h @@ -279,6 +279,7 @@ extern DFrameBuffer *screen; #define SCREENPITCH (screen->GetPitch ()) EXTERN_CVAR (Float, vid_gamma) +EXTERN_CVAR(Bool, gl_lights) // Allocates buffer screens, call before R_Init. diff --git a/src/playsim/dthinker.cpp b/src/playsim/dthinker.cpp index 64099981f6..4758d79948 100644 --- a/src/playsim/dthinker.cpp +++ b/src/playsim/dthinker.cpp @@ -42,6 +42,7 @@ #include "v_text.h" #include "g_levellocals.h" #include "a_dynlight.h" +#include "v_video.h" static int ThinkCount; @@ -124,11 +125,14 @@ void FThinkerCollection::RunThinkers(FLevelLocals *Level) } } while (count != 0); - for (auto light = Level->lights; light;) + if (gl_lights) { - auto next = light->next; - light->Tick(); - light = next; + for (auto light = Level->lights; light;) + { + auto next = light->next; + light->Tick(); + light = next; + } } } else @@ -150,7 +154,7 @@ void FThinkerCollection::RunThinkers(FLevelLocals *Level) } } while (count != 0); - if (Level->lights) + if (Level->lights && gl_lights) { // Also profile the internal dynamic lights, even though they are not implemented as thinkers. auto &prof = Profiles[NAME_InternalDynamicLight];