diff --git a/src/video_core/pica_types.h b/src/video_core/pica_types.h index 4fd27f9fe..ad454555e 100644 --- a/src/video_core/pica_types.h +++ b/src/video_core/pica_types.h @@ -4,6 +4,7 @@ #pragma once +#include #include #include #include @@ -50,7 +51,7 @@ public: hex = sign; } - std::memcpy(&res.value, &hex, sizeof(float)); + res.value = std::bit_cast(hex); return res; } @@ -95,17 +96,17 @@ public: } constexpr Float& operator/=(const Float& flt) { - value /= flt.ToFloat32(); + value = operator/(flt).value; return *this; } constexpr Float& operator+=(const Float& flt) { - value += flt.ToFloat32(); + value = operator+(flt).value; return *this; } constexpr Float& operator-=(const Float& flt) { - value -= flt.ToFloat32(); + value = operator-(flt).value; return *this; }