diff --git a/specs/udmf_zdoom.txt b/specs/udmf_zdoom.txt index 9d7bb3caf..bdd70322e 100644 --- a/specs/udmf_zdoom.txt +++ b/specs/udmf_zdoom.txt @@ -141,6 +141,9 @@ Note: All fields default to false unless mentioned otherwise. light = ; // This side's light level. Default is 0. lightabsolute = ; // true = 'light' is an absolute value. Default is // relative to the owning sector's light level. + lightfog = ; // true = This side's relative lighting is used even in + // foggy sectors. Default is to disable relative + // lighting in foggy sectors. nofakecontrast = ; // Disables use of fake contrast on this sidedef. smoothlighting = ; // Use smooth fake contrast. clipmidtex = ; // Side's mid textures are clipped to floor and ceiling. diff --git a/src/namedef.h b/src/namedef.h index 50fa9f292..34f9b7235 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -448,6 +448,7 @@ xx(scalex_bottom) xx(scaley_bottom) xx(light) xx(lightabsolute) +xx(lightfog) xx(nofakecontrast) xx(smoothlighting) xx(blockprojectiles) diff --git a/src/p_sectors.cpp b/src/p_sectors.cpp index 330344679..d90466fec 100644 --- a/src/p_sectors.cpp +++ b/src/p_sectors.cpp @@ -996,10 +996,10 @@ int side_t::GetLightLevel (bool foggy, int baselight, bool noabsolute, int *pfak baselight += rel; } } - if (!(Flags & WALLF_ABSLIGHTING)) - { - baselight += this->Light; - } + } + if (!(Flags & WALLF_ABSLIGHTING) && (!foggy || (Flags & WALLF_LIGHT_FOG))) + { + baselight += this->Light; } return baselight; } diff --git a/src/p_udmf.cpp b/src/p_udmf.cpp index 2bc3e0bea..5abe40908 100644 --- a/src/p_udmf.cpp +++ b/src/p_udmf.cpp @@ -1053,6 +1053,10 @@ public: Flag(sd->Flags, WALLF_ABSLIGHTING, key); continue; + case NAME_lightfog: + Flag(sd->Flags, WALLF_LIGHT_FOG, key); + continue; + case NAME_nofakecontrast: Flag(sd->Flags, WALLF_NOFAKECONTRAST, key); continue; diff --git a/src/r_defs.h b/src/r_defs.h index 5f8272b3d..87c9e9e4f 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -744,6 +744,7 @@ enum WALLF_CLIP_MIDTEX = 16, // Like the line counterpart, but only for this side. WALLF_WRAP_MIDTEX = 32, // Like the line counterpart, but only for this side. WALLF_POLYOBJ = 64, // This wall belongs to a polyobject. + WALLF_LIGHT_FOG = 128, // This wall's Light is used even in fog. }; struct side_t