summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorroeming <brother64youyou@gmail.com>2025-12-11 18:41:44 -0500
committerGitHub <noreply@github.com>2025-12-11 15:41:44 -0800
commit2481e184fb99b7343cbf0893f838cc892feafc4a (patch)
treea673d47c470871c058f5fd24a65505ef2b0e1fce /include
parent638e30d28dc20f9760d2c3854d9980a4530fdf49 (diff)
Link J2DWindowEX (#2946)
* Add debug for J2DWindowEx, link GCN version * locking non-const copy ctor behind GCN check * fix typo for define * fix another define typo * update bugged ctor and leave a comment
Diffstat (limited to 'include')
-rw-r--r--include/JSystem/J2DGraph/J2DAnimation.h10
-rw-r--r--include/JSystem/J2DGraph/J2DMatBlock.h20
-rw-r--r--include/JSystem/J3DGraphBase/J3DMatBlock.h10
-rw-r--r--include/JSystem/JUtility/JUTTexture.h1
4 files changed, 38 insertions, 3 deletions
diff --git a/include/JSystem/J2DGraph/J2DAnimation.h b/include/JSystem/J2DGraph/J2DAnimation.h
index 380e9c93de..5d2014cd61 100644
--- a/include/JSystem/J2DGraph/J2DAnimation.h
+++ b/include/JSystem/J2DGraph/J2DAnimation.h
@@ -63,13 +63,19 @@ public:
}
virtual ~J2DAnmVtxColor() {}
virtual void getColor(u8, u16, _GXColor*) const {}
- u16 getAnmTableNum(u8 param_0) const { return mAnmTableNum[param_0]; }
+ u16 getAnmTableNum(u8 param_0) const {
+ J3D_PANIC(342, param_0 < 2, "Error : range over.");
+ return mAnmTableNum[param_0];
+ }
J3DAnmVtxColorIndexData* getAnmVtxColorIndexData(u8 param_1, u16 param_2) const {
J3D_PANIC(344, param_1 < 2, "Error : range over.");
J3D_PANIC(345, param_2 < mAnmTableNum[param_1], "Error : range over.");
return &mVtxColorIndexData[param_1][param_2];
}
- u16* getVtxColorIndexPointer(u8 param_0) const { return mVtxColorIndexPointer[param_0]; }
+ u16* getVtxColorIndexPointer(u8 param_0) const {
+ J3D_PANIC(351, param_0 < 2, "Error : range over.");
+ return mVtxColorIndexPointer[param_0];
+ }
/* 0x10 */ u16 mAnmTableNum[2];
/* 0x14 */ J3DAnmVtxColorIndexData* mVtxColorIndexData[2];
diff --git a/include/JSystem/J2DGraph/J2DMatBlock.h b/include/JSystem/J2DGraph/J2DMatBlock.h
index c13fa2f332..90321c9196 100644
--- a/include/JSystem/J2DGraph/J2DMatBlock.h
+++ b/include/JSystem/J2DGraph/J2DMatBlock.h
@@ -19,19 +19,37 @@ struct ResTLUT;
*/
struct J2DGXColorS10 : public GXColorS10 {
J2DGXColorS10() {}
+
+#if PLATFORM_GCN
+ J2DGXColorS10(J2DGXColorS10& other) {
+ r = other.r;
+ g = other.g;
+ b = other.b;
+ a = other.a;
+ }
+
+ J2DGXColorS10(GXColorS10& other) {
+ r = other.r;
+ g = other.g;
+ b = other.b;
+ a = other.a;
+ }
+#else
J2DGXColorS10(const J2DGXColorS10& other) {
r = other.r;
g = other.g;
b = other.b;
a = other.a;
}
+
J2DGXColorS10(const GXColorS10& other) {
r = other.r;
g = other.g;
b = other.b;
a = other.a;
}
-
+#endif
+
J2DGXColorS10& operator=(const GXColorS10& other) {
r = other.r;
g = other.g;
diff --git a/include/JSystem/J3DGraphBase/J3DMatBlock.h b/include/JSystem/J3DGraphBase/J3DMatBlock.h
index 9b515bca6c..ee13669988 100644
--- a/include/JSystem/J3DGraphBase/J3DMatBlock.h
+++ b/include/JSystem/J3DGraphBase/J3DMatBlock.h
@@ -13,8 +13,16 @@
*/
struct J3DGXColorS10 : public GXColorS10 {
J3DGXColorS10() {}
+
+#if PLATFORM_GCN
+ J3DGXColorS10(J3DGXColorS10& other) { __memcpy(this, &other, sizeof(J3DGXColorS10)); }
+#else
J3DGXColorS10(J3DGXColorS10 const& other) { __memcpy(this, &other, sizeof(J3DGXColorS10)); }
+#endif
+
+ // TODO: In theory, this copy ctor should be non-const in GCN versions, as seen in TWW maps
J3DGXColorS10(GXColorS10 const& color) : GXColorS10(color) {}
+
J3DGXColorS10& operator=(const GXColorS10& color) {
// FAKE match. __memcpy created issues in J3DTevBlockPatched::initialize
((u32*)this)[0] = ((u32*)&color)[0];
@@ -29,8 +37,10 @@ struct J3DGXColorS10 : public GXColorS10 {
*/
struct J3DGXColor : public GXColor {
J3DGXColor() {}
+ // TODO: In theory, these copy ctors should be non-const in GCN versions, as seen in TWW maps
J3DGXColor(J3DGXColor const& other) { __memcpy(this, &other, sizeof(J3DGXColor)); }
J3DGXColor(GXColor const& color) : GXColor(color) {}
+
// making color a reference breaks J3DColorBlockLightOff::initialize et al
J3DGXColor& operator=(GXColor color) {
*(GXColor*)this = color;
diff --git a/include/JSystem/JUtility/JUTTexture.h b/include/JSystem/JUtility/JUTTexture.h
index bef9e604c3..6c28534685 100644
--- a/include/JSystem/JUtility/JUTTexture.h
+++ b/include/JSystem/JUtility/JUTTexture.h
@@ -71,6 +71,7 @@ public:
const ResTIMG* getTexInfo() const { return mTexInfo; }
s32 getFormat() const { return mTexInfo->format; }
s32 getTransparency() { return mTexInfo->alphaEnabled; }
+ s32 getTransparency() const { return mTexInfo->alphaEnabled; }
s32 getWidth() const { return mTexInfo->width; }
s32 getHeight() const { return mTexInfo->height; }
void setCaptureFlag(bool flag) { mFlags &= 2 | flag; }