diff options
| author | Markus Wick <degasus@users.noreply.github.com> | 2016-09-02 09:53:44 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-09-02 09:53:44 +0200 |
| commit | da8238934763db6e8159c10f3ea0730930fa6214 (patch) | |
| tree | dc080d60957e52cd3cb9925b10eb674359f3b687 /Source/Core/VideoBackends/Software/Tev.cpp | |
| parent | d072d6d336004154a0843495c8917fe4bfa7d583 (diff) | |
| parent | 0e7424b359a072bc05347c04913478d2e0eb7e6a (diff) | |
Merge pull request #4172 from phire/software_fog_error
VideoSoftware: Fix unsigned overflow bug in fog
Diffstat (limited to 'Source/Core/VideoBackends/Software/Tev.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Software/Tev.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/Core/VideoBackends/Software/Tev.cpp b/Source/Core/VideoBackends/Software/Tev.cpp index 54dd305206..5cd4491cc9 100644 --- a/Source/Core/VideoBackends/Software/Tev.cpp +++ b/Source/Core/VideoBackends/Software/Tev.cpp @@ -769,7 +769,8 @@ void Tev::Draw() // - scaling of the "k" coefficient isn't clear either. // First, calculate the offset from the viewport center (normalized to 0..1) - float offset = (Position[0] - (bpmem.fogRange.Base.Center - 342)) / (float)xfmem.viewport.wd; + float offset = (Position[0] - (static_cast<s32>(bpmem.fogRange.Base.Center) - 342)) / + static_cast<float>(xfmem.viewport.wd); // Based on that, choose the index such that points which are far away from the z-axis use the // 10th "k" value and such that central points use the first value. |
