Remove unnecessary cast

This commit is contained in:
Georg Hagen
2024-11-29 01:08:11 +01:00
parent 7e0366f635
commit 0f438b3e98

View File

@@ -89,9 +89,9 @@ namespace OpenVulkano::Math
constexpr T Data() const { return data; }
[[nodiscard]] constexpr int X() const { T v = data & BITMASK; if (v > MAX_VALUE) v |= ~BITMASK; return reinterpret_cast<int&>(v); }
[[nodiscard]] constexpr int Y() const { T v = (data >> (2 * BITS)) & BITMASK; if (v > MAX_VALUE_Y) v |= ~BITMASK; return reinterpret_cast<int&>(v); }
[[nodiscard]] constexpr int Z() const { T v = (data >> BITS) & BITMASK; if (v > MAX_VALUE) v |= ~BITMASK; return reinterpret_cast<int&>(v); }
[[nodiscard]] constexpr int X() const { T v = data & BITMASK; if (v > MAX_VALUE) v |= ~BITMASK; return v; }
[[nodiscard]] constexpr int Y() const { T v = (data >> (2 * BITS)) & BITMASK; if (v > MAX_VALUE_Y) v |= ~BITMASK; return v; }
[[nodiscard]] constexpr int Z() const { T v = (data >> BITS) & BITMASK; if (v > MAX_VALUE) v |= ~BITMASK; return v; }
void SetX(int x)
{