- use a separate variable pointing to the current level for the UI code.

UI always runs on the primary level, so this does not need the ability to operate on multiple levels. Additionally, this can later be set to null when running play code so that scope violations result in an abort.
This commit is contained in:
Christoph Oelckers 2019-01-25 18:16:18 +01:00
commit 4e052f2857
21 changed files with 107 additions and 103 deletions

View file

@ -428,7 +428,7 @@ void F2DDrawer::AddPoly(FTexture *texture, FVector2 *points, int npoints,
// is necessary in order to best reproduce Doom's original lighting.
double fadelevel;
if (vid_rendermode != 4 || level.lightMode == ELightMode::Doom || level.lightMode == ELightMode::ZDoomSoftware || level.lightMode == ELightMode::DoomSoftware)
if (vid_rendermode != 4 || currentUILevel->lightMode == ELightMode::Doom || currentUILevel->lightMode == ELightMode::ZDoomSoftware || currentUILevel->lightMode == ELightMode::DoomSoftware)
{
double map = (NUMCOLORMAPS * 2.) - ((lightlevel + 12) * (NUMCOLORMAPS / 128.));
fadelevel = clamp((map - 12) / NUMCOLORMAPS, 0.0, 1.0);