- don't clamp shade values in the setup pass.

We need their proper values when setting up the lighting.
This commit is contained in:
Christoph Oelckers 2021-04-21 22:31:56 +02:00
parent 9092b5c392
commit dc0df7d081
2 changed files with 6 additions and 6 deletions

View file

@ -263,7 +263,7 @@ void HWFlat::ProcessSector(HWDrawInfo *di, sectortype * frontsector, int which)
{ {
// process the original floor first. // process the original floor first.
shade = clamp(frontsector->floorshade, 0, numshades-1); shade = frontsector->floorshade;
palette = frontsector->floorpal; palette = frontsector->floorpal;
stack = frontsector->portalflags == PORTAL_SECTOR_FLOOR || frontsector->portalflags == PORTAL_SECTOR_FLOOR_REFLECT; stack = frontsector->portalflags == PORTAL_SECTOR_FLOOR || frontsector->portalflags == PORTAL_SECTOR_FLOOR_REFLECT;
@ -303,7 +303,7 @@ void HWFlat::ProcessSector(HWDrawInfo *di, sectortype * frontsector, int which)
{ {
// process the original ceiling first. // process the original ceiling first.
shade = clamp(frontsector->ceilingshade, 0, numshades-1); shade = frontsector->ceilingshade;
palette = frontsector->ceilingpal; palette = frontsector->ceilingpal;
stack = frontsector->portalflags == PORTAL_SECTOR_CEILING || frontsector->portalflags == PORTAL_SECTOR_CEILING_REFLECT; stack = frontsector->portalflags == PORTAL_SECTOR_CEILING || frontsector->portalflags == PORTAL_SECTOR_CEILING_REFLECT;
@ -353,7 +353,7 @@ void HWFlat::ProcessFlatSprite(HWDrawInfo* di, spritetype* sprite, sectortype* s
{ {
this->sprite = sprite; this->sprite = sprite;
sec = sector; sec = sector;
shade = clamp(sprite->shade, 0, numshades - 1); shade = sprite->shade;
palette = sprite->pal; palette = sprite->pal;
fade = lookups.getFade(sector->floorpal); // fog is per sector. fade = lookups.getFade(sector->floorpal); // fog is per sector.

View file

@ -783,7 +783,7 @@ void HWWall::DoLowerTexture(HWDrawInfo* di, walltype* wal, sectortype* frontsect
auto refwall = (wal->cstat & CSTAT_WALL_BOTTOM_SWAP) ? &wall[wal->nextwall] : wal; auto refwall = (wal->cstat & CSTAT_WALL_BOTTOM_SWAP) ? &wall[wal->nextwall] : wal;
refheight = (refwall->cstat & CSTAT_WALL_ALIGN_BOTTOM) ? frontsector->ceilingz : backsector->floorz; refheight = (refwall->cstat & CSTAT_WALL_ALIGN_BOTTOM) ? frontsector->ceilingz : backsector->floorz;
shade = clamp(refwall->shade, 0, numshades - 1); shade = refwall->shade;
palette = refwall->pal; palette = refwall->pal;
type = RENDERWALL_BOTTOM; type = RENDERWALL_BOTTOM;
DoTexture(di, wal, refwall, refheight, topleft, topright, bottomleft, bottomright); DoTexture(di, wal, refwall, refheight, topleft, topright, bottomleft, bottomright);
@ -878,7 +878,7 @@ void HWWall::Process(HWDrawInfo* di, walltype* wal, sectortype* frontsector, sec
glseg.fracright = 1; glseg.fracright = 1;
flags = 0; flags = 0;
dynlightindex = -1; dynlightindex = -1;
shade = clamp(wal->shade, 0, numshades - 1); shade = wal->shade;
palette = wal->pal; palette = wal->pal;
fade = lookups.getFade(frontsector->floorpal); // fog is per sector. fade = lookups.getFade(frontsector->floorpal); // fog is per sector.
visibility = sectorVisibility(frontsector); visibility = sectorVisibility(frontsector);
@ -1048,7 +1048,7 @@ void HWWall::ProcessWallSprite(HWDrawInfo* di, spritetype* spr, sectortype* sect
flags = HWF_CLAMPX|HWF_CLAMPY; flags = HWF_CLAMPX|HWF_CLAMPY;
dynlightindex = -1; dynlightindex = -1;
shade = clamp(spr->shade, 0, numshades - 1); shade = spr->shade;
palette = spr->pal; palette = spr->pal;
fade = lookups.getFade(sector->floorpal); // fog is per sector. fade = lookups.getFade(sector->floorpal); // fog is per sector.
visibility = sectorVisibility(sector); visibility = sectorVisibility(sector);