From a5a53c51e6d98b42bda870317b22db5b6c4f311c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 10 Feb 2015 21:52:19 +0100 Subject: [PATCH] - fixed: The flat drawing code assumed that the first element of the light list originated from the sector itself. This had been true formerly but in some situations it no longer is. --- src/gl/scene/gl_flats.cpp | 2 +- src/p_3dfloors.cpp | 4 ++++ src/p_3dfloors.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gl/scene/gl_flats.cpp b/src/gl/scene/gl_flats.cpp index b0533ceb5..78d9b44bd 100644 --- a/src/gl/scene/gl_flats.cpp +++ b/src/gl/scene/gl_flats.cpp @@ -546,7 +546,7 @@ void GLFlat::ProcessSector(sector_t * frontsector) if (x.ffloors.Size()) { light = P_GetPlaneLight(sector, &frontsector->floorplane, false); - if ((!(sector->GetFlags(sector_t::floor)&PLANEF_ABSLIGHTING) || light!=&x.lightlist[0]) + if ((!(sector->GetFlags(sector_t::floor)&PLANEF_ABSLIGHTING) || !light->fromsector) && (light->p_lightlevel != &frontsector->lightlevel)) { lightlevel = *light->p_lightlevel; diff --git a/src/p_3dfloors.cpp b/src/p_3dfloors.cpp index cad1f16fa..da72bc171 100644 --- a/src/p_3dfloors.cpp +++ b/src/p_3dfloors.cpp @@ -584,6 +584,7 @@ void P_Recalculate3DFloors(sector_t * sector) lightlist[0].extra_colormap = sector->ColorMap; lightlist[0].blend = 0; lightlist[0].flags = 0; + lightlist[0].fromsector = true; maxheight = sector->CenterCeiling(); minheight = sector->CenterFloor(); @@ -605,6 +606,7 @@ void P_Recalculate3DFloors(sector_t * sector) newlight.extra_colormap = rover->GetColormap(); newlight.blend = rover->GetBlend(); newlight.flags = rover->flags; + newlight.fromsector = false; lightlist.Push(newlight); } else if (i==0) @@ -619,6 +621,7 @@ void P_Recalculate3DFloors(sector_t * sector) lightlist[0].extra_colormap = rover->GetColormap(); lightlist[0].blend = rover->GetBlend(); lightlist[0].flags = rover->flags; + lightlist[0].fromsector = false; } } if (rover->flags&FF_DOUBLESHADOW) @@ -643,6 +646,7 @@ void P_Recalculate3DFloors(sector_t * sector) newlight.blend = 0; } newlight.flags = rover->flags; + newlight.fromsector = false; lightlist.Push(newlight); } } diff --git a/src/p_3dfloors.h b/src/p_3dfloors.h index 8d42560af..4321ad0e5 100644 --- a/src/p_3dfloors.h +++ b/src/p_3dfloors.h @@ -123,6 +123,7 @@ struct lightlist_t int flags; F3DFloor* lightsource; F3DFloor* caster; + bool fromsector; };