- Fixed: Disable absolute wall lighting when in the shadow of a 3D floor.

SVN r3499 (trunk)
This commit is contained in:
Randy Heit 2012-04-01 02:31:57 +00:00
parent f6f8d74635
commit d9f7a250ba
3 changed files with 22 additions and 15 deletions

View file

@ -930,9 +930,9 @@ CUSTOM_CVAR(Int, r_fakecontrast, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
// //
//========================================================================== //==========================================================================
int side_t::GetLightLevel (bool foggy, int baselight, int *pfakecontrast) const int side_t::GetLightLevel (bool foggy, int baselight, bool noabsolute, int *pfakecontrast) const
{ {
if (Flags & WALLF_ABSLIGHTING) if (!noabsolute && (Flags & WALLF_ABSLIGHTING))
{ {
baselight = Light; baselight = Light;
} }

View file

@ -783,7 +783,7 @@ struct side_t
BYTE Flags; BYTE Flags;
int Index; // needed to access custom UDMF fields which are stored in loading order. int Index; // needed to access custom UDMF fields which are stored in loading order.
int GetLightLevel (bool foggy, int baselight, int *fake = NULL) const; int GetLightLevel (bool foggy, int baselight, bool noabsolute=false, int *pfakecontrast_usedbygzdoom=NULL) const;
void SetLight(SWORD l) void SetLight(SWORD l)
{ {

View file

@ -265,8 +265,9 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2)
} }
if (sclipTop <= frontsector->e->XFloor.lightlist[i].plane.ZatPoint(viewx, viewy)) if (sclipTop <= frontsector->e->XFloor.lightlist[i].plane.ZatPoint(viewx, viewy))
{ {
basecolormap = frontsector->e->XFloor.lightlist[i].extra_colormap; lightlist_t *lit = &frontsector->e->XFloor.lightlist[i];
wallshade = LIGHT2SHADE(curline->sidedef->GetLightLevel(foggy, *frontsector->e->XFloor.lightlist[i].p_lightlevel) + r_actualextralight); basecolormap = lit->extra_colormap;
wallshade = LIGHT2SHADE(curline->sidedef->GetLightLevel(foggy, *lit->p_lightlevel, lit->lightsource == NULL) + r_actualextralight);
break; break;
} }
} }
@ -786,8 +787,9 @@ void R_RenderFakeWallRange (drawseg_t *ds, int x1, int x2)
{ {
if (sclipTop <= backsector->e->XFloor.lightlist[j].plane.Zat0()) if (sclipTop <= backsector->e->XFloor.lightlist[j].plane.Zat0())
{ {
basecolormap = backsector->e->XFloor.lightlist[j].extra_colormap; lightlist_t *lit = &backsector->e->XFloor.lightlist[i];
wallshade = LIGHT2SHADE(curline->sidedef->GetLightLevel(foggy, *backsector->e->XFloor.lightlist[j].p_lightlevel) + r_actualextralight); basecolormap = lit->extra_colormap;
wallshade = LIGHT2SHADE(curline->sidedef->GetLightLevel(foggy, *lit->p_lightlevel, lit->lightsource == NULL) + r_actualextralight);
break; break;
} }
} }
@ -798,8 +800,9 @@ void R_RenderFakeWallRange (drawseg_t *ds, int x1, int x2)
{ {
if (sclipTop <= frontsector->e->XFloor.lightlist[j].plane.Zat0()) if (sclipTop <= frontsector->e->XFloor.lightlist[j].plane.Zat0())
{ {
basecolormap = frontsector->e->XFloor.lightlist[j].extra_colormap; lightlist_t *lit = &frontsector->e->XFloor.lightlist[j];
wallshade = LIGHT2SHADE(curline->sidedef->GetLightLevel(foggy, *frontsector->e->XFloor.lightlist[j].p_lightlevel) + r_actualextralight); basecolormap = lit->extra_colormap;
wallshade = LIGHT2SHADE(curline->sidedef->GetLightLevel(foggy, *lit->p_lightlevel, lit->lightsource == NULL) + r_actualextralight);
break; break;
} }
} }
@ -959,8 +962,9 @@ void R_RenderFakeWallRange (drawseg_t *ds, int x1, int x2)
{ {
if (sclipTop <= backsector->e->XFloor.lightlist[j].plane.Zat0()) if (sclipTop <= backsector->e->XFloor.lightlist[j].plane.Zat0())
{ {
basecolormap = backsector->e->XFloor.lightlist[j].extra_colormap; lightlist_t *lit = &backsector->e->XFloor.lightlist[j];
wallshade = LIGHT2SHADE(curline->sidedef->GetLightLevel(foggy, *backsector->e->XFloor.lightlist[j].p_lightlevel) + r_actualextralight); basecolormap = lit->extra_colormap;
wallshade = LIGHT2SHADE(curline->sidedef->GetLightLevel(foggy, *lit->p_lightlevel, lit->lightsource != NULL) + r_actualextralight);
break; break;
} }
} }
@ -971,8 +975,9 @@ void R_RenderFakeWallRange (drawseg_t *ds, int x1, int x2)
{ {
if(sclipTop <= frontsector->e->XFloor.lightlist[j].plane.Zat0()) if(sclipTop <= frontsector->e->XFloor.lightlist[j].plane.Zat0())
{ {
basecolormap = frontsector->e->XFloor.lightlist[j].extra_colormap; lightlist_t *lit = &frontsector->e->XFloor.lightlist[j];
wallshade = LIGHT2SHADE(curline->sidedef->GetLightLevel(foggy, *frontsector->e->XFloor.lightlist[j].p_lightlevel) + r_actualextralight); basecolormap = lit->extra_colormap;
wallshade = LIGHT2SHADE(curline->sidedef->GetLightLevel(foggy, *lit->p_lightlevel, lit->lightsource != NULL) + r_actualextralight);
break; break;
} }
} }
@ -1198,9 +1203,11 @@ void wallscan_striped (int x1, int x2, short *uwal, short *dwal, fixed_t *swal,
up = down; up = down;
down = (down == most1) ? most2 : most1; down = (down == most1) ? most2 : most1;
} }
basecolormap = frontsector->e->XFloor.lightlist[i].extra_colormap;
lightlist_t *lit = &frontsector->e->XFloor.lightlist[i];
basecolormap = lit->extra_colormap;
wallshade = LIGHT2SHADE(curline->sidedef->GetLightLevel(fogginess, wallshade = LIGHT2SHADE(curline->sidedef->GetLightLevel(fogginess,
*frontsector->e->XFloor.lightlist[i].p_lightlevel) + r_actualextralight); *lit->p_lightlevel, lit->lightsource != NULL) + r_actualextralight);
} }
wallscan (x1, x2, up, dwal, swal, lwal, yrepeat); wallscan (x1, x2, up, dwal, swal, lwal, yrepeat);