diff options
| author | Jules Blok <jules.blok@gmail.com> | 2018-02-02 15:32:52 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-02-02 15:32:52 +0100 |
| commit | 4515f1d70df440df715e32863afec296b7f2e1d0 (patch) | |
| tree | c616f3e347e35c321b7a1acead859b9b4128c8ab /Source/Core/VideoBackends/Software/Tev.cpp | |
| parent | 1264daae9bcb2ae98b91211fff830a6c18f77cb5 (diff) | |
| parent | 260d5b7aa78e384dfb7d723eb52cae12e1b8da1b (diff) | |
Merge pull request #6348 from stenzek/fog
BPMemory: Handle fog configuration where both A and C are infinity/NaN
Diffstat (limited to 'Source/Core/VideoBackends/Software/Tev.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Software/Tev.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/Core/VideoBackends/Software/Tev.cpp b/Source/Core/VideoBackends/Software/Tev.cpp index 836299e715..572da58f9c 100644 --- a/Source/Core/VideoBackends/Software/Tev.cpp +++ b/Source/Core/VideoBackends/Software/Tev.cpp @@ -751,14 +751,14 @@ void Tev::Draw() // ze = A/(B - (Zs >> B_SHF)) const s32 denom = bpmem.fog.b_magnitude - (Position[2] >> bpmem.fog.b_shift); // in addition downscale magnitude and zs to 0.24 bits - ze = (bpmem.fog.a.GetA() * 16777215.0f) / (float)denom; + ze = (bpmem.fog.GetA() * 16777215.0f) / static_cast<float>(denom); } else { // orthographic // ze = a*Zs // in addition downscale zs to 0.24 bits - ze = bpmem.fog.a.GetA() * ((float)Position[2] / 16777215.0f); + ze = bpmem.fog.GetA() * (static_cast<float>(Position[2]) / 16777215.0f); } if (bpmem.fogRange.Base.Enabled) @@ -796,7 +796,7 @@ void Tev::Draw() // GXInitFogAdjTable): 1/cos = c/b = sqrt(a^2+b^2)/b } - ze -= bpmem.fog.c_proj_fsel.GetC(); + ze -= bpmem.fog.GetC(); // clamp 0 to 1 float fog = (ze < 0.0f) ? 0.0f : ((ze > 1.0f) ? 1.0f : ze); |
