summaryrefslogtreecommitdiff
path: root/include/JSystem/JUtility
diff options
context:
space:
mode:
authorJulgodis <>2021-09-26 12:11:21 +0200
committerJulgodis <>2021-09-26 12:11:21 +0200
commitbf12ea7a1111fd57bb38c9f2f8076da6894cd146 (patch)
tree8d05f635966d98788d8d7a9fbfdb142c86147f79 /include/JSystem/JUtility
parentfa19d7a32e0ed5b8ff1909661220cad8fd2251b4 (diff)
Removed JUtility.h and added './tp format'
Diffstat (limited to 'include/JSystem/JUtility')
-rw-r--r--include/JSystem/JUtility/JUTConsole.h2
-rw-r--r--include/JSystem/JUtility/JUTFader.h2
-rw-r--r--include/JSystem/JUtility/JUTFont.h2
-rw-r--r--include/JSystem/JUtility/TColor.h32
4 files changed, 14 insertions, 24 deletions
diff --git a/include/JSystem/JUtility/JUTConsole.h b/include/JSystem/JUtility/JUTConsole.h
index a4a5b074e6..358b7a06b5 100644
--- a/include/JSystem/JUtility/JUTConsole.h
+++ b/include/JSystem/JUtility/JUTConsole.h
@@ -3,8 +3,8 @@
#include "JSystem/JGadget/linklist.h"
#include "JSystem/JKernel/JKRDisposer.h"
-#include "JSystem/JUtility.h"
#include "JSystem/JUtility/JUTFont.h"
+#include "JSystem/JUtility/TColor.h"
#include "dolphin/types.h"
class JUTConsole : public JKRDisposer {
diff --git a/include/JSystem/JUtility/JUTFader.h b/include/JSystem/JUtility/JUTFader.h
index 378d16eddd..7c7bf8d1b1 100644
--- a/include/JSystem/JUtility/JUTFader.h
+++ b/include/JSystem/JUtility/JUTFader.h
@@ -2,7 +2,7 @@
#define JUTFADER_H
#include "JSystem/JGeometry.h"
-#include "JSystem/JUtility.h"
+#include "JSystem/JUtility/TColor.h"
#include "dolphin/types.h"
class JUTFader {
diff --git a/include/JSystem/JUtility/JUTFont.h b/include/JSystem/JUtility/JUTFont.h
index b000764382..5b37dc7e2f 100644
--- a/include/JSystem/JUtility/JUTFont.h
+++ b/include/JSystem/JUtility/JUTFont.h
@@ -1,7 +1,7 @@
#ifndef JUTFONT_H
#define JUTFONT_H
-#include "JSystem/JUtility.h"
+#include "JSystem/JUtility/TColor.h"
#include "dolphin/gx/GX.h"
#include "dolphin/types.h"
diff --git a/include/JSystem/JUtility/TColor.h b/include/JSystem/JUtility/TColor.h
index d256af3bf3..473f28778e 100644
--- a/include/JSystem/JUtility/TColor.h
+++ b/include/JSystem/JUtility/TColor.h
@@ -5,39 +5,29 @@
#include "dolphin/types.h"
namespace JUtility {
-class TColor {
-public:
+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 gxColor) { set(gxColor); }
- TColor(const TColor& other) { *this = other; }
+ // TColor(const TColor& other) { set(other.toUInt32()); }
TColor& operator=(const TColor& other) {
- mColor = other.mColor;
+ ((GXColor*)this)->operator=(other);
return *this;
}
- operator u32() { return toUInt32(); }
- u32 toUInt32() { return *(u32*)&mColor; }
+ operator u32() const { return toUInt32(); }
+ u32 toUInt32() const { return *(u32*)&r; }
void set(u8 cR, u8 cG, u8 cB, u8 cA) {
- mColor.r = cR;
- mColor.g = cG;
- mColor.b = cB;
- mColor.a = cA;
+ r = cR;
+ g = cG;
+ b = cB;
+ a = cA;
}
- void set(u32 u32Color) { *(u32*)&mColor = u32Color; }
- void set(_GXColor gxColor) { mColor = gxColor; }
-
- u8 R() const { return mColor.r; }
- u8 G() const { return mColor.g; }
- u8 B() const { return mColor.b; }
- u8 A() const { return mColor.a; }
-
-private:
- _GXColor mColor;
+ void set(u32 u32Color) { *(u32*)&r = u32Color; }
+ void set(GXColor gxColor) { *(GXColor*)&r = gxColor; }
};
} // namespace JUtility