diff options
| author | Léo Lam <leo@innovatetechnologi.es> | 2019-05-05 10:24:18 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-05-05 10:24:18 +0200 |
| commit | 5d52b6ff095a4f8285ae757745ab0285bad47b9e (patch) | |
| tree | ac4904dfb02322a55dd7e5a2d7cdedf756f8eaf6 /Source/Core/VideoBackends/Software/TransformUnit.cpp | |
| parent | 99a4ca8de7111c8554b50217744e24bc71912cfe (diff) | |
| parent | 9133e8f1befbebd87c6e61f0e454f3ae2754285a (diff) | |
Merge pull request #6273 from leoetlino/c++17
Enable C++17
Diffstat (limited to 'Source/Core/VideoBackends/Software/TransformUnit.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Software/TransformUnit.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/Source/Core/VideoBackends/Software/TransformUnit.cpp b/Source/Core/VideoBackends/Software/TransformUnit.cpp index 8a2b4e7fb8..d8b7763669 100644 --- a/Source/Core/VideoBackends/Software/TransformUnit.cpp +++ b/Source/Core/VideoBackends/Software/TransformUnit.cpp @@ -12,7 +12,6 @@ #include "Common/Assert.h" #include "Common/CommonTypes.h" #include "Common/Logging/Log.h" -#include "Common/MathUtil.h" #include "Common/MsgHandler.h" #include "Common/Swap.h" @@ -192,8 +191,8 @@ static void TransformTexCoordRegular(const TexMtxInfo& texinfo, int coordNum, bo // Makes differences in Rogue Squadron 3 (Hoth sky) and The Last Story (shadow culling) if (dst->z == 0.0f) { - dst->x = MathUtil::Clamp(dst->x / 2.0f, -1.0f, 1.0f); - dst->y = MathUtil::Clamp(dst->y / 2.0f, -1.0f, 1.0f); + dst->x = std::clamp(dst->x / 2.0f, -1.0f, 1.0f); + dst->y = std::clamp(dst->y / 2.0f, -1.0f, 1.0f); } } @@ -359,9 +358,9 @@ void TransformColor(const InputVertexData* src, OutputVertexData* dst) LightColor(dst->mvPosition, dst->normal[0], i, colorchan, lightCol); } - int light_x = MathUtil::Clamp(static_cast<int>(lightCol.x), 0, 255); - int light_y = MathUtil::Clamp(static_cast<int>(lightCol.y), 0, 255); - int light_z = MathUtil::Clamp(static_cast<int>(lightCol.z), 0, 255); + int light_x = std::clamp(static_cast<int>(lightCol.x), 0, 255); + int light_y = std::clamp(static_cast<int>(lightCol.y), 0, 255); + int light_z = std::clamp(static_cast<int>(lightCol.z), 0, 255); chancolor[1] = (matcolor[1] * (light_x + (light_x >> 7))) >> 8; chancolor[2] = (matcolor[2] * (light_y + (light_y >> 7))) >> 8; chancolor[3] = (matcolor[3] * (light_z + (light_z >> 7))) >> 8; @@ -393,7 +392,7 @@ void TransformColor(const InputVertexData* src, OutputVertexData* dst) LightAlpha(dst->mvPosition, dst->normal[0], i, alphachan, lightCol); } - int light_a = MathUtil::Clamp(static_cast<int>(lightCol), 0, 255); + int light_a = std::clamp(static_cast<int>(lightCol), 0, 255); chancolor[0] = (matcolor[0] * (light_a + (light_a >> 7))) >> 8; } else |
