Fake contrast: Difference between revisions

m
m (→‎Technical details: location of the function changed recently)
The vanilla engine has 16 light levels corresponding to the 256 light values, so increasing or decreasing lightnum as done here corresponds to increasing or decreasing the effective sector light for the wall by 16. A perfectly "horizontal" wall is brightened, while a perfectly "vertical" one is darkened; every other wall uses the light level of the front sector. (As an aside, given the vanilla [[COLORMAP]] lump contains 32 colormaps for light levels, why the engine uses only 16 is a mystery.)
 
In ZDoom, these two code segments are factorized into a single function, <tt>side_t::GetLightLevel()</tt>, present in r_segs.cpp (or p_sectors.cpp since {{rev|3252}}). The function handles all three lighting options as well as wall and map flags.
 
[[Category:Glossary]]