mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-21 03:01:36 +00:00
- fixed bad assumption about g_visibility == 0 meaning fullbright.
This merely means that there should be no fog, but the shade must still be applied.
This commit is contained in:
parent
13c44cc32f
commit
f1859c69f0
1 changed files with 2 additions and 2 deletions
|
@ -101,7 +101,7 @@ void HWDrawInfo::SetFog(FRenderState &state, int lightlevel, float visibility, b
|
|||
PalEntry fogcolor;
|
||||
float fogdensity;
|
||||
|
||||
if (cmap != nullptr && !fullbright)
|
||||
if (cmap != nullptr && !fullbright && visibility > 0)
|
||||
{
|
||||
fogcolor = cmap->FadeColor;
|
||||
fogdensity = GetFogDensity(lightlevel, fogcolor, cmap->FogDensity, cmap->BlendFactor) * visibility;
|
||||
|
@ -163,7 +163,7 @@ void SetLightAndFog(HWDrawInfo* di, FRenderState& state, PalEntry fade, int pale
|
|||
|
||||
if (!di->isBuildSoftwareLighting() && !foggy)
|
||||
{
|
||||
bool fullbright = ShadeDiv < 1 / 1000.f || g_visibility == 0 || shade < -numshades;
|
||||
bool fullbright = ShadeDiv < 1 / 1000.f || shade < -numshades;
|
||||
float inverselight = shade * 255.f / numshades;
|
||||
if (!fullbright) inverselight /= ShadeDiv;
|
||||
int lightlevel = !fullbright ? clamp(int(255 - inverselight), 0, 255) : 255;
|
||||
|
|
Loading…
Reference in a new issue