| 16 | namespace JUtility |
| 17 | { |
| 18 | struct TColor : public GXColor |
| 19 | { |
| 20 | TColor() { set(0xFFFFFFFF); } |
| 21 | |
| 22 | TColor(u8 _r, u8 _g, u8 _b, u8 _a) { set(_r, _g, _b, _a); } |
| 23 | |
| 24 | TColor(u32 u32Color) { set(u32Color); } |
| 25 | |
| 26 | TColor(GXColor color) { set(color); } |
| 27 | |
| 28 | /** @fabricated */ |
| 29 | TColor &operator=(const GXColorS10 &other) |
| 30 | { |
| 31 | r = other.r; |
| 32 | g = other.g; |
| 33 | b = other.b; |
| 34 | a = other.a; |
| 35 | return *this; |
| 36 | } |
| 37 | |
| 38 | operator u32() const { return toUInt32(); } |
| 39 | u32 toUInt32() const { return *(u32 *)&r; } |
| 40 | |
| 41 | void set(u8 cR, u8 cG, u8 cB, u8 cA) |
| 42 | { |
| 43 | r = cR; |
| 44 | g = cG; |
| 45 | b = cB; |
| 46 | a = cA; |
| 47 | } |
| 48 | |
| 49 | void set(u32 u32Color) { *(u32 *)&r = u32Color; } |
| 50 | |
| 51 | void set(GXColor gxColor) { *(GXColor *)&r = gxColor; } |
| 52 | //void set(TColor color) { *this = color; } |
| 53 | |
| 54 | void setRGB(u8 cR, u8 cG, u8 cB) |
| 55 | { |
| 56 | r = cR; |
| 57 | g = cG; |
| 58 | b = cB; |
| 59 | } |
| 60 | |
| 61 | void setRGB(const TColor &other) { setRGB(other.r, other.g, other.b); } |
| 62 | |
| 63 | void setRGBA(const TColor &other) |
| 64 | { |
| 65 | r = other.r; |
| 66 | g = other.g; |
| 67 | b = other.b; |
| 68 | a = other.a; |
| 69 | } |
| 70 | |
| 71 | // fabricated. but helped solve regswaps in a function |
| 72 | void setRGBA(const TColor &RGB, u8 _a) |
| 73 | { |
| 74 | setRGB(RGB); |
| 75 | a = _a; |
no outgoing calls
no test coverage detected