From dc0df7d0812b5e1428e17944cf5a22ded7c3262e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 21 Apr 2021 22:31:56 +0200 Subject: [PATCH] - don't clamp shade values in the setup pass. We need their proper values when setting up the lighting. --- source/core/rendering/scene/hw_flats.cpp | 6 +++--- source/core/rendering/scene/hw_walls.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/core/rendering/scene/hw_flats.cpp b/source/core/rendering/scene/hw_flats.cpp index d69a1141d..8c4160e3f 100644 --- a/source/core/rendering/scene/hw_flats.cpp +++ b/source/core/rendering/scene/hw_flats.cpp @@ -263,7 +263,7 @@ void HWFlat::ProcessSector(HWDrawInfo *di, sectortype * frontsector, int which) { // process the original floor first. - shade = clamp(frontsector->floorshade, 0, numshades-1); + shade = frontsector->floorshade; palette = frontsector->floorpal; 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. - shade = clamp(frontsector->ceilingshade, 0, numshades-1); + shade = frontsector->ceilingshade; palette = frontsector->ceilingpal; 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; sec = sector; - shade = clamp(sprite->shade, 0, numshades - 1); + shade = sprite->shade; palette = sprite->pal; fade = lookups.getFade(sector->floorpal); // fog is per sector. diff --git a/source/core/rendering/scene/hw_walls.cpp b/source/core/rendering/scene/hw_walls.cpp index 7dc8ace05..1bdc3a944 100644 --- a/source/core/rendering/scene/hw_walls.cpp +++ b/source/core/rendering/scene/hw_walls.cpp @@ -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; refheight = (refwall->cstat & CSTAT_WALL_ALIGN_BOTTOM) ? frontsector->ceilingz : backsector->floorz; - shade = clamp(refwall->shade, 0, numshades - 1); + shade = refwall->shade; palette = refwall->pal; type = RENDERWALL_BOTTOM; 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; flags = 0; dynlightindex = -1; - shade = clamp(wal->shade, 0, numshades - 1); + shade = wal->shade; palette = wal->pal; fade = lookups.getFade(frontsector->floorpal); // fog is per sector. visibility = sectorVisibility(frontsector); @@ -1048,7 +1048,7 @@ void HWWall::ProcessWallSprite(HWDrawInfo* di, spritetype* spr, sectortype* sect flags = HWF_CLAMPX|HWF_CLAMPY; dynlightindex = -1; - shade = clamp(spr->shade, 0, numshades - 1); + shade = spr->shade; palette = spr->pal; fade = lookups.getFade(sector->floorpal); // fog is per sector. visibility = sectorVisibility(sector);