- changed light mode handling of the hardware renderer so that it only operates on local copies but doesn't alter the level's setting.

There are several places where a temporary change of light mode is needed, all these made this change in the global level struct. Now the change is only local to the active draw info.
This commit is contained in:
Christoph Oelckers 2019-01-06 09:00:52 +01:00
commit dca4a42dd6
19 changed files with 130 additions and 122 deletions

View file

@ -428,14 +428,14 @@ void F2DDrawer::AddPoly(FTexture *texture, FVector2 *points, int npoints,
// is necessary in order to best reproduce Doom's original lighting.
double fadelevel;
// The hardware renderer's light modes 0, 1 and 4 use a linear light scale which must be used here as well. Otherwise the automap gets too dark.
if (vid_rendermode != 4 || level.isDarkLightMode() || level.isSoftwareLighting())
if (vid_rendermode != 4 || level.lightMode == ELightMode::Doom || level.lightMode == ELightMode::ZDoomSoftware || level.lightMode == ELightMode::DoomSoftware)
{
double map = (NUMCOLORMAPS * 2.) - ((lightlevel + 12) * (NUMCOLORMAPS / 128.));
fadelevel = clamp((map - 12) / NUMCOLORMAPS, 0.0, 1.0);
}
else
{
// The hardware renderer's light modes 0, 1 and 4 use a linear light scale which must be used here as well. Otherwise the automap gets too dark.
fadelevel = 1. - clamp(lightlevel, 0, 255) / 255.f;
}