Files
tp/include/JSystem/JUtility/TColor.h
T
TakaRikkaandGitHub 046d178003 work on daalink, fop actor, mDo machine, msg_scrn, + various (#201)
* work on fop actor / actor mng, daalink, d_a_obj_item

* d_a_title mostly decompiled

* daalink / d_event / JMessage / dmsg_out_font work

* msg_scrn_base / msg_scrn_boss

* some work on mDo machine, d_menu_save, d_tresure, and various

* remove asm

* progress
2022-06-29 22:19:09 +02:00

35 lines
858 B
C++

#ifndef TCOLOR_H
#define TCOLOR_H
#include "dolphin/gx/GX.h"
#include "dolphin/types.h"
namespace JUtility {
struct TColor : public GXColor {
TColor(u8 r, u8 g, u8 b, u8 a) { set(r, g, b, a); }
TColor() { set(0xffffffff); }
TColor(u32 u32Color) { set(u32Color); }
TColor(GXColor color) { set(color); }
// TColor(const TColor& other) { set(other.toUInt32()); }
TColor& operator=(const TColor& other) {
((GXColor*)this)->operator=(other);
return *this;
}
operator u32() const { return toUInt32(); }
u32 toUInt32() const { return *(u32*)&r; }
void set(u8 cR, u8 cG, u8 cB, u8 cA) {
r = cR;
g = cG;
b = cB;
a = cA;
}
void set(u32 u32Color) { *(u32*)&r = u32Color; }
void set(GXColor gxColor) { *(GXColor*)&r = gxColor; }
};
} // namespace JUtility
#endif