From b3d1e87c7b935563d735ffb5d10c3ee60c6e3b28 Mon Sep 17 00:00:00 2001 From: ohyzha Date: Mon, 23 Sep 2024 15:59:42 +0300 Subject: [PATCH] fix compilation errors --- openVulkanoCpp/Math/RGB565.hpp | 87 ++++++++++++++++------------------ 1 file changed, 41 insertions(+), 46 deletions(-) diff --git a/openVulkanoCpp/Math/RGB565.hpp b/openVulkanoCpp/Math/RGB565.hpp index 2e1bf5c..a30a476 100644 --- a/openVulkanoCpp/Math/RGB565.hpp +++ b/openVulkanoCpp/Math/RGB565.hpp @@ -36,29 +36,29 @@ namespace OpenVulkano::Math RGB565() : r(0), g(0), b(0) {} - template || std::is_signed_v>> + template || std::is_signed_v, bool> = true> RGB565(const Math::Vector3& color) : b(Make5(color.b)), g(Make6(color.g)), r(Make5(color.r)) { } - template || std::is_signed_v>> + template || std::is_signed_v, bool> = true> RGB565(const Math::Vector4& color) : b(Make5(color.b)), g(Make6(color.g)), r(Make5(color.r)) { } - template || std::is_signed_v>> + template || std::is_signed_v, bool> = true> RGB565(const Math::Vector3_SIMD& color) : b(Make5(color.b)), g(Make6(color.g)), r(Make5(color.r)) { } - template>> + template, bool> = true> RGB565(const Math::Vector3& color) : b(Make5FromFloat(color.b)), g(Make6FromFloat(color.g)), r(Make5FromFloat(color.r)) { } - template>> + template, bool> = true> RGB565(const Math::Vector4& color) : b(Make5FromFloat(color.b)), g(Make6FromFloat(color.g)), r(Make5FromFloat(color.r)) { } - template>> + template, bool> = true> RGB565(const Math::Vector3_SIMD& color) : b(Make5FromFloat(color.b)), g(Make6FromFloat(color.g)), r(Make5FromFloat(color.r)) { @@ -68,30 +68,32 @@ namespace OpenVulkano::Math uint8_t GetG() { return Unmake6(g); } uint8_t GetB() { return Unmake5(b); } - template || std::is_signed_v>> + template || std::is_signed_v, bool> = true> Math::Vector3 Get3() { return { GetR(), GetG(), GetB() }; } - template || std::is_signed_v>> + template || std::is_signed_v, bool> = true> Math::Vector4 Get4() { return { GetR(), GetG(), GetB(), 1 }; } - template || std::is_signed_v>> + template || std::is_signed_v, bool> = true> Math::Vector3_SIMD GetSIMD() { return { GetR(), GetG(), GetB() }; } - template>> Math::Vector3 Get3Normalized() + template, bool> = true> + Math::Vector3 Get3Normalized() { return { GetR_Normalized(), GetG_Normalized(), GetB_Normalized() }; } - template>> Math::Vector4 Get4Normalized() + template, bool> = true> + Math::Vector4 Get4Normalized() { return { GetR_Normalized(), GetG_Normalized(), GetB_Normalized(), 1 }; } - template>> + template, bool> = true> Math::Vector3_SIMD Get3NormalizedSIMD() { return { GetR_Normalized(), GetG_Normalized(), GetB_Normalized() }; @@ -101,7 +103,7 @@ namespace OpenVulkano::Math void SetG(uint8_t green) { g = Make6(green); } void SetB(uint8_t blue) { b = Make5(blue); } - template || std::is_signed_v>> + template || std::is_signed_v, bool> = true> void Set(const Math::Vector3& color) { r = Make5(color.r); @@ -109,7 +111,7 @@ namespace OpenVulkano::Math b = Make5(color.b); } - template || std::is_signed_v>> + template || std::is_signed_v, bool> = true> void Set(const Math::Vector4& color) { r = Make5(color.r); @@ -117,7 +119,7 @@ namespace OpenVulkano::Math b = Make5(color.b); } - template>> + template, bool> = true> void SetNormalized(const Math::Vector3& color) { r = Make5FromFloat(color.r); @@ -125,7 +127,7 @@ namespace OpenVulkano::Math b = Make5FromFloat(color.b); } - template>> + template, bool> = true> void SetNormalized(const Math::Vector4& color) { r = Make5FromFloat(color.r); @@ -153,133 +155,126 @@ namespace OpenVulkano::Math return *this; } - template || std::is_signed_v>> + template || std::is_signed_v, bool> = true> RGB565& operator=(const Vector3& color) { Set(color); return *this; } - template || std::is_signed_v>> - RGB565& operator=(const Vector4& color) - { - Set(color); - return *this; - } - - template || std::is_signed_v>> + template || std::is_signed_v, bool> = true> RGB565& operator=(const Vector3_SIMD& color) { Set(color); return *this; } - template || std::is_signed_v>> + template || std::is_signed_v, bool> = true> RGB565& operator=(const Vector4_SIMD& color) { Set(color); return *this; } - template>> + template, bool> = true> RGB565& operator=(const Vector3& color) { SetNormalized(color); return *this; } - template>> + template, bool> = true> RGB565& operator=(const Vector4& color) { SetNormalized(color); return *this; } - template>> + template, bool> = true> RGB565& operator=(const Vector3_SIMD& color) { SetNormalized(color); return *this; } - template || std::is_signed_v>> + template || std::is_signed_v, bool> = true> RGB565& operator+=(const Vector3& color) { Set(Get3() + color); return *this; } - template || std::is_signed_v>> + template || std::is_signed_v, bool> = true> RGB565& operator+=(const Vector4& color) { Set(Get4() + color); return *this; } - template || std::is_signed_v>> + template || std::is_signed_v, bool> = true> RGB565& operator+=(const Vector3_SIMD& color) { Set(Get3SIMD() + color); return *this; } - template>> + template, bool> = true> RGB565& operator+=(const Vector3& color) { SetNormalized(Get3Normalized() + color); return *this; } - template>> + template, bool> = true> RGB565& operator+=(const Vector4& color) { SetNormalized(Get4Normalized() + color); return *this; } - template>> + template, bool> = true> RGB565& operator+=(const Vector3_SIMD& color) { SetNormalized(Get3NormalizedSIMD() + color); return *this; } - template || std::is_signed_v>> + template || std::is_signed_v, bool> = true> RGB565& operator-=(const Vector3& color) { Set(Get3() - color); return *this; } - template || std::is_signed_v>> + template || std::is_signed_v, bool> = true> RGB565& operator-=(const Vector4& color) { Set(Get4() - color); return *this; } - template || std::is_signed_v>> + template || std::is_signed_v, bool> = true> RGB565& operator-=(const Vector3_SIMD& color) { Set(Get3SIMD() - color); return *this; } - template>> + template, bool> = true> RGB565& operator-=(const Vector3& color) { SetNormalized(Get3Normalized() - color); return *this; } - template>> + template, bool> = true> RGB565& operator-=(const Vector4& color) { SetNormalized(Get4Normalized() - color); return *this; } - template>> + template, bool> = true> RGB565& operator-=(const Vector3_SIMD& color) { SetNormalized(Get3NormalizedSIMD() - color); @@ -289,15 +284,15 @@ namespace OpenVulkano::Math bool operator==(const RGB565& other) const { return value == other.value; } bool operator!=(const RGB565& other) const { return value != other.value; } - template || std::is_signed_v>> + template || std::is_signed_v, bool> = true> operator Math::Vector4() { return Get4(); } - template || std::is_signed_v>> + template || std::is_signed_v, bool> = true> operator Math::Vector3() { return Get3(); } - template || std::is_signed_v>> + template || std::is_signed_v, bool> = true> operator Math::Vector3_SIMD() { return Get3SIMD(); } - template>> + template, bool> = true> operator Math::Vector4() { return Get4Normalized(); } - template>> + template, bool> = true> operator Math::Vector3() { return Get3Normalized(); } };