diff --git a/include/Nazara/Graphics/DepthMaterial.hpp b/include/Nazara/Graphics/DepthMaterial.hpp index 3d59b19e6..eb84f590d 100644 --- a/include/Nazara/Graphics/DepthMaterial.hpp +++ b/include/Nazara/Graphics/DepthMaterial.hpp @@ -29,7 +29,7 @@ namespace Nz static bool Initialize(); static void Uninitialize(); - static std::shared_ptr s_basicMaterialSettings; + static std::shared_ptr s_depthMaterialSettings; }; } diff --git a/include/Nazara/Graphics/DepthMaterial.inl b/include/Nazara/Graphics/DepthMaterial.inl index 0eb450c61..448b211d7 100644 --- a/include/Nazara/Graphics/DepthMaterial.inl +++ b/include/Nazara/Graphics/DepthMaterial.inl @@ -9,7 +9,7 @@ namespace Nz { inline const std::shared_ptr& DepthMaterial::GetSettings() { - return s_basicMaterialSettings; + return s_depthMaterialSettings; } } diff --git a/include/Nazara/Graphics/ForwardFramePipeline.hpp b/include/Nazara/Graphics/ForwardFramePipeline.hpp index 20a8e1d0e..d52df65fa 100644 --- a/include/Nazara/Graphics/ForwardFramePipeline.hpp +++ b/include/Nazara/Graphics/ForwardFramePipeline.hpp @@ -30,7 +30,6 @@ namespace Nz { - class PointLight; class RenderFrame; class RenderTarget; diff --git a/include/Nazara/Graphics/ForwardFramePipeline.inl b/include/Nazara/Graphics/ForwardFramePipeline.inl index 47b5ce6f6..834d564f6 100644 --- a/include/Nazara/Graphics/ForwardFramePipeline.inl +++ b/include/Nazara/Graphics/ForwardFramePipeline.inl @@ -3,7 +3,6 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include #include namespace Nz diff --git a/include/Nazara/Math/Algorithm.hpp b/include/Nazara/Math/Algorithm.hpp index 81dc032e3..a4a2a1fa6 100644 --- a/include/Nazara/Math/Algorithm.hpp +++ b/include/Nazara/Math/Algorithm.hpp @@ -39,8 +39,8 @@ namespace Nz unsigned int GetNumberLength(float number, UInt8 precision = NAZARA_CORE_DECIMAL_DIGITS); unsigned int GetNumberLength(double number, UInt8 precision = NAZARA_CORE_DECIMAL_DIGITS); unsigned int GetNumberLength(long double number, UInt8 precision = NAZARA_CORE_DECIMAL_DIGITS); - template /*constexpr*/ unsigned int IntegralLog2(T number); - template /*constexpr*/ unsigned int IntegralLog2Pot(T pot); + template constexpr unsigned int IntegralLog2(T number); + template constexpr unsigned int IntegralLog2Pot(T pot); template constexpr T IntegralPow(T base, unsigned int exponent); template constexpr T Lerp(const T& from, const T& to, const T2& interpolation); template constexpr T MultiplyAdd(T x, T y, T z); diff --git a/include/Nazara/Math/Algorithm.inl b/include/Nazara/Math/Algorithm.inl index 706917044..10cfe7681 100644 --- a/include/Nazara/Math/Algorithm.inl +++ b/include/Nazara/Math/Algorithm.inl @@ -18,13 +18,13 @@ namespace Nz namespace { // https://graphics.stanford.edu/~seander/bithacks.html#IntegerLogDeBruijn - static const unsigned int MultiplyDeBruijnBitPosition[32] = + static constexpr unsigned int MultiplyDeBruijnBitPosition[32] = { 0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30, 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31 }; - static const unsigned int MultiplyDeBruijnBitPosition2[32] = + static constexpr unsigned int MultiplyDeBruijnBitPosition2[32] = { 0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8, 31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9 @@ -32,7 +32,7 @@ namespace Nz } template - typename std::enable_if::type IntegralLog2(T number) + constexpr std::enable_if_t IntegralLog2(T number) { // https://graphics.stanford.edu/~seander/bithacks.html#IntegerLogDeBruijn number |= number >> 1; // first round down to one less than a power of 2 @@ -45,8 +45,7 @@ namespace Nz } template - // The parentheses are needed for GCC - typename std::enable_if<(sizeof(T) > sizeof(UInt32)), unsigned int>::type IntegralLog2(T number) + constexpr std::enable_if_t<(sizeof(T) > sizeof(UInt32)), unsigned int> IntegralLog2(T number) { static_assert(sizeof(T) % sizeof(UInt32) == 0, "Assertion failed"); @@ -69,15 +68,14 @@ namespace Nz } template - typename std::enable_if::type IntegralLog2Pot(T number) + constexpr std::enable_if_t IntegralLog2Pot(T number) { // https://graphics.stanford.edu/~seander/bithacks.html#IntegerLogDeBruijn return MultiplyDeBruijnBitPosition2[static_cast(number * 0x077CB531U) >> 27]; } template - // The parentheses are needed for GCC - typename std::enable_if<(sizeof(T) > sizeof(UInt32)), unsigned int>::type IntegralLog2Pot(T number) + constexpr std::enable_if_t<(sizeof(T) > sizeof(UInt32)), unsigned int> IntegralLog2Pot(T number) { static_assert(sizeof(T) % sizeof(UInt32) == 0, "Assertion failed"); @@ -391,8 +389,7 @@ namespace Nz * \remark If number is 0, 0 is returned */ template - //TODO: Mark as constexpr when supported by all major compilers - /*constexpr*/ inline unsigned int IntegralLog2(T number) + constexpr unsigned int IntegralLog2(T number) { // Proxy needed to avoid an overload problem return Detail::IntegralLog2(number); @@ -409,8 +406,7 @@ namespace Nz * \remark If number is 0, 0 is returned */ template - //TODO: Mark as constexpr when supported by all major compilers - /*constexpr*/ inline unsigned int IntegralLog2Pot(T pot) + constexpr unsigned int IntegralLog2Pot(T pot) { return Detail::IntegralLog2Pot(pot); } diff --git a/src/Nazara/Graphics/DepthMaterial.cpp b/src/Nazara/Graphics/DepthMaterial.cpp index 580db8d71..146739129 100644 --- a/src/Nazara/Graphics/DepthMaterial.cpp +++ b/src/Nazara/Graphics/DepthMaterial.cpp @@ -37,15 +37,15 @@ namespace Nz options.basicOptionIndexes = &s_basicOptionIndexes; options.basicTextureIndexes = &s_basicTextureIndexes; - s_basicMaterialSettings = std::make_shared(Build(options)); + s_depthMaterialSettings = std::make_shared(Build(options)); return true; } void DepthMaterial::Uninitialize() { - s_basicMaterialSettings.reset(); + s_depthMaterialSettings.reset(); } - std::shared_ptr DepthMaterial::s_basicMaterialSettings; + std::shared_ptr DepthMaterial::s_depthMaterialSettings; }