summaryrefslogtreecommitdiff
path: root/include/JSystem/J2DGraph
diff options
context:
space:
mode:
authorhatal175 <hatal175@users.noreply.github.com>2023-08-01 10:17:21 +0300
committerGitHub <noreply@github.com>2023-08-01 00:17:21 -0700
commit2275eb710b4b0794f198059a7fd61db7499941ff (patch)
treee4bb01dce37d78a88657b0240a247febbfa14c24 /include/JSystem/J2DGraph
parent396449b597bef772b4a79ef173671100e32ad5c1 (diff)
Work on J2DMaterialFactory (#394)
* Work on J2DMaterialFactory * J3DUClipper OK * Work on JAISoundStarter * JAISoundHandles OK * JAISoundInfo OK * Fix JAISound::isStopping * Work on J2DTextBoxEx * dspproc OK * osdsp OK * osdsp_task OK * Work on dsptask * Import some JASCalc code * JASCallback OK * JASOscillator OK * JASLfo OK
Diffstat (limited to 'include/JSystem/J2DGraph')
-rw-r--r--include/JSystem/J2DGraph/J2DMatBlock.h86
-rw-r--r--include/JSystem/J2DGraph/J2DMaterialFactory.h135
-rw-r--r--include/JSystem/J2DGraph/J2DTevs.h73
3 files changed, 235 insertions, 59 deletions
diff --git a/include/JSystem/J2DGraph/J2DMatBlock.h b/include/JSystem/J2DGraph/J2DMatBlock.h
index 5473a3a0c1..b495a44792 100644
--- a/include/JSystem/J2DGraph/J2DMatBlock.h
+++ b/include/JSystem/J2DGraph/J2DMatBlock.h
@@ -15,17 +15,27 @@ struct ResTIMG;
struct ResTLUT;
struct J2DGXColorS10 : public GXColorS10 {
- /* 802F1B90 */ J2DGXColorS10();
-
- /*
- J2DGXColorS10& operator=(const GXColorS10& other) {
+ /* 802F1B90 */ J2DGXColorS10() {}
+ J2DGXColorS10(const J2DGXColorS10& other) {
r = other.r;
g = other.g;
b = other.b;
a = other.a;
- return *this;
}
- */
+ J2DGXColorS10(const GXColorS10& other) {
+ r = other.r;
+ g = other.g;
+ b = other.b;
+ a = other.a;
+ }
+
+ // J2DGXColorS10& operator=(const GXColorS10& other) {
+ // r = other.r;
+ // g = other.g;
+ // b = other.b;
+ // a = other.a;
+ // return *this;
+ // }
};
struct J2DTevSwapModeInfo;
@@ -36,11 +46,11 @@ public:
/* 802EB1D0 */ virtual void setGX();
/* 802F2A44 */ virtual void loadTexture(_GXTexMapID, u32);
virtual u32 getType() = 0;
- virtual s32 getMaxStage() = 0;
+ virtual u8 getMaxStage() = 0;
/* 802EB1DC */ virtual void setTexNo(u32, u16);
/* 802EA170 */ virtual u32 getTexNo(u32) const;
/* 802F2A48 */ virtual void setFontNo(u16);
- /* 802EA164 */ virtual u32 getFontNo() const;
+ /* 802EA164 */ virtual u16 getFontNo() const;
/* 802F2A4C */ virtual void setTevOrder(u32, J2DTevOrder);
/* 802EA144 */ virtual J2DTevOrder* getTevOrder(u32);
/* 802EB1D8 */ virtual void setTevColor(u32, J2DGXColorS10);
@@ -87,11 +97,11 @@ public:
/* 802EC328 */ virtual void setGX();
/* 802EC570 */ virtual void loadTexture(_GXTexMapID, u32);
/* 802F27A0 */ virtual u32 getType();
- /* 802F27AC */ virtual s32 getMaxStage();
+ /* 802F27AC */ virtual u8 getMaxStage();
/* 802F27B4 */ virtual void setTexNo(u32, u16);
/* 802F27C4 */ virtual u32 getTexNo(u32) const;
/* 802F27D4 */ virtual void setFontNo(u16);
- /* 802F27DC */ virtual u32 getFontNo() const;
+ /* 802F27DC */ virtual u16 getFontNo() const;
/* 802F27E4 */ virtual void setTevOrder(u32, J2DTevOrder);
/* 802F2808 */ virtual J2DTevOrder* getTevOrder(u32);
/* 802F281C */ virtual void setTevColor(u32, J2DGXColorS10);
@@ -154,11 +164,11 @@ public:
/* 802ED584 */ virtual void setGX();
/* 802ED874 */ virtual void loadTexture(_GXTexMapID, u32);
/* 802F24FC */ virtual u32 getType();
- /* 802F2508 */ virtual s32 getMaxStage();
+ /* 802F2508 */ virtual u8 getMaxStage();
/* 802F2510 */ virtual void setTexNo(u32, u16);
/* 802F2520 */ virtual u32 getTexNo(u32) const;
/* 802F2530 */ virtual void setFontNo(u16);
- /* 802F2538 */ virtual u32 getFontNo() const;
+ /* 802F2538 */ virtual u16 getFontNo() const;
/* 802F2540 */ virtual void setTevOrder(u32, J2DTevOrder);
/* 802F2564 */ virtual J2DTevOrder* getTevOrder(u32);
/* 802F2578 */ virtual void setTevColor(u32, J2DGXColorS10);
@@ -223,11 +233,11 @@ public:
/* 802EEA2C */ virtual void setGX();
/* 802EED1C */ virtual void loadTexture(_GXTexMapID, u32);
/* 802F2258 */ virtual u32 getType();
- /* 802F2264 */ virtual s32 getMaxStage();
+ /* 802F2264 */ virtual u8 getMaxStage();
/* 802F226C */ virtual void setTexNo(u32, u16);
/* 802F227C */ virtual u32 getTexNo(u32) const;
/* 802F228C */ virtual void setFontNo(u16);
- /* 802F2294 */ virtual u32 getFontNo() const;
+ /* 802F2294 */ virtual u16 getFontNo() const;
/* 802F229C */ virtual void setTevOrder(u32, J2DTevOrder);
/* 802F22C0 */ virtual J2DTevOrder* getTevOrder(u32);
/* 802F22D4 */ virtual void setTevColor(u32, J2DGXColorS10);
@@ -292,11 +302,11 @@ public:
/* 802EFEAC */ virtual void setGX();
/* 802F019C */ virtual void loadTexture(_GXTexMapID, u32);
/* 802F1FB8 */ virtual u32 getType();
- /* 802F1FC4 */ virtual s32 getMaxStage();
+ /* 802F1FC4 */ virtual u8 getMaxStage();
/* 802F1FCC */ virtual void setTexNo(u32, u16);
/* 802F1FDC */ virtual u32 getTexNo(u32) const;
/* 802F1FEC */ virtual void setFontNo(u16);
- /* 802F1FF4 */ virtual u32 getFontNo() const;
+ /* 802F1FF4 */ virtual u16 getFontNo() const;
/* 802F1FFC */ virtual void setTevOrder(u32, J2DTevOrder);
/* 802F2020 */ virtual J2DTevOrder* getTevOrder(u32);
/* 802F2034 */ virtual void setTevColor(u32, J2DGXColorS10);
@@ -362,11 +372,11 @@ public:
/* 802F132C */ virtual void setGX();
/* 802F161C */ virtual void loadTexture(_GXTexMapID, u32);
/* 802F1D18 */ virtual u32 getType();
- /* 802F1D24 */ virtual s32 getMaxStage();
+ /* 802F1D24 */ virtual u8 getMaxStage();
/* 802F1D2C */ virtual void setTexNo(u32, u16);
/* 802F1D3C */ virtual u32 getTexNo(u32) const;
/* 802F1D4C */ virtual void setFontNo(u16);
- /* 802F1D54 */ virtual u32 getFontNo() const;
+ /* 802F1D54 */ virtual u16 getFontNo() const;
/* 802F1D5C */ virtual void setTevOrder(u32, J2DTevOrder);
/* 802F1D80 */ virtual J2DTevOrder* getTevOrder(u32);
/* 802F1D94 */ virtual void setTevColor(u32, J2DGXColorS10);
@@ -424,14 +434,34 @@ public:
/* 0x1B1 */ bool mFontUndeleteFlag;
}; // Size: 0x1B4
+struct J2DAlphaCompInfo {
+ /* 0x0 */ u8 field_0x0;
+ /* 0x1 */ u8 field_0x1;
+ /* 0x2 */ u8 mRef0;
+ /* 0x3 */ u8 mRef1;
+ /* 0x4 */ u8 field_0x4;
+ /* 0x5 */ u8 field_0x5;
+ /* 0x6 */ u8 field_0x6;
+ /* 0x7 */ u8 field_0x7;
+};
+
extern u16 j2dDefaultAlphaCmp;
+inline u16 J2DCalcAlphaCmp(s32 param_1, u32 param_2, u32 param_3) {
+ return ((param_1) << 5) | ((param_2 & 0xff) << 3) | (param_3 & 0xff);
+}
+
struct J2DAlphaComp {
J2DAlphaComp() {
mAlphaCmp = j2dDefaultAlphaCmp;
mRef0 = 0;
mRef1 = 0;
}
+ J2DAlphaComp(const J2DAlphaCompInfo& info) {
+ mAlphaCmp = J2DCalcAlphaCmp(info.field_0x0, info.mRef0, info.mRef1);
+ mRef0 = info.field_0x1;
+ mRef1 = info.field_0x4;
+ }
u8 getComp0() { return mAlphaCmp >> 5 & 7; }
u8 getRef0() { return mRef0; }
u8 getOp() { return mAlphaCmp >> 3 & 3; }
@@ -461,6 +491,7 @@ extern J2DBlendInfo j2dDefaultBlendInfo;
struct J2DBlend {
J2DBlend() { mBlendInfo = j2dDefaultBlendInfo; }
+ J2DBlend(const J2DBlendInfo& info) { mBlendInfo = info; }
void setBlendInfo(const J2DBlendInfo& info) { mBlendInfo = info; }
u8 getType() { return mBlendInfo.mType; }
u8 getSrcFactor() { return mBlendInfo.mSrcFactor; }
@@ -476,6 +507,9 @@ public:
/* 802F17FC */ void initialize();
/* 802F1840 */ void setGX();
+ void setAlphaComp(J2DAlphaComp comp) { mAlphaComp = comp; }
+ void setBlend(J2DBlend blend) { mBlend = blend; }
+ void setDither(u8 dither) { mDither = dither; }
private:
/* 0x0 */ J2DAlphaComp mAlphaComp;
@@ -547,6 +581,9 @@ public:
/* 802EB7E0 */ void getTexMtx(u32, J2DTexMtx&);
u32 getTexGenNum() const { return mTexGenNum; }
+ void setTexGenNum(u32 num) { mTexGenNum = num; }
+ void setTexCoord(u32 i, J2DTexCoord coord) { mTexGenCoord[i] = coord; }
+ void setTexMtx(u32 i, J2DTexMtx* mtx) { mTexMtx[i] = mtx; }
/* 802EB620 */ virtual ~J2DTexGenBlock();
}; // Size: 0x48
@@ -554,13 +591,21 @@ public:
struct J2DColorChanInfo {
/* 0x0 */ u8 field_0x0;
/* 0x0 */ u8 field_0x1;
+ /* 0x0 */ u8 field_0x2;
+ /* 0x0 */ u8 field_0x3;
};
inline u8 J2DCalcColorChanID(u8 param_1) { return param_1; }
+extern J2DColorChanInfo j2dDefaultColorChanInfo;
class J2DColorChan {
public:
- /* 802EB280 */ J2DColorChan();
+ /* 802EB280 */ J2DColorChan() {
+ setColorChanInfo(j2dDefaultColorChanInfo);
+ }
+ J2DColorChan(const J2DColorChanInfo& info) {
+ mColorChan = J2DCalcColorChanID(info.field_0x1);
+ }
void setColorChanInfo(const J2DColorChanInfo& info) {
mColorChan = J2DCalcColorChanID(info.field_0x1);
@@ -589,6 +634,9 @@ public:
JUtility::TColor* getMatColor(u32 i) { return &mMatColor[i]; }
J2DColorChan* getColorChan(u32 i) { return &mColorChan[i]; }
void setCullMode(u8 mode) { mCullMode = mode; }
+ void setColorChanNum(u8 num) { mColorChanNum = num; }
+ void setMatColor(u32 i, JUtility::TColor color) { mMatColor[i] = color; }
+ void setColorChan(u32 i, const J2DColorChan& color) { mColorChan[i] = color; }
};
#endif /* J2DMATBLOCK_H */
diff --git a/include/JSystem/J2DGraph/J2DMaterialFactory.h b/include/JSystem/J2DGraph/J2DMaterialFactory.h
index 719333b51c..48b68363f8 100644
--- a/include/JSystem/J2DGraph/J2DMaterialFactory.h
+++ b/include/JSystem/J2DGraph/J2DMaterialFactory.h
@@ -2,19 +2,85 @@
#define J2DMATERIALFACTORY_H
#include "JSystem/J2DGraph/J2DManage.h"
+#include "JSystem/J2DGraph/J2DMatBlock.h"
#include "dolphin/gx/GXEnum.h"
#include "dolphin/types.h"
-struct J2DMaterialBlock {};
+struct J2DMaterialBlock {
+ u32 field_0x0;
+ u32 field_0x4;
+ u16 field_0x8;
+ u16 field_0xa;
+ u32 field_0xc;
+ u32 field_0x10;
+ u32 field_0x14;
+ u32 field_0x18;
+ u32 field_0x1c;
+ u32 field_0x20;
+ u32 field_0x24;
+ u32 field_0x28;
+ u32 field_0x2c;
+ u32 field_0x30;
+ u32 field_0x34;
+ u32 field_0x38;
+ u32 field_0x3c;
+ u32 field_0x40;
+ u32 field_0x44;
+ u32 field_0x48;
+ u32 field_0x4c;
+ u32 field_0x50;
+ u32 field_0x54;
+ u32 field_0x58;
+ u32 field_0x5c;
+ u32 field_0x60;
+ u32 field_0x64;
+};
typedef struct _GXColor GXColor;
typedef struct _GXColorS10 GXColorS10;
struct J2DAlphaCompInfo;
struct J2DBlendInfo;
struct J2DColorChanInfo;
-struct J2DIndInitData;
class J2DMaterial;
-struct J2DMaterialInitData;
+
+struct J2DIndInitData {
+ u8 field_0x0;
+ u8 field_0x1;
+ u8 field_0x2[2];
+ J2DIndTexOrderInfo field_0x4[4];
+ J2DIndTexMtxInfo field_0xc[3];
+ J2DIndTexCoordScaleInfo field_0x60[4];
+ J2DIndTevStageInfo field_0x68[4];
+ u8 field_0xac[0x90];
+};
+
+struct J2DMaterialInitData {
+ u8 field_0x0;
+ u8 field_0x1;
+ u8 field_0x2;
+ u8 field_0x3;
+ u8 field_0x4;
+ u8 field_0x5;
+ u8 field_0x6;
+ u8 field_0x7;
+ u16 field_0x8[2];
+ u16 field_0xc[4];
+ u16 field_0x14[8];
+ u16 field_0x24[0xa];
+ u16 field_0x38[8];
+ u16 field_0x48;
+ u16 field_0x4a[4];
+ u8 field_0x52[0x10];
+ u8 field_0x62[0x10];
+ u16 field_0x72[0x10];
+ u16 field_0x92[0x4];
+ u16 field_0x9a[0x10];
+ u16 field_0xba[0x10];
+ u16 field_0xda[0x4];
+ u16 field_0xe2;
+ u16 field_0xe4;
+ u16 field_0xe6;
+};
struct J2DTevStageInfo;
struct J2DTevSwapModeTableInfo;
struct J2DTevSwapModeInfo;
@@ -26,35 +92,44 @@ class JKRArchive;
class J2DMaterialFactory {
public:
/* 802F2AD0 */ J2DMaterialFactory(J2DMaterialBlock const&);
- /* 802F2C94 */ void countStages(int) const;
- /* 802F2D1C */ void create(J2DMaterial*, int, u32, J2DResReference*, J2DResReference*,
+ /* 802F2C94 */ u32 countStages(int) const;
+ /* 802F2D1C */ J2DMaterial* create(J2DMaterial*, int, u32, J2DResReference*, J2DResReference*,
JKRArchive*) const;
- /* 802F362C */ void newMatColor(int, int) const;
- /* 802F36CC */ void newColorChanNum(int) const;
- /* 802F3704 */ void newColorChan(int, int) const;
- /* 802F3758 */ void newTexGenNum(int) const;
- /* 802F3790 */ void newTexCoord(int, int) const;
- /* 802F3804 */ void newTexMtx(int, int) const;
- /* 802F38E0 */ void newCullMode(int) const;
- /* 802F3920 */ void newTexNo(int, int) const;
- /* 802F3968 */ void newFontNo(int) const;
- /* 802F39A8 */ void newTevOrder(int, int) const;
- /* 802F3A1C */ void newTevColor(int, int) const;
- /* 802F3AB4 */ void newTevKColor(int, int) const;
- /* 802F3B54 */ void newTevStageNum(int) const;
- /* 802F3B8C */ void newTevStage(int, int) const;
- /* 802F3BEC */ void newTevSwapModeTable(int, int) const;
- /* 802F3C88 */ void newIndTexStageNum(int) const;
- /* 802F3CB8 */ void newIndTexOrder(int, int) const;
- /* 802F3D20 */ void newIndTexMtx(int, int) const;
- /* 802F3E24 */ void newIndTevStage(int, int) const;
- /* 802F3F78 */ void newIndTexCoordScale(int, int) const;
- /* 802F3FE0 */ void newAlphaComp(int) const;
- /* 802F405C */ void newBlend(int) const;
- /* 802F40D8 */ void newDither(int) const;
+ /* 802F362C */ JUtility::TColor newMatColor(int, int) const;
+ /* 802F36CC */ u8 newColorChanNum(int) const;
+ /* 802F3704 */ J2DColorChan newColorChan(int, int) const;
+ /* 802F3758 */ u32 newTexGenNum(int) const;
+ /* 802F3790 */ J2DTexCoord newTexCoord(int, int) const;
+ /* 802F3804 */ J2DTexMtx* newTexMtx(int, int) const;
+ /* 802F38E0 */ u8 newCullMode(int) const;
+ /* 802F3920 */ u16 newTexNo(int, int) const;
+ /* 802F3968 */ u16 newFontNo(int) const;
+ /* 802F39A8 */ J2DTevOrder newTevOrder(int, int) const;
+ /* 802F3A1C */ J2DGXColorS10 newTevColor(int, int) const;
+ /* 802F3AB4 */ JUtility::TColor newTevKColor(int, int) const;
+ /* 802F3B54 */ u8 newTevStageNum(int) const;
+ /* 802F3B8C */ J2DTevStage newTevStage(int, int) const;
+ /* 802F3BEC */ J2DTevSwapModeTable newTevSwapModeTable(int, int) const;
+ /* 802F3C88 */ u8 newIndTexStageNum(int) const;
+ /* 802F3CB8 */ J2DIndTexOrder newIndTexOrder(int, int) const;
+ /* 802F3D20 */ J2DIndTexMtx newIndTexMtx(int, int) const;
+ /* 802F3E24 */ J2DIndTevStage newIndTevStage(int, int) const;
+ /* 802F3F78 */ J2DIndTexCoordScale newIndTexCoordScale(int, int) const;
+ /* 802F3FE0 */ J2DAlphaComp newAlphaComp(int) const;
+ /* 802F405C */ J2DBlend newBlend(int) const;
+ /* 802F40D8 */ u8 newDither(int) const;
+
+ u32 getMaterialMode(int idx) const {
+ return field_0x4[field_0x8[idx]].field_0x0;
+ }
+
+ u8 getMaterialAlphaCalc(int idx) const {
+ return field_0x4[field_0x8[idx]].field_0x6;
+ }
private:
- /* 0x00 */ int field_0x0;
+ /* 0x00 */ u16 field_0x0;
+ /* 0x02 */ u16 field_0x2;
/* 0x04 */ J2DMaterialInitData* field_0x4;
/* 0x08 */ u16* field_0x8;
/* 0x0C */ J2DIndInitData* field_0xc;
@@ -68,7 +143,7 @@ private:
/* 0x2C */ u16* field_0x2c;
/* 0x30 */ _GXCullMode* field_0x30;
/* 0x34 */ J2DTevOrderInfo* field_0x34;
- /* 0x38 */ GXColorS10* field_0x38;
+ /* 0x38 */ J2DGXColorS10* field_0x38;
/* 0x3C */ GXColor* field_0x3c;
/* 0x40 */ u8* field_0x40;
/* 0x44 */ J2DTevStageInfo* field_0x44;
diff --git a/include/JSystem/J2DGraph/J2DTevs.h b/include/JSystem/J2DGraph/J2DTevs.h
index 1fdcc0c0f9..9bf56f924e 100644
--- a/include/JSystem/J2DGraph/J2DTevs.h
+++ b/include/JSystem/J2DGraph/J2DTevs.h
@@ -65,9 +65,16 @@ struct J2DIndTexOrderInfo {
GXTexMapID getTexMapID() const { return (GXTexMapID)mTexMapID; }
};
+extern const J2DIndTexOrderInfo j2dDefaultIndTexOrderNull;
+
class J2DIndTexOrder {
public:
- /* 802EB378 */ J2DIndTexOrder();
+ /* 802EB378 */ J2DIndTexOrder() {
+ mInfo = j2dDefaultIndTexOrderNull;
+ }
+ J2DIndTexOrder(const J2DIndTexOrderInfo& info) {
+ mInfo = info;
+ }
/* 802EA0FC */ void load(u8);
private:
@@ -89,10 +96,17 @@ struct J2DIndTexMtxInfo {
}
};
+extern J2DIndTexMtxInfo const j2dDefaultIndTexMtxInfo;
+
class J2DIndTexMtx {
public:
- /* 802EB2E4 */ ~J2DIndTexMtx();
- /* 802EB320 */ J2DIndTexMtx();
+ /* 802EB2E4 */ ~J2DIndTexMtx() {}
+ /* 802EB320 */ J2DIndTexMtx() {
+ mIndTexMtxInfo = j2dDefaultIndTexMtxInfo;
+ }
+ J2DIndTexMtx(const J2DIndTexMtxInfo& info) {
+ mIndTexMtxInfo = info;
+ }
/* 802EA098 */ void load(u8);
/* 802E9C90 */ void load(u32);
/* 802E9CC4 */ void calc();
@@ -114,10 +128,17 @@ struct J2DIndTexCoordScaleInfo {
GXIndTexScale getScaleT() const { return (GXIndTexScale)mScaleT; }
};
+extern const J2DIndTexCoordScaleInfo j2dDefaultIndTexCoordScaleInfo;
+
class J2DIndTexCoordScale {
public:
- /* 802EB290 */ ~J2DIndTexCoordScale();
- /* 802EB2CC */ J2DIndTexCoordScale();
+ /* 802EB290 */ ~J2DIndTexCoordScale() {}
+ /* 802EB2CC */ J2DIndTexCoordScale() {
+ mInfo = j2dDefaultIndTexCoordScaleInfo;
+ }
+ J2DIndTexCoordScale(const J2DIndTexCoordScaleInfo& info) {
+ mInfo = info;
+ }
/* 802EA0CC */ void load(u8);
private:
@@ -133,19 +154,29 @@ struct J2DIndTevStageInfo {
/* 0x5 */ u8 field_0x5;
/* 0x6 */ u8 field_0x6;
/* 0x7 */ u8 field_0x7;
- /* 0x8 */ int field_0x8;
+ /* 0x8 */ u8 field_0x8;
+ /* 0x9 */ u8 field_0x9;
+ /* 0xa */ u8 field_0xa;
+ /* 0xb */ u8 field_0xb;
};
inline u32 J2DCalcIndTevStage(J2DIndTevStageInfo info) {
return (info.field_0x8 << 22) | (info.field_0x7 << 21) | (info.field_0x6 << 20) |
(info.field_0x3 << 16) | (info.field_0x5 << 11) | (info.field_0x4 << 8) |
- (info.field_0x2 << 4) | (info.field_0x1 << 2) | info.field_0x0;
+ (info.field_0x2 << 4) | (info.field_0x1 << 2) | (info.field_0x0);
}
+extern const J2DIndTevStageInfo j2dDefaultIndTevStageInfo;
+
class J2DIndTevStage {
public:
/* 802EA044 */ void load(u8);
- /* 802F18A0 */ J2DIndTevStage();
+ /* 802F18A0 */ J2DIndTevStage() {
+ mFlags = J2DCalcIndTevStage(j2dDefaultIndTevStageInfo);
+ }
+ J2DIndTevStage(const J2DIndTevStageInfo& info) {
+ mFlags = J2DCalcIndTevStage(info);
+ }
void setIndTevStageInfo(const J2DIndTevStageInfo& info) { mFlags = J2DCalcIndTevStage(info); }
@@ -177,9 +208,17 @@ struct J2DTexCoordInfo {
}
};
+extern J2DTexCoordInfo const j2dDefaultTexCoordInfo[8];
+
class J2DTexCoord {
public:
- /* 802EB260 */ J2DTexCoord();
+ /* 802EB260 */ inline J2DTexCoord() {
+ *(J2DTexCoordInfo*)this = j2dDefaultTexCoordInfo[0];
+ }
+
+ J2DTexCoord(const J2DTexCoordInfo& info) {
+ *(J2DTexCoordInfo*)this = info;
+ }
void setTexCoordInfo(const J2DTexCoordInfo& info) { mTexCoordInfo = info; }
s32 getTexGenType() { return mTexCoordInfo.mTexGenType; }
s32 getTexGenSrc() { return mTexCoordInfo.mTexGenSrc; }
@@ -203,9 +242,17 @@ struct J2DTevOrderInfo {
}
};
+extern J2DTevOrderInfo j2dDefaultTevOrderInfoNull;
+
class J2DTevOrder {
public:
- /* 802F1B70 */ J2DTevOrder();
+ /* 802F1B70 */ J2DTevOrder() {
+ mTevOrderInfo = j2dDefaultTevOrderInfoNull;
+ }
+
+ J2DTevOrder(const J2DTevOrderInfo& info) {
+ *(J2DTevOrderInfo*)this = info;
+ }
void setTevOrderInfo(const J2DTevOrderInfo& info) {mTevOrderInfo = info; }
GXChannelID getColor() const { return (GXChannelID)mTevOrderInfo.mColor; }
@@ -235,6 +282,7 @@ struct J2DTevStageInfo {
/* 0x10 */ u8 field_0x10;
/* 0x11 */ u8 field_0x11;
/* 0x12 */ u8 field_0x12;
+ /* 0x13 */ u8 field_0x13;
};
struct J2DTevSwapModeInfo {
@@ -384,9 +432,14 @@ inline u8 J2DCalcTevSwapTable(u8 param_0, u8 param_1, u8 param_2, u8 param_3) {
return (param_0 << 6) + (param_1 << 4) + (param_2 << 2) + param_3;
}
+extern const J2DTevSwapModeTableInfo j2dDefaultTevSwapModeTable;
+
class J2DTevSwapModeTable {
public:
/* 802F1934 */ J2DTevSwapModeTable();
+ J2DTevSwapModeTable(const J2DTevSwapModeTableInfo& info) {
+ field_0x0 = J2DCalcTevSwapTable(info.field_0x0, info.field_0x1, info.field_0x2, info.field_0x3);
+ }
void setTevSwapModeTableInfo(const J2DTevSwapModeTableInfo& info) {
field_0x0 = J2DCalcTevSwapTable(info.field_0x0, info.field_0x1, info.field_0x2, info.field_0x3);