diff options
| author | Matthew Parlane <parlane@gmail.com> | 2017-01-24 11:00:25 +1300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-01-24 11:00:25 +1300 |
| commit | 98c4ceb3d1e5f2064bf10e11abd11f17d057b104 (patch) | |
| tree | 296120f28f81003b4bd8457b58670b54a237b14c /Source/Core/VideoCommon/BPMemory.cpp | |
| parent | bd2881ff867fc9436bb206c46efa5bd015e00e23 (diff) | |
| parent | 7a58a82a37078c9b7d73b125734b60aa540670b1 (diff) | |
Merge pull request #4737 from lioncash/bpmem
BPMemory: Minor changes
Diffstat (limited to 'Source/Core/VideoCommon/BPMemory.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/BPMemory.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/BPMemory.cpp b/Source/Core/VideoCommon/BPMemory.cpp index 1665976018..67eeb994b1 100644 --- a/Source/Core/VideoCommon/BPMemory.cpp +++ b/Source/Core/VideoCommon/BPMemory.cpp @@ -4,6 +4,30 @@ #include "VideoCommon/BPMemory.h" +#include <cstring> + // BP state // STATE_TO_SAVE BPMemory bpmem; + +float FogParam0::GetA() const +{ + // scale mantissa from 11 to 23 bits + const u32 integral = (static_cast<u32>(sign) << 31) | (static_cast<u32>(exponent) << 23) | + (static_cast<u32>(mantissa) << 12); + + float real; + std::memcpy(&real, &integral, sizeof(u32)); + return real; +} + +float FogParam3::GetC() const +{ + // scale mantissa from 11 to 23 bits + const u32 integral = (static_cast<u32>(c_sign) << 31) | (static_cast<u32>(c_exp) << 23) | + (static_cast<u32>(c_mant) << 12); + + float real; + std::memcpy(&real, &integral, sizeof(u32)); + return real; +} |
