diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 394b7d9..40a3c09 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,9 +21,9 @@ jobs: - uses: actions/checkout@v2 - name: Run clang-format - uses: jidicula/clang-format-action@v4.4.0 + uses: jidicula/clang-format-action@v4.6.1 with: - clang-format-version: '13' + clang-format-version: '14' build: strategy: diff --git a/lib/include/Vulk/Color.hpp b/lib/include/Vulk/Color.hpp index 4b7af27..1bc8242 100644 --- a/lib/include/Vulk/Color.hpp +++ b/lib/include/Vulk/Color.hpp @@ -57,11 +57,11 @@ struct Color uint32_t value = r; value <<= 8; - value += g; + value |= g; value <<= 8; - value += b; + value |= b; value <<= 8; - value += a; + value |= a; return value; } diff --git a/lib/include/Vulk/Vec2.hpp b/lib/include/Vulk/Vec2.hpp index db0db85..716fabf 100644 --- a/lib/include/Vulk/Vec2.hpp +++ b/lib/include/Vulk/Vec2.hpp @@ -20,6 +20,7 @@ #pragma once #include +#include #include namespace vulk { @@ -33,6 +34,13 @@ struct Vec2 constexpr Vec2(T aX, T aY) : x{aX}, y{aY} {} constexpr explicit Vec2(T value) : x{value}, y{value} {} + constexpr Vec2(Vec2&&) noexcept = default; + constexpr Vec2(const Vec2&) noexcept = default; + constexpr Vec2& operator=(Vec2&&) noexcept = default; + constexpr Vec2& operator=(const Vec2&) noexcept = default; + + constexpr auto operator<=>(const Vec2&) const noexcept = default; + constexpr Vec2 operator-() const noexcept { return Vec2{-x, -y}; } constexpr Vec2& operator+=(const Vec2& rhs) diff --git a/lib/include/Vulk/Vec3.hpp b/lib/include/Vulk/Vec3.hpp index 57589c8..8c4fa00 100644 --- a/lib/include/Vulk/Vec3.hpp +++ b/lib/include/Vulk/Vec3.hpp @@ -20,6 +20,7 @@ #pragma once #include +#include #include namespace vulk { @@ -34,6 +35,13 @@ struct Vec3 constexpr Vec3(T aX, T aY, T aZ) : x{aX}, y{aY}, z{aZ} {} constexpr explicit Vec3(T value) : x{value}, y{value}, z{value} {} + constexpr Vec3(Vec3&&) noexcept = default; + constexpr Vec3(const Vec3&) noexcept = default; + constexpr Vec3& operator=(Vec3&&) noexcept = default; + constexpr Vec3& operator=(const Vec3&) noexcept = default; + + constexpr auto operator<=>(const Vec3&) const noexcept = default; + constexpr Vec3 operator-() const noexcept { return Vec3{-x, -y, -z}; } constexpr Vec3& operator+=(const Vec3& rhs)