diff --git a/src/lol/gpu/shader.h b/src/lol/gpu/shader.h index 793b20da..51cec1f4 100644 --- a/src/lol/gpu/shader.h +++ b/src/lol/gpu/shader.h @@ -125,9 +125,9 @@ struct ShaderAttrib public: inline ShaderAttrib() : m_flags((uint64_t)0 - 1) {} - inline bool IsValid() { return m_flags != (uint64_t)0 - 1; } - inline VertexUsage GetUsage() { return VertexUsage((int)(m_flags >> 16) & 0xffff); } - inline int GetIndex() { return (int)(m_flags & 0xffff); } + inline bool IsValid() { return m_flags != (uint64_t)0 - 1; } + inline VertexUsage GetUsage() { return VertexUsage((int)(m_flags >> 16) & 0xffff); } + inline int GetIndex() { return (int)(m_flags & 0xffff); } private: uint64_t m_flags; diff --git a/src/numeric.h b/src/numeric.h index 7d7dfece..3379be56 100644 --- a/src/numeric.h +++ b/src/numeric.h @@ -45,41 +45,41 @@ template static inline T1 damp(const T1 template< class T > inline void Swap( T& A, T& B ) { - const T Temp = A; - A = B; - B = Temp; + const T Temp = A; + A = B; + B = Temp; } //SmoothClamp clamps x in [a - sd, b + sd] and returns a value in [a, b] that is smoothed at the borders. static inline float SmoothClamp(float &x, float a, float b, float sd) { - if (b < a) - Swap(a, b); + if (b < a) + Swap(a, b); float tx = x; float ta = a - sd; float tb = b + sd; - if (sd > 0.f) - { - if ((b - a) < 2.f * sd) - sd = .5f * (b - a); + if (sd > 0.f) + { + if ((b - a) < 2.f * sd) + sd = .5f * (b - a); - if (tx < a + sd && tx > a - sd) - { - float t = (tx - a) / sd; - t = 0.25f * (t + 1.0f) * (t + 1.0f); - tx = a + t * sd; - } - else if (tx < b + sd && tx > b - sd) - { - float t = -(tx - b) / sd; - t = 0.25f * (t + 1.0f) * (t + 1.0f); - tx = b - t * sd; - } - } + if (tx < a + sd && tx > a - sd) + { + float t = (tx - a) / sd; + t = 0.25f * (t + 1.0f) * (t + 1.0f); + tx = a + t * sd; + } + else if (tx < b + sd && tx > b - sd) + { + float t = -(tx - b) / sd; + t = 0.25f * (t + 1.0f) * (t + 1.0f); + tx = b - t * sd; + } + } x = lol::clamp(x, ta, tb); - return lol::clamp(tx, a, b); + return lol::clamp(tx, a, b); } } /* namespace lol */