mColor can extend ut::Color

This commit is contained in:
robojumper
2024-06-26 20:08:59 +02:00
parent 22edfeae16
commit e296019657
2 changed files with 3 additions and 29 deletions
+2 -28
View File
@@ -1,35 +1,9 @@
#ifndef M_COLOR_H
#define M_COLOR_H
#include <nw4r/ut/ut_Color.h>
#include <rvl/GX.h>
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<GXColor &>(*this);
}
union {
struct {
u8 r;
u8 g;
u8 b;
u8 a;
};
u32 rgba;
};
};
#endif
+1 -1
View File
@@ -60,7 +60,7 @@ public:
operator u32() const {
return ToU32ref();
}
};
} ALIGN(4);
} // namespace ut
} // namespace nw4r