mirror of
https://github.com/zeldaret/ss
synced 2026-05-23 15:01:38 -04:00
mColor can extend ut::Color
This commit is contained in:
+2
-28
@@ -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
|
||||
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
operator u32() const {
|
||||
return ToU32ref();
|
||||
}
|
||||
};
|
||||
} ALIGN(4);
|
||||
|
||||
} // namespace ut
|
||||
} // namespace nw4r
|
||||
|
||||
Reference in New Issue
Block a user