Add per-tier sidedef light levels to UDMF maps

This commit is contained in:
Nikolay Ambartsumov 2021-02-26 08:01:09 +02:00 committed by Rachael Alexanderson
commit df976e218e
13 changed files with 150 additions and 69 deletions

View file

@ -1533,11 +1533,18 @@ void line_t::AdjustLine()
//
//==========================================================================
int side_t::GetLightLevel (bool foggy, int baselight, bool is3dlight, int *pfakecontrast) const
int side_t::GetLightLevel (bool foggy, int baselight, int which, bool is3dlight, int *pfakecontrast) const
{
if (!is3dlight && (Flags & WALLF_ABSLIGHTING))
if (!is3dlight)
{
baselight = Light;
if (Flags & (WALLF_ABSLIGHTING_TIER << which))
{
baselight = TierLights[which];
}
else if (Flags & WALLF_ABSLIGHTING)
{
baselight = Light + TierLights[which];
}
}
if (pfakecontrast != NULL)
@ -1576,9 +1583,9 @@ int side_t::GetLightLevel (bool foggy, int baselight, bool is3dlight, int *pfake
}
}
}
if (!is3dlight && !(Flags & WALLF_ABSLIGHTING) && (!foggy || (Flags & WALLF_LIGHT_FOG)))
if (!is3dlight && !(Flags & WALLF_ABSLIGHTING) && !(Flags & (WALLF_ABSLIGHTING_TIER << which)) && (!foggy || (Flags & WALLF_LIGHT_FOG)))
{
baselight += this->Light;
baselight += this->Light + this->TierLights[which];
}
return baselight;
}
@ -1619,4 +1626,3 @@ void vertex_t::RecalcVertexHeights()
if (numheights <= 2) numheights = 0; // is not in need of any special attention
dirty = false;
}