diff options
author | Weiyi Wang <wwylele@gmail.com> | 2017-08-09 18:54:29 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-09 18:54:29 +0300 |
commit | 792dee47a7b520cb2a8d7cf43cc184c17394708f (patch) | |
tree | 35b14f184d95834bed51d3fda5c9662355e8b7f7 /src/common/vector_math.h | |
parent | 93ab46e500584d7b56e430f4552516a0e72cb398 (diff) | |
parent | 2252a63f8036cdf2612243271ce29e6104f82825 (diff) |
Merge pull request #2822 from wwylele/sw_lighting-2
Implement fragment lighting in the sw renderer (take 2)
Diffstat (limited to 'src/common/vector_math.h')
-rw-r--r-- | src/common/vector_math.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/common/vector_math.h b/src/common/vector_math.h index c7a461a1e..6e2a5ad60 100644 --- a/src/common/vector_math.h +++ b/src/common/vector_math.h @@ -31,7 +31,6 @@ #pragma once #include <cmath> -#include <type_traits> namespace Math { @@ -90,7 +89,7 @@ public: x -= other.x; y -= other.y; } - template <typename Q = T, class = typename std::enable_if<std::is_signed<Q>::value>::type> + Vec2<decltype(-T{})> operator-() const { return MakeVec(-x, -y); } @@ -247,7 +246,7 @@ public: y -= other.y; z -= other.z; } - template <typename Q = T, class = typename std::enable_if<std::is_signed<Q>::value>::type> + Vec3<decltype(-T{})> operator-() const { return MakeVec(-x, -y, -z); } @@ -462,7 +461,7 @@ public: z -= other.z; w -= other.w; } - template <typename Q = T, class = typename std::enable_if<std::is_signed<Q>::value>::type> + Vec4<decltype(-T{})> operator-() const { return MakeVec(-x, -y, -z, -w); } |