- use symbolic constants for the light modes.

This commit is contained in:
Christoph Oelckers 2018-12-15 09:40:39 +01:00
commit 1187906a61
10 changed files with 62 additions and 34 deletions

View file

@ -430,7 +430,7 @@ void F2DDrawer::AddPoly(FTexture *texture, FVector2 *points, int npoints,
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.lightmode >= 2 && level.lightmode != 4))
if (vid_rendermode != 4 || level.isDarkLightMode() || level.isSoftwareLighting())
{
double map = (NUMCOLORMAPS * 2.) - ((lightlevel + 12) * (NUMCOLORMAPS / 128.));
fadelevel = clamp((map - 12) / NUMCOLORMAPS, 0.0, 1.0);