- do not run the dynamic light ticker when lights are switched off.

This commit is contained in:
Christoph Oelckers 2021-08-11 12:39:17 +02:00
parent f662c629e3
commit 3adadfe4d3
3 changed files with 10 additions and 6 deletions

View file

@ -25,7 +25,6 @@
#include "hw_dynlightdata.h" #include "hw_dynlightdata.h"
#include "buffers.h" #include "buffers.h"
#include "shaderuniforms.h" #include "shaderuniforms.h"
#include "g_cvars.h"
#include "hwrenderer/postprocessing/hw_postprocess.h" #include "hwrenderer/postprocessing/hw_postprocess.h"
/* /*

View file

@ -279,6 +279,7 @@ extern DFrameBuffer *screen;
#define SCREENPITCH (screen->GetPitch ()) #define SCREENPITCH (screen->GetPitch ())
EXTERN_CVAR (Float, vid_gamma) EXTERN_CVAR (Float, vid_gamma)
EXTERN_CVAR(Bool, gl_lights)
// Allocates buffer screens, call before R_Init. // Allocates buffer screens, call before R_Init.

View file

@ -42,6 +42,7 @@
#include "v_text.h" #include "v_text.h"
#include "g_levellocals.h" #include "g_levellocals.h"
#include "a_dynlight.h" #include "a_dynlight.h"
#include "v_video.h"
static int ThinkCount; static int ThinkCount;
@ -124,6 +125,8 @@ void FThinkerCollection::RunThinkers(FLevelLocals *Level)
} }
} while (count != 0); } while (count != 0);
if (gl_lights)
{
for (auto light = Level->lights; light;) for (auto light = Level->lights; light;)
{ {
auto next = light->next; auto next = light->next;
@ -131,6 +134,7 @@ void FThinkerCollection::RunThinkers(FLevelLocals *Level)
light = next; light = next;
} }
} }
}
else else
{ {
Profiles.Clear(); Profiles.Clear();
@ -150,7 +154,7 @@ void FThinkerCollection::RunThinkers(FLevelLocals *Level)
} }
} while (count != 0); } 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. // Also profile the internal dynamic lights, even though they are not implemented as thinkers.
auto &prof = Profiles[NAME_InternalDynamicLight]; auto &prof = Profiles[NAME_InternalDynamicLight];