From e296019657b4edd227f85ff50c37061df4e35741 Mon Sep 17 00:00:00 2001 From: robojumper Date: Wed, 26 Jun 2024 20:08:59 +0200 Subject: [PATCH] mColor can extend ut::Color --- include/m/m_color.h | 30 ++---------------------------- include/nw4r/ut/ut_Color.h | 2 +- 2 files changed, 3 insertions(+), 29 deletions(-) diff --git a/include/m/m_color.h b/include/m/m_color.h index e090baa1..a5ce85b8 100644 --- a/include/m/m_color.h +++ b/include/m/m_color.h @@ -1,35 +1,9 @@ #ifndef M_COLOR_H #define M_COLOR_H +#include #include -struct mColor { - mColor() { - rgba = 0xFFFFFFFF; - } - mColor(u8 red, u8 green, u8 blue, u8 alpha) { - r = red; - g = green; - b = blue; - a = alpha; - } - mColor(u32 color) { - rgba = color; - } +struct mColor : public nw4r::ut::Color {}; - // The alternative is that GXColor is a union and this extends GXColor? - operator GXColor &() { - return reinterpret_cast(*this); - } - - union { - struct { - u8 r; - u8 g; - u8 b; - u8 a; - }; - u32 rgba; - }; -}; #endif diff --git a/include/nw4r/ut/ut_Color.h b/include/nw4r/ut/ut_Color.h index 77b63b36..5f3374c3 100644 --- a/include/nw4r/ut/ut_Color.h +++ b/include/nw4r/ut/ut_Color.h @@ -60,7 +60,7 @@ public: operator u32() const { return ToU32ref(); } -}; +} ALIGN(4); } // namespace ut } // namespace nw4r