mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 06:42:12 +00:00
Merge branch 'master' into modern
This commit is contained in:
commit
8ac864b007
7 changed files with 23 additions and 7 deletions
|
@ -764,7 +764,7 @@ void D_Display ()
|
|||
//
|
||||
|
||||
// Check for the presence of dynamic lights at the start of the frame once.
|
||||
if (gl_lights)
|
||||
if ((gl_lights && vid_rendermode == 4) || (r_dynlights && vid_rendermode != 4))
|
||||
{
|
||||
TThinkerIterator<ADynamicLight> it(STAT_DLIGHT);
|
||||
level.HasDynamicLights = !!it.Next();
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include "actor.h"
|
||||
#include "cycler.h"
|
||||
|
||||
EXTERN_CVAR(Bool, r_dynlights)
|
||||
EXTERN_CVAR(Bool, gl_lights)
|
||||
EXTERN_CVAR(Bool, gl_attachedlights)
|
||||
|
||||
|
|
|
@ -151,6 +151,7 @@ public:
|
|||
void SightCheck::P_SightOpening(SightOpening &open, const line_t *linedef, double x, double y)
|
||||
{
|
||||
open.portalflags = 0;
|
||||
open.bottom = open.top = 0;
|
||||
sector_t *front = linedef->frontsector;
|
||||
sector_t *back = linedef->backsector;
|
||||
|
||||
|
@ -159,8 +160,10 @@ void SightCheck::P_SightOpening(SightOpening &open, const line_t *linedef, doubl
|
|||
// single sided line
|
||||
if (linedef->flags & ML_PORTALCONNECT)
|
||||
{
|
||||
if (!front->PortalBlocksSight(sector_t::ceiling)) open.portalflags |= SO_TOPFRONT;
|
||||
if (!front->PortalBlocksSight(sector_t::floor)) open.portalflags |= SO_BOTTOMFRONT;
|
||||
if (!front->PortalBlocksSight(sector_t::ceiling)) open.top = LINEOPEN_MAX, open.portalflags |= SO_TOPFRONT;
|
||||
if (!front->PortalBlocksSight(sector_t::floor)) open.bottom = LINEOPEN_MIN, open.portalflags |= SO_BOTTOMFRONT;
|
||||
if (open.top == 0) open.top = front->floorplane.ZatPoint(x, y);
|
||||
if (open.bottom == 0) open.bottom = front->ceilingplane.ZatPoint(x, y);
|
||||
}
|
||||
|
||||
open.range = 0;
|
||||
|
@ -213,7 +216,7 @@ bool SightCheck::PTR_SightTraverse (intercept_t *in)
|
|||
//
|
||||
|
||||
// ignore self referencing sectors if COMPAT_TRACE is on
|
||||
if ((i_compatflags & COMPATF_TRACE) && li->frontsector == li->backsector)
|
||||
if ((i_compatflags & COMPATF_TRACE) && li->frontsector == li->backsector)
|
||||
return true;
|
||||
|
||||
double trX = Trace.x + Trace.dx * in->frac;
|
||||
|
@ -224,7 +227,7 @@ bool SightCheck::PTR_SightTraverse (intercept_t *in)
|
|||
{
|
||||
// This may not skip P_SightOpening, but only reduce the open range to 0.
|
||||
open.range = 0;
|
||||
open.bottom = open.top;
|
||||
if (open.bottom != LINEOPEN_MIN) open.bottom = open.top;
|
||||
}
|
||||
|
||||
FLinePortal *lport = li->getPortal();
|
||||
|
|
|
@ -56,7 +56,7 @@ PolyModelRenderer::PolyModelRenderer(PolyRenderThread *thread, const Mat4f &worl
|
|||
|
||||
void PolyModelRenderer::AddLights(AActor *actor)
|
||||
{
|
||||
if (gl_lights && actor)
|
||||
if (r_dynlights && actor)
|
||||
{
|
||||
auto &addedLights = Thread->AddedLightsArray;
|
||||
|
||||
|
|
|
@ -269,6 +269,12 @@ void RenderPolyPlane::SetLightLevel(PolyRenderThread *thread, PolyDrawArgs &args
|
|||
|
||||
void RenderPolyPlane::SetDynLights(PolyRenderThread *thread, PolyDrawArgs &args, subsector_t *sub, bool ceiling)
|
||||
{
|
||||
if (!r_dynlights)
|
||||
{
|
||||
args.SetLights(nullptr, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
FLightNode *light_list = sub->lighthead;
|
||||
|
||||
auto cameraLight = PolyCameraLight::Instance();
|
||||
|
|
|
@ -374,6 +374,12 @@ void RenderPolyWall::Render(PolyRenderThread *thread)
|
|||
|
||||
void RenderPolyWall::SetDynLights(PolyRenderThread *thread, PolyDrawArgs &args)
|
||||
{
|
||||
if (!r_dynlights)
|
||||
{
|
||||
args.SetLights(nullptr, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
FLightNode *light_list = (LineSeg && LineSeg->sidedef) ? LineSeg->sidedef->lighthead : nullptr;
|
||||
|
||||
auto cameraLight = PolyCameraLight::Instance();
|
||||
|
|
|
@ -98,7 +98,7 @@ namespace swrenderer
|
|||
|
||||
void SWModelRenderer::AddLights(AActor *actor)
|
||||
{
|
||||
if (gl_lights && actor)
|
||||
if (r_dynlights && actor)
|
||||
{
|
||||
auto &addedLights = Thread->AddedLightsArray;
|
||||
|
||||
|
|
Loading…
Reference in a new issue