diff options
| author | TakaRikka <38417346+TakaRikka@users.noreply.github.com> | 2021-10-11 09:38:53 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-11 18:38:53 +0200 |
| commit | a2636e84c3eefa98ad8a24dbb5398b664f3d732a (patch) | |
| tree | 2d2dd404de4364097f3490c77dfc8167e420da5e /include | |
| parent | 5084413cb7c8869a866ed552070369b1aadc748f (diff) | |
J3D setup (#155)
* setup j3d classes
* remove asm
* fixes
* fix newDifferedDisplayList
Diffstat (limited to 'include')
39 files changed, 2361 insertions, 220 deletions
diff --git a/include/JSystem/J3DGraphAnimator/J3DAnimation.h b/include/JSystem/J3DGraphAnimator/J3DAnimation.h index b11537f09f..bff2b307ae 100644 --- a/include/JSystem/J3DGraphAnimator/J3DAnimation.h +++ b/include/JSystem/J3DGraphAnimator/J3DAnimation.h @@ -1,8 +1,295 @@ #ifndef J3DANIMATION_H #define J3DANIMATION_H +#include "JSystem/J3DGraphAnimator/J3DMaterialAttach.h" +#include "JSystem/J3DGraphAnimator/J3DModelData.h" +#include "dolphin/gx/GXTexture.h" #include "dolphin/types.h" +class J3DAnmBase { +public: + virtual ~J3DAnmBase(); + + u8 getAttribute() const { return mAttribute; } + s16 getFrameMax() const { return mFrameMax; } + f32 getFrame() const { return mFrame; } + void setFrame(f32 frame) { mFrame = frame; } + +private: + /* 0x4 */ u8 mAttribute; + /* 0x6 */ s16 mFrameMax; + /* 0x8 */ f32 mFrame; +}; // Size: 0xC + +class J3DAnmTransform : public J3DAnmBase { +public: + /* 80328E40 */ J3DAnmTransform(s16, f32*, s16*, f32*); + + /* 8003B93C */ virtual ~J3DAnmTransform(); + /* 8003C77C */ virtual s32 getKind() const; + virtual void getTransform(u16, J3DTransformInfo*) const = 0; + +private: + /* 0x0C */ f32* field_0xc; + /* 0x10 */ s16* field_0x10; + /* 0x14 */ f32* field_0x14; + /* 0x18 */ s16 field_0x18; + /* 0x1A */ s16 field_0x1a; + /* 0x1C */ s16 field_0x1c; + /* 0x1E */ s16 field_0x1e; +}; // Size: 0x20 + +class J3DAnmTransformKey : public J3DAnmTransform { + /* 80329A34 */ void calcTransform(f32, u16, J3DTransformInfo*) const; + + /* 8003B8D0 */ virtual ~J3DAnmTransformKey(); + /* 8003C800 */ virtual s32 getKind() const; + /* 8003C808 */ virtual void getTransform(u16, J3DTransformInfo*) const; + +private: + /* 0x20 */ int field_0x20; + /* 0x24 */ int field_0x24; +}; // Size: 0x28 + +class J3DAnmTransformFull : public J3DAnmTransform { + /* 8032C2AC */ virtual ~J3DAnmTransformFull(); + /* 8032C318 */ virtual s32 getKind() const; + /* 80328E90 */ virtual void getTransform(u16, J3DTransformInfo*) const; + +private: + /* 0x20 */ int field_0x20; +}; // Size: 0x24 + +class J3DAnmTransformFullWithLerp : public J3DAnmTransformFull { + /* 8032C228 */ virtual ~J3DAnmTransformFullWithLerp(); + /* 8032C2A4 */ virtual s32 getKind() const; + /* 803291F0 */ virtual void getTransform(u16, J3DTransformInfo*) const; +}; // Size: 0x24 + +struct J3DTextureSRTInfo; +struct J3DModelData; +struct J3DMaterialTable; +struct J3DAnmKeyTableBase {}; + +class J3DAnmTextureSRTKey : public J3DAnmBase { +public: + /* 80329E5C */ J3DAnmTextureSRTKey(); + /* 80329F14 */ void calcTransform(f32, u16, J3DTextureSRTInfo*) const; + /* 8032B0C0 */ void searchUpdateMaterialID(J3DMaterialTable*); + /* 8032B1D4 */ void searchUpdateMaterialID(J3DModelData*); + + /* 8032C198 */ virtual ~J3DAnmTextureSRTKey(); + /* 8032C220 */ virtual s32 getKind() const; + + void getTransform(u16 param_0, J3DTextureSRTInfo* pSRTInfo) const { + calcTransform(getFrame(), param_0, pSRTInfo); + } + +private: + /* 0x0C */ int field_0xc; + /* 0x10 */ int field_0x10; + /* 0x14 */ u16 field_0x14; + /* 0x16 */ u16 field_0x16; + /* 0x18 */ u16 field_0x18; + /* 0x1A */ u16 field_0x1a; + /* 0x1C */ int field_0x1c; + /* 0x20 */ int field_0x20; + /* 0x24 */ int field_0x24; + /* 0x28 */ u8 mUpdateTexMtxID[4]; + /* 0x2C */ u16 mUpdateMaterialID[2]; + /* 0x30 */ JUTNameTab field_0x30; + /* 0x40 */ int field_0x40; + /* 0x44 */ u16 field_0x44; + /* 0x46 */ u16 field_0x46; + /* 0x48 */ u16 field_0x48; + /* 0x4A */ u16 field_0x4a; + /* 0x4C */ int field_0x4c; + /* 0x50 */ int field_0x50; + /* 0x54 */ int field_0x54; + /* 0x58 */ int field_0x58; + /* 0x5C */ u8 field_0x5c[4]; + /* 0x60 */ u16 field_0x60[2]; + /* 0x64 */ JUTNameTab field_0x64; + /* 0x74 */ u8 field_0x74[4]; + /* 0x78 */ u32 mTexMtxCalcType; +}; // Size: 0x7C + +class J3DAnmTexPattern : public J3DAnmBase { +public: + /* 8032AED8 */ J3DAnmTexPattern(); + /* 8032AF50 */ void getTexNo(u16, u16*) const; + /* 8032B004 */ void searchUpdateMaterialID(J3DMaterialTable*); + /* 8032B09C */ void searchUpdateMaterialID(J3DModelData*); + + /* 8032BD20 */ virtual ~J3DAnmTexPattern(); + /* 8032BD94 */ virtual s32 getKind() const; + +private: + /* 0x0C */ void* field_0xc; + /* 0x10 */ void* mAnmTable; + /* 0x14 */ u16 field_0x14; + /* 0x16 */ u16 mUpdateMaterialNum; + /* 0x18 */ void* field_0x18; + /* 0x1C */ JUTNameTab field_0x1c; +}; // Size: 0x2C + +class J3DAnmTevRegKey : public J3DAnmBase { +public: + /* 8032AE18 */ J3DAnmTevRegKey(); + /* 8032B1F8 */ void getTevColorReg(u16, _GXColorS10*) const; + /* 8032B4BC */ void getTevKonstReg(u16, _GXColor*) const; + /* 8032B780 */ void searchUpdateMaterialID(J3DMaterialTable*); + /* 8032B87C */ void searchUpdateMaterialID(J3DModelData*); + + /* 8032BD9C */ virtual ~J3DAnmTevRegKey(); + /* 8032BE24 */ virtual s32 getKind() const; + +private: + /* 0x0C */ u16 mCRegUpdateMaterialNum; + /* 0x0E */ u16 mKRegUpdateMaterialNum; + /* 0x10 */ u16 field_0x10; + /* 0x12 */ u16 field_0x12; + /* 0x14 */ u16 field_0x14; + /* 0x16 */ u16 field_0x16; + /* 0x18 */ u16 field_0x18; + /* 0x1A */ u16 field_0x1a; + /* 0x1C */ u16 field_0x1c; + /* 0x1E */ u16 field_0x1e; + /* 0x20 */ u16 mCRegUpdateMaterialID[20]; + /* 0x34 */ u16 mKRegUpdateMaterialID[20]; + /* 0x48 */ void* field_0x48; + /* 0x4C */ void* field_0x4c; + /* 0x50 */ int field_0x50; + /* 0x54 */ int field_0x54; + /* 0x58 */ int field_0x58; + /* 0x5C */ int field_0x5c; + /* 0x60 */ int field_0x60; + /* 0x64 */ int field_0x64; + /* 0x68 */ int field_0x68; + /* 0x6C */ int field_0x6c; +}; // Size: 0x70 + +class J3DAnmColor : public J3DAnmBase { +public: + /* 8032A828 */ J3DAnmColor(); + /* 8032A8A4 */ void searchUpdateMaterialID(J3DMaterialTable*); + + /* 8032BCAC */ virtual ~J3DAnmColor(); + /* 8032BF44 */ virtual bool getKind() const; + /* 8032BF4C */ virtual void getColor(u16, _GXColor*) const; + + u16 getUpdateMaterialNum() const { return mUpdateMaterialNum; } + bool isValidUpdateMaterialID(u16 id) const { return mUpdateMaterialID[id] != 0xFFFF; } + u16 getUpdateMaterialID(u16 idx) const { return mUpdateMaterialID[idx]; } + +private: + /* 0x0C */ u16 field_0xc; + /* 0x0E */ u16 field_0xe; + /* 0x10 */ u16 field_0x10; + /* 0x12 */ u16 field_0x12; + /* 0x14 */ u16 mUpdateMaterialNum; + /* 0x18 */ u16* mUpdateMaterialID; + /* 0x1C */ JUTNameTab field_0x1c; +}; // Size: 0x2C + +class J3DAnmColorKey : public J3DAnmColor { +public: + /* 8032AB00 */ J3DAnmColorKey(); + + /* 8032BE2C */ virtual ~J3DAnmColorKey(); + /* 8032BEB0 */ virtual s32 getKind() const; + /* 8032AB54 */ virtual void getColor(u16, _GXColor*) const; + +private: + /* 0x2C */ int field_0x2c; + /* 0x30 */ int field_0x30; + /* 0x34 */ int field_0x34; + /* 0x38 */ int field_0x38; + /* 0x3C */ int field_0x3c; +}; + +class J3DAnmColorFull : public J3DAnmColor { +public: + /* 8032AB00 */ J3DAnmColorFull(); + + /* 8032BE2C */ virtual ~J3DAnmColorFull(); + /* 8032BEB0 */ virtual s32 getKind() const; + /* 8032AB54 */ virtual void getColor(u16, _GXColor*) const; + +private: + /* 0x2C */ int field_0x2c; + /* 0x30 */ int field_0x30; + /* 0x34 */ int field_0x34; + /* 0x38 */ int field_0x38; + /* 0x3C */ int field_0x3c; +}; + +class J3DAnmVtxColor : public J3DAnmBase { +public: + J3DAnmVtxColor(); + + virtual ~J3DAnmVtxColor(); + virtual s32 getKind() const; + virtual void getColor(u8, u16, _GXColor*) const; + +private: + /* 0x0C */ s16 mAnmTableNum[2]; + /* 0x10 */ int mAnmVtxColorIndexData[2]; +}; // Size: 0x18 + +class J3DAnmVtxColorKey : public J3DAnmVtxColor { +public: + /* 8032A4E0 */ J3DAnmVtxColorKey(); + + /* 8032BF50 */ virtual ~J3DAnmVtxColorKey(); + /* 8032BFBC */ virtual s32 getKind() const; + /* 8032A53C */ virtual void getColor(u8, u16, _GXColor*) const; + +private: + /* 0x18 */ int field_0x18[2]; +}; + +class J3DAnmVtxColorFull : public J3DAnmVtxColor { + /* 8032A30C */ J3DAnmVtxColorFull(); + + /* 8032BFC4 */ virtual ~J3DAnmVtxColorFull(); + /* 8032C030 */ virtual s32 getKind() const; + /* 8032A368 */ virtual void getColor(u8, u16, _GXColor*) const; + +private: + /* 0x18 */ int field_0x18[2]; +}; + +class J3DAnmCluster : public J3DAnmBase { +public: + /* 8032BCAC */ virtual ~J3DAnmCluster(); + /* 8032BF44 */ virtual s32 getKind() const; + /* 8032BF4C */ virtual void getWeight(u16) const; + +private: + /* 0x0C */ f32* field_0xc; +}; // Size: 0x10 + +class J3DAnmClusterFull : public J3DAnmCluster { +public: + /* 8032BCAC */ virtual ~J3DAnmClusterFull(); + /* 8032BF44 */ virtual s32 getKind() const; + /* 8032BF4C */ virtual void getWeight(u16) const; + +private: + /* 0x10 */ int field_0x10; +}; + +class J3DAnmClusterKey : public J3DAnmCluster { +public: + /* 8032C044 */ virtual ~J3DAnmClusterKey(); + /* 8032C0B0 */ virtual s32 getKind() const; + /* 8032A218 */ virtual void getWeight(u16) const; + +private: + /* 0x10 */ int field_0x10; +}; + class J3DFrameCtrl { public: J3DFrameCtrl() { this->init(0); } @@ -11,26 +298,25 @@ public: void update(); virtual ~J3DFrameCtrl() {} - float getRate() const { return mRate; } - void setAttribute(u8 pAttr) { mAttribute = pAttr; } - void setEnd(s16 pEnd) { mEnd = pEnd; } - void setRate(float pRate) { mRate = pRate; } - void setStart(s16 pStart) { - mStart = pStart; - mFrame = pStart; + f32 getRate() const { return mRate; } + void setAttribute(u8 attr) { mAttribute = attr; } + void setEnd(s16 end) { mEnd = end; } + void setRate(f32 rate) { mRate = rate; } + void setStart(s16 start) { + mStart = start; + mFrame = start; } - void setFrame(float pFrame) { mFrame = pFrame; } - void setLoop(s16 pLoop) { mLoop = pLoop; } - -private: - /* vtable */; - u8 mAttribute; - bool mState; - s16 mStart; - s16 mEnd; - s16 mLoop; - float mRate; - float mFrame; -}; + void setFrame(f32 frame) { mFrame = frame; } + void setLoop(s16 loop) { mLoop = loop; } + +private: + /* 0x04 */ u8 mAttribute; + /* 0x05 */ bool mState; + /* 0x06 */ s16 mStart; + /* 0x08 */ s16 mEnd; + /* 0x0A */ s16 mLoop; + /* 0x0C */ f32 mRate; + /* 0x10 */ f32 mFrame; +}; // Size: 0x14 #endif /* J3DANIMATION_H */ diff --git a/include/JSystem/J3DGraphAnimator/J3DCluster.h b/include/JSystem/J3DGraphAnimator/J3DCluster.h index 1cac7865aa..3cf06bebd9 100644 --- a/include/JSystem/J3DGraphAnimator/J3DCluster.h +++ b/include/JSystem/J3DGraphAnimator/J3DCluster.h @@ -3,4 +3,22 @@ #include "dolphin/types.h" +struct J3DDeformer; + +struct J3DCluster { + /* 0x00 */ f32 field_0x0; + /* 0x04 */ f32 field_0x4; + /* 0x08 */ int field_0x8; + /* 0x0C */ int field_0xc; + /* 0x10 */ u16 field_0x10; + /* 0x12 */ u16 field_0x12; + /* 0x14 */ u16 field_0x14; + /* 0x16 */ u16 field_0x16; + /* 0x18 */ u16 field_0x18[2]; + /* 0x1C */ int field_0x1c; + /* 0x20 */ J3DDeformer* mDeformer; +}; + +struct J3DClusterKey {}; + #endif /* J3DCLUSTER_H */ diff --git a/include/JSystem/J3DGraphAnimator/J3DJoint.h b/include/JSystem/J3DGraphAnimator/J3DJoint.h index 7fe5cc53b3..9cbf745d43 100644 --- a/include/JSystem/J3DGraphAnimator/J3DJoint.h +++ b/include/JSystem/J3DGraphAnimator/J3DJoint.h @@ -1,6 +1,87 @@ #ifndef J3DJOINT_H #define J3DJOINT_H +#include "JSystem/J3DGraphBase/J3DMaterial.h" +#include "JSystem/J3DGraphBase/J3DTransform.h" #include "dolphin/types.h" +class J3DAnmTransform; +class J3DMtxBuffer; + +class J3DMtxCalc { +public: + /* 80325D1C */ void setMtxBuffer(J3DMtxBuffer*); + + /* 8000D948 */ virtual ~J3DMtxCalc(); + /* 80014E90 */ virtual void setAnmTransform(J3DAnmTransform*); + /* 80014E9C */ virtual bool getAnmTransform(); + /* 80014E8C */ virtual void setAnmTransform(u8, J3DAnmTransform*); + /* 80014E94 */ virtual bool getAnmTransform(u8); + /* 80014EA4 */ virtual void setWeight(u8, f32); + /* 80014EA8 */ virtual void getWeight(u8) const; + virtual void init(Vec const&, Mtx*) = 0; + virtual void calc() = 0; + + static J3DMtxBuffer* getMtxBuffer() { return mMtxBuffer; } + static J3DJoint* getJoint() { return mJoint; } + + static J3DMtxBuffer* mMtxBuffer; + static J3DJoint* mJoint; +}; // Size: 0x4 + +class J3DJoint; +typedef int (*J3DJointCallBack)(J3DJoint*, int); + +class J3DJoint { +public: + /* 8032F13C */ void appendChild(J3DJoint*); + /* 8032F170 */ J3DJoint(); + /* 8032F254 */ void entryIn(); + /* 8032F3F8 */ void recursiveCalc(); + + J3DMaterial* getMesh() { return mMesh; } + u16 getJntNo() const { return mJntNo; } + u8 getScaleCompensate() const { return mScaleCompensate; } + J3DJoint* getYounger() { return mYounger; } + void setYounger(J3DJoint* pYounger) { mYounger = pYounger; } + + static J3DMtxCalc* mCurrentMtxCalc; + +private: + /* 0x00 */ void* field_0x0; + /* 0x04 */ J3DJointCallBack mCallBack; + /* 0x08 */ void* field_0x8; + /* 0x0C */ J3DJoint* mChild; + /* 0x10 */ J3DJoint* mYounger; + /* 0x14 */ u16 mJntNo; + /* 0x16 */ u8 mMtxType; + /* 0x17 */ u8 mScaleCompensate; + /* 0x18 */ J3DTransformInfo mTransformInfo; + /* 0x38 */ f32 field_0x38; + /* 0x3C */ Vec mMin; + /* 0x48 */ Vec mMax; + /* 0x54 */ J3DMtxCalc* mMtxCalc; + /* 0x58 */ J3DMaterial* mMesh; +}; // Size: 0x5C + +struct J3DMtxCalcJ3DSysInitMaya { + /* 8032ECAC */ static void init(Vec const&, f32 const (&)[3][4]); +}; + +struct J3DMtxCalcJ3DSysInitBasic { + /* 8032EC28 */ static void init(Vec const&, f32 const (&)[3][4]); +}; + +struct J3DMtxCalcCalcTransformSoftimage { + /* 8032EE50 */ static void calcTransform(J3DTransformInfo const&); +}; + +struct J3DMtxCalcCalcTransformMaya { + /* 8032EFBC */ static void calcTransform(J3DTransformInfo const&); +}; + +struct J3DMtxCalcCalcTransformBasic { + /* 8032ED30 */ static void calcTransform(J3DTransformInfo const&); +}; + #endif /* J3DJOINT_H */ diff --git a/include/JSystem/J3DGraphAnimator/J3DJointTree.h b/include/JSystem/J3DGraphAnimator/J3DJointTree.h index 9837d7d382..006c930849 100644 --- a/include/JSystem/J3DGraphAnimator/J3DJointTree.h +++ b/include/JSystem/J3DGraphAnimator/J3DJointTree.h @@ -1,6 +1,56 @@ #ifndef J3DJOINTTREE_H #define J3DJOINTTREE_H +#include "JSystem/J3DGraphAnimator/J3DJoint.h" +#include "JSystem/JUtility/JUTNameTab.h" +#include "dolphin/mtx/mtxvec.h" #include "dolphin/types.h" +struct J3DModelHierarchy {}; +struct J3DMaterialTable; + +struct J3DDrawMtxData { + /* 803115E0 */ J3DDrawMtxData(); + /* 803115F4 */ ~J3DDrawMtxData(); + + /* 0x0 */ u16 mEntryNum; + /* 0x2 */ u16 mDrawFullWgtMtxNum; + /* 0x4 */ u8* mDrawMtxFlag; + /* 0x8 */ u16* mDrawMtxIndex; +}; // Size: 0xC + +class J3DShapeTable; + +class J3DJointTree { +public: + /* 80325A18 */ J3DJointTree(); + /* 80325A9C */ void makeHierarchy(J3DJoint*, J3DModelHierarchy const**, J3DMaterialTable*, + J3DShapeTable*); + /* 80325C00 */ void findImportantMtxIndex(); + + /* 80325CAC */ virtual void calc(J3DMtxBuffer*, Vec const&, f32 const (&)[3][4]); + /* 80325D24 */ virtual ~J3DJointTree(); + + u16 getWEvlpMtxNum() const { return mWEvlpMtxNum; } + J3DJoint* getJointNodePointer(u16 idx) const { return mJointNodePointer[idx]; } + +private: + /* 0x04 */ J3DModelHierarchy* mHierarchy; + /* 0x08 */ u32 mFlags; + /* 0x0C */ u32 mModelDataType; + /* 0x10 */ J3DJoint* mRootNode; + /* 0x14 */ J3DMtxCalc* mBasicMtxCalc; + /* 0x18 */ J3DJoint** mJointNodePointer; + /* 0x1C */ u16 mJointNum; + /* 0x1E */ u16 mWEvlpMtxNum; + /* 0x20 */ u8 mWEvlpMixMtxNum; + /* 0x24 */ s32 mWEvlpMixIndex; + /* 0x28 */ s32 mWEvlpMixWeight; + /* 0x2C */ Mtx* mInvJointMtx; + /* 0x30 */ s32 mWEvlpImportantMtxIdx; + /* 0x34 */ J3DDrawMtxData mDrawMtxNum; + /* 0x40 */ u8 field_0x40[4]; + /* 0x44 */ JUTNameTab* mJointName; +}; // Size: 0x48 + #endif /* J3DJOINTTREE_H */ diff --git a/include/JSystem/J3DGraphAnimator/J3DMaterialAnm.h b/include/JSystem/J3DGraphAnimator/J3DMaterialAnm.h index 943ae54965..191908b869 100644 --- a/include/JSystem/J3DGraphAnimator/J3DMaterialAnm.h +++ b/include/JSystem/J3DGraphAnimator/J3DMaterialAnm.h @@ -1,6 +1,135 @@ #ifndef J3DMATERIALANM_H #define J3DMATERIALANM_H +#include "JSystem/J3DGraphAnimator/J3DAnimation.h" #include "dolphin/types.h" +class J3DMatColorAnm { +public: + /* 8003B2B8 */ ~J3DMatColorAnm(); + /* 8003B2F4 */ J3DMatColorAnm(); + + void operator=(J3DMatColorAnm const& other) { + mAnmColor = other.mAnmColor; + field_0x0 = other.field_0x0; + mAnmFlag = other.mAnmFlag; + } + + void setAnmFlag(bool flag) { mAnmFlag = flag; } + bool getAnmFlag() const { return mAnmFlag; } + void calc(_GXColor* pColor) const { mAnmColor->getColor(field_0x0, pColor); } + +private: + /* 0x0 */ u16 field_0x0; + /* 0x2 */ u16 mAnmFlag; + /* 0x4 */ J3DAnmColor* mAnmColor; +}; // Size: 0x8 + +class J3DTexNoAnm { +public: + /* 8003B1F8 */ ~J3DTexNoAnm(); + /* 8003B240 */ J3DTexNoAnm(); + /* 8003C82C */ virtual void calc(u16*) const; + + void operator=(J3DTexNoAnm const& other) { + mAnmTexPattern = other.mAnmTexPattern; + field_0x4 = other.field_0x4; + mAnmFlag = other.mAnmFlag; + } + + void setAnmFlag(bool flag) { mAnmFlag = flag; } + bool getAnmFlag() const { return mAnmFlag; } + J3DAnmTexPattern* getAnmTexPattern() { return mAnmTexPattern; } + +private: + /* 0x4 */ u16 field_0x4; + /* 0x6 */ u16 mAnmFlag; + /* 0x8 */ J3DAnmTexPattern* mAnmTexPattern; +}; // Size: 0xC + +class J3DTexMtxAnm { +public: + /* 8003B264 */ ~J3DTexMtxAnm(); + /* 8003B2A0 */ J3DTexMtxAnm(); + + void operator=(J3DTexMtxAnm const& other) { + mAnmTransform = other.mAnmTransform; + field_0x0 = other.field_0x0; + mAnmFlag = other.mAnmFlag; + } + + void setAnmFlag(bool flag) { mAnmFlag = flag; } + void calc(J3DTextureSRTInfo* pSRTInfo) const { + mAnmTransform->getTransform(field_0x0, pSRTInfo); + } + bool getAnmFlag() const { return mAnmFlag; } + +private: + /* 0x0 */ u16 field_0x0; + /* 0x2 */ u16 mAnmFlag; + /* 0x4 */ J3DAnmTextureSRTKey* mAnmTransform; +}; // Size: 0x8 + +class J3DTevKColorAnm { +public: + /* 8003B150 */ ~J3DTevKColorAnm(); + /* 8003B18C */ J3DTevKColorAnm(); + + void operator=(J3DTevKColorAnm const& other) { + mAnmTevReg = other.mAnmTevReg; + field_0x0 = other.field_0x0; + mAnmFlag = other.mAnmFlag; + } + + void setAnmFlag(bool flag) { mAnmFlag = flag; } + bool getAnmFlag() const { return mAnmFlag; } + void calc(_GXColor* pColor) const { mAnmTevReg->getTevKonstReg(field_0x0, pColor); } + +private: + /* 0x0 */ u16 field_0x0; + /* 0x2 */ u16 mAnmFlag; + /* 0x4 */ J3DAnmTevRegKey* mAnmTevReg; +}; // Size: 0x8 + +class J3DTevColorAnm { +public: + /* 8003B1A4 */ ~J3DTevColorAnm(); + /* 8003B1E0 */ J3DTevColorAnm(); + + void operator=(J3DTevColorAnm const& other) { + mAnmTevReg = other.mAnmTevReg; + field_0x0 = other.field_0x0; + mAnmFlag = other.mAnmFlag; + } + + void setAnmFlag(bool flag) { mAnmFlag = flag; } + bool getAnmFlag() const { return mAnmFlag; } + void calc(_GXColorS10* pColor) const { mAnmTevReg->getTevColorReg(field_0x0, pColor); } + +private: + /* 0x0 */ u16 field_0x0; + /* 0x2 */ u16 mAnmFlag; + /* 0x4 */ J3DAnmTevRegKey* mAnmTevReg; +}; // Size: 0x8 + +class J3DMaterialAnm { +public: + /* 8032C320 */ void initialize(); + /* 8032C5A4 */ void setMatColorAnm(int, J3DMatColorAnm*); + /* 8032C5E4 */ void setTexMtxAnm(int, J3DTexMtxAnm*); + /* 8032C624 */ void setTexNoAnm(int, J3DTexNoAnm*); + /* 8032C664 */ void setTevColorAnm(int, J3DTevColorAnm*); + /* 8032C6A4 */ void setTevKColorAnm(int, J3DTevKColorAnm*); + + /* 800A4820 */ virtual ~J3DMaterialAnm(); + /* 8032C3C4 */ virtual void calc(J3DMaterial*) const; + +private: + /* 0x04 */ J3DMatColorAnm mMatColorAnm[2]; + /* 0x14 */ J3DTexMtxAnm mTexMtxAnm[8]; + /* 0x54 */ J3DTexNoAnm mTexNoAnm[8]; + /* 0xB4 */ J3DTevColorAnm mTevColorAnm[4]; + /* 0xD4 */ J3DTevKColorAnm mTevKColorAnm[4]; +}; // Size: 0xF4 + #endif /* J3DMATERIALANM_H */ diff --git a/include/JSystem/J3DGraphAnimator/J3DMaterialAttach.h b/include/JSystem/J3DGraphAnimator/J3DMaterialAttach.h index 59e8a0e581..9582221280 100644 --- a/include/JSystem/J3DGraphAnimator/J3DMaterialAttach.h +++ b/include/JSystem/J3DGraphAnimator/J3DMaterialAttach.h @@ -1,6 +1,47 @@ #ifndef J3DMATERIALATTACH_H #define J3DMATERIALATTACH_H +#include "JSystem/JUtility/JUTNameTab.h" #include "dolphin/types.h" +struct J3DMaterial; +struct J3DTexture; +struct J3DAnmColor; +struct J3DAnmTexPattern; +struct J3DAnmTextureSRTKey; +struct J3DAnmTevRegKey; + +class J3DMaterialTable { +public: + /* 8032F5A8 */ void clear(); + /* 8032F5D0 */ J3DMaterialTable(); + /* 8032F64C */ bool removeMatColorAnimator(J3DAnmColor*); + /* 8032F6F8 */ void removeTexNoAnimator(J3DAnmTexPattern*); + /* 8032F7B4 */ void removeTexMtxAnimator(J3DAnmTextureSRTKey*); + /* 8032F880 */ void removeTevRegAnimator(J3DAnmTevRegKey*); + /* 8032F9C0 */ void createTexMtxForAnimator(J3DAnmTextureSRTKey*); + /* 8032FAF4 */ void entryMatColorAnimator(J3DAnmColor*); + /* 8032FBC8 */ void entryTexNoAnimator(J3DAnmTexPattern*); + /* 8032FCC4 */ void entryTexMtxAnimator(J3DAnmTextureSRTKey*); + /* 8032FE70 */ void entryTevRegAnimator(J3DAnmTevRegKey*); + + /* 8032F604 */ virtual ~J3DMaterialTable(); + + J3DMaterial* getMaterialNodePointer(u16 idx) const { return mMaterialNodePointer[idx]; } + + J3DTexture* getTexture() const { return mTexture; } + + u16 getMaterialNum() const { return mMaterialNum; } + +private: + /* 0x04 */ u16 mMaterialNum; + /* 0x06 */ u16 mUniqueMatNum; + /* 0x08 */ J3DMaterial** mMaterialNodePointer; + /* 0x0C */ JUTNameTab* mMaterialName; + /* 0x10 */ u32 field_0x10; + /* 0x14 */ J3DTexture* mTexture; + /* 0x18 */ JUTNameTab* mTextureName; + /* 0x1C */ u16 field_0x1c; +}; // Size: 0x20 + #endif /* J3DMATERIALATTACH_H */ diff --git a/include/JSystem/J3DGraphAnimator/J3DModel.h b/include/JSystem/J3DGraphAnimator/J3DModel.h index 6e3a8ca9b9..290f05fe66 100644 --- a/include/JSystem/J3DGraphAnimator/J3DModel.h +++ b/include/JSystem/J3DGraphAnimator/J3DModel.h @@ -2,63 +2,32 @@ #define J3DMODEL_H #include "JSystem/J3DGraphAnimator/J3DModelData.h" +#include "JSystem/J3DGraphAnimator/J3DMtxBuffer.h" +#include "JSystem/J3DGraphAnimator/J3DSkinDeform.h" +#include "JSystem/J3DGraphBase/J3DPacket.h" +#include "JSystem/J3DGraphBase/J3DShape.h" +#include "JSystem/J3DGraphBase/J3DVertex.h" #include "dolphin/mtx/mtxvec.h" #include "dolphin/types.h" -class J3DModel; -struct J3DSkinDeform { - /* 8032C9B0 */ void initSkinInfo(J3DModelData*); - /* 8032CF44 */ void initMtxIndexArray(J3DModelData*); - /* 8032D378 */ void changeFastSkinDL(J3DModelData*); - /* 8032D738 */ void transformVtxPosNrm(J3DModelData*); - /* 8032DFDC */ void deform(J3DModel*); +enum J3DMdlFlag { + /* 0x4 */ J3DMdlFlag_SkinPosCpu = 0x4, + /* 0x8 */ J3DMdlFlag_SkinNrmCpu = 0x8, }; -struct J3DDeformData { - /* 8032E230 */ void offAllFlag(u32); - /* 8032E274 */ void deform(J3DModel*); -}; - -class J3DMtxBuffer { -public: - /* 80326214 */ void initialize(); - /* 80326258 */ void create(J3DModelData*, u32); - /* 803268D4 */ void calcWeightEnvelopeMtx(); - /* 80326ACC */ void calcDrawMtx(u32, Vec const&, f32 const (&)[3][4]); - /* 80326D3C */ void calcNrmMtx(); - /* 80326EF0 */ void calcBBoardMtx(); - /* 803283B4 */ ~J3DMtxBuffer(); - - Mtx* getAnmMtx(int p1) { - Mtx* tmp = mMatrices[0]; - return tmp + (p1); - } - - /* 0x00 */ void* mJointTree; - /* 0x04 */ u32 field_0x4; - /* 0x08 */ u32 field_0x8; - /* 0x0C */ Mtx* mMatrices[5]; -}; - -class J3DMtxBuffer; -class J3DVertexBuffer; -class J3DMatPacket; -class J3DShapePacket; -class J3DVtxColorCalc; - class J3DModel { public: /* 800CFFF4 */ void setBaseTRMtx(f32 (*)[4]); /* 80327100 */ void initialize(); - /* 80327184 */ void entryModelData(J3DModelData*, u32, u32); - /* 80327300 */ void createShapePacket(J3DModelData*); - /* 803273CC */ void createMatPacket(J3DModelData*, u32); + /* 80327184 */ s32 entryModelData(J3DModelData*, u32, u32); + /* 80327300 */ s32 createShapePacket(J3DModelData*); + /* 803273CC */ s32 createMatPacket(J3DModelData*, u32); /* 803275FC */ void newDifferedDisplayList(u32); /* 8032767C */ void lock(); /* 803276B4 */ void unlock(); /* 803279A0 */ void diff(); - /* 80327A2C */ void setDeformData(J3DDeformData*, u32); - /* 80327AA0 */ void setSkinDeform(J3DSkinDeform*, u32); + /* 80327A2C */ s32 setDeformData(J3DDeformData*, u32); + /* 80327AA0 */ s32 setSkinDeform(J3DSkinDeform*, u32); /* 80327BD4 */ void calcAnmMtx(); /* 80327C58 */ void calcWeightEnvelopeMtx(); /* 80328190 */ void calcNrmMtx(); @@ -67,34 +36,39 @@ public: /* 803282EC */ void prepareShapePackets(); Mtx* getAnmMtx(int); - /* 80327CA4 */ void update(); - /* 80327E4C */ void entry(); - /* 80327CF0 */ void calc(); - /* 803276EC */ void calcMaterial(); - /* 80327858 */ void calcDiffTexMtx(); - /* 80327F40 */ void viewCalc(); - /* 80328350 */ ~J3DModel(); + /* 80327CA4 */ virtual void update(); + /* 80327E4C */ virtual void entry(); + /* 80327CF0 */ virtual void calc(); + /* 803276EC */ virtual void calcMaterial(); + /* 80327858 */ virtual void calcDiffTexMtx(); + /* 80327F40 */ virtual void viewCalc(); + /* 80328350 */ virtual ~J3DModel(); + + J3DModelData* getModelData() { return mModelData; } + void onFlag(u32 flag) { mFlags |= flag; } + void offFlag(u32 flag) { mFlags &= ~flag; } + bool checkFlag(u32 flag) const { return (mFlags & flag) ? true : false; } // is there a better way to handle inlines with same name as non-inlines? - Mtx* i_getAnmMtx(int p1) { return mMtxBuffer->getAnmMtx(p1); } + MtxP i_getAnmMtx(int p1) { return mMtxBuffer->getAnmMtx(p1); } - /* 0x00 */ void* vtable; /* 0x04 */ J3DModelData* mModelData; /* 0x08 */ u32 mFlags; /* 0x0C */ u32 field_0x0c; /* 0x10 */ int field_0x10; - /* 0x14 */ void* mUserArea; + /* 0x14 */ u32 mUserArea; /* 0x18 */ Vec mBaseScale; /* 0x24 */ Mtx mBaseTransformMtx; /* 0x54 */ Mtx mInternalView; /* 0x84 */ J3DMtxBuffer* mMtxBuffer; - /* 0x88 */ J3DVertexBuffer* mVertexBuffer; + /* 0x88 */ J3DVertexBuffer mVertexBuffer; /* 0xC0 */ J3DMatPacket* mMatPacket; - /* 0xC4 */ J3DShapePacket* mShapePacket; + /* 0xC4 */ J3DShapePacket** mShapePacket; /* 0xC8 */ J3DDeformData* mDeformData; /* 0xCC */ J3DSkinDeform* mSkinDeform; /* 0xD0 */ J3DVtxColorCalc* mVtxColorCalc; - /* 0xD4 */ u8 field_0xd4[8]; + /* 0xD4 */ int field_0xd4; + /* 0xD8 */ int field_0xd8; }; #endif /* J3DMODEL_H */ diff --git a/include/JSystem/J3DGraphAnimator/J3DModelData.h b/include/JSystem/J3DGraphAnimator/J3DModelData.h index 76d4b40ab7..4265ef16d6 100644 --- a/include/JSystem/J3DGraphAnimator/J3DModelData.h +++ b/include/JSystem/J3DGraphAnimator/J3DModelData.h @@ -1,18 +1,53 @@ #ifndef J3DMODELDATA_H #define J3DMODELDATA_H +#include "JSystem/J3DGraphAnimator/J3DJointTree.h" +#include "JSystem/J3DGraphAnimator/J3DMaterialAttach.h" +#include "JSystem/J3DGraphAnimator/J3DShapeTable.h" +#include "JSystem/J3DGraphBase/J3DSys.h" +#include "JSystem/J3DGraphBase/J3DVertex.h" #include "dolphin/types.h" class J3DModelData { +public: /* 80325D88 */ void clear(); /* 80325DA0 */ J3DModelData(); - /* 80325E14 */ void newSharedDisplayList(u32); + /* 80325E14 */ s32 newSharedDisplayList(u32); /* 80325EC8 */ void indexToPtr(); /* 80325F94 */ void makeSharedDL(); /* 8032600C */ void simpleCalcMaterial(u16, f32 (*)[4]); /* 803260CC */ void syncJ3DSysPointers() const; /* 803260F8 */ void syncJ3DSysFlags() const; - /* 8032617C */ ~J3DModelData(); -}; + + /* 8032617C */ virtual ~J3DModelData(); + + J3DMaterialTable& getMaterialTable() { return mMaterialTable; } + J3DVertexData& getVertexData() { return mVertexData; } + u16 getShapeNum() const { return mShapeTable.getShapeNum(); } + u16 getMaterialNum() const { return mMaterialTable.getMaterialNum(); } + J3DMaterial* getMaterialNodePointer(u16 idx) const { + return mMaterialTable.getMaterialNodePointer(idx); + } + J3DShape* getShapeNodePointer(u16 idx) const { return mShapeTable.getShapeNodePointer(idx); } + J3DJoint* getJointNodePointer(u16 idx) const { return mJointTree.getJointNodePointer(idx); } + J3DJointTree& getJointTree() { return mJointTree; } + J3DTexture* getTexture() const { return mMaterialTable.getTexture(); } + u16 getWEvlpMtxNum() const { return mJointTree.getWEvlpMtxNum(); } + void* getVtxPosArray() const { return mVertexData.getVtxPosArray(); } + void* getVtxNrmArray() const { return mVertexData.getVtxNrmArray(); } + _GXColor* getVtxColorArray(u8 idx) const { return mVertexData.getVtxColorArray(idx); } + bool checkFlag(u32 flag) const { return (mFlags & flag) ? true : false; } + bool checkBBoardFlag() const { return field_0xe == 1; } + +private: + /* 0x04 */ u32 field_0x4; + /* 0x08 */ u32 mFlags; + /* 0x0C */ u16 field_0xc; + /* 0x0E */ u16 field_0xe; + /* 0x10 */ J3DJointTree mJointTree; + /* 0x58 */ J3DMaterialTable mMaterialTable; + /* 0x78 */ J3DShapeTable mShapeTable; + /* 0x88 */ J3DVertexData mVertexData; +}; // Size: 0xE4 #endif /* J3DMODELDATA_H */ diff --git a/include/JSystem/J3DGraphAnimator/J3DMtxBuffer.h b/include/JSystem/J3DGraphAnimator/J3DMtxBuffer.h index f1e8e3d5a8..3ff9b52cd8 100644 --- a/include/JSystem/J3DGraphAnimator/J3DMtxBuffer.h +++ b/include/JSystem/J3DGraphAnimator/J3DMtxBuffer.h @@ -1,6 +1,52 @@ #ifndef J3DMTXBUFFER_H #define J3DMTXBUFFER_H +#include "JSystem/J3DGraphAnimator/J3DJointTree.h" +#include "JSystem/J3DGraphAnimator/J3DModelData.h" +#include "dolphin/mtx/mtxvec.h" #include "dolphin/types.h" +class J3DModelData; + +class J3DMtxBuffer { +public: + J3DMtxBuffer() { initialize(); } + + /* 80326214 */ void initialize(); + /* 80326258 */ s32 create(J3DModelData*, u32); + /* 80326364 */ void createAnmMtx(J3DModelData*); + /* 803263F0 */ void createWeightEnvelopeMtx(J3DModelData*); + /* 8032648C */ void setNoUseDrawMtx(); + /* 803264B8 */ void createDoubleDrawMtx(J3DModelData*, u32); + /* 80326664 */ void createBumpMtxArray(J3DModelData*, u32); + /* 803268D4 */ void calcWeightEnvelopeMtx(); + /* 80326ACC */ void calcDrawMtx(u32, Vec const&, f32 const (&)[3][4]); + /* 80326D3C */ void calcNrmMtx(); + /* 80326EF0 */ void calcBBoardMtx(); + + MtxP getAnmMtx(int idx) const { return *(mMatrices[0] + idx); } + + void setScaleFlag(int idx, u8 flag) { mScaleFlag[idx] = flag; } + + static Mtx sNoUseDrawMtx; + static Mtx33 sNoUseNrmMtx; + static Mtx* sNoUseDrawMtxPtr; + static Mtx33* sNoUseNrmMtxPtr; + +private: + /* 0x00 */ J3DJointTree* mJointTree; + /* 0x04 */ u8* mScaleFlag; + /* 0x08 */ u8* mEnvScaleFlag; + /* 0x0C */ Mtx* mMatrices[5]; // fix this later + /* 0x20 */ Mtx33* mpNrmMtxPtrPtr; + /* 0x24 */ Mtx** field_0x24; + /* 0x28 */ Mtx** mpBumpMtxPtr; + /* 0x2C */ u32 field_0x2c; + /* 0x30 */ u32* mCurrentViewNoPtr; + /* 0x34 */ Mtx** mUserAnmMtx; + +public: + /* 803283B4 */ virtual ~J3DMtxBuffer(); +}; + #endif /* J3DMTXBUFFER_H */ diff --git a/include/JSystem/J3DGraphAnimator/J3DShapeTable.h b/include/JSystem/J3DGraphAnimator/J3DShapeTable.h index 66e6fde10f..9abac85f9b 100644 --- a/include/JSystem/J3DGraphAnimator/J3DShapeTable.h +++ b/include/JSystem/J3DGraphAnimator/J3DShapeTable.h @@ -1,6 +1,33 @@ #ifndef J3DSHAPETABLE_H #define J3DSHAPETABLE_H +#include "JSystem/J3DGraphBase/J3DShape.h" +#include "JSystem/J3DGraphBase/J3DVertex.h" +#include "JSystem/JUtility/JUTNameTab.h" #include "dolphin/types.h" +class J3DShapeTable { +public: + J3DShapeTable() { + mShapeNum = 0; + mShapeNodePointer = NULL; + mShapeName = NULL; + } + + /* 803258A0 */ void hide(); + /* 803258D8 */ void show(); + /* 80325910 */ void initShapeNodes(J3DDrawMtxData*, J3DVertexData*); + /* 8032597C */ void sortVcdVatCmd(); + + virtual ~J3DShapeTable(); + + u16 getShapeNum() const { return mShapeNum; } + J3DShape* getShapeNodePointer(u16 idx) const { return mShapeNodePointer[idx]; } + +private: + /* 0x4 */ u16 mShapeNum; + /* 0x8 */ J3DShape** mShapeNodePointer; + /* 0xC */ JUTNameTab* mShapeName; +}; // Size: 0x10 + #endif /* J3DSHAPETABLE_H */ diff --git a/include/JSystem/J3DGraphAnimator/J3DSkinDeform.h b/include/JSystem/J3DGraphAnimator/J3DSkinDeform.h index 6547503c90..63d138b1c2 100644 --- a/include/JSystem/J3DGraphAnimator/J3DSkinDeform.h +++ b/include/JSystem/J3DGraphAnimator/J3DSkinDeform.h @@ -1,6 +1,103 @@ #ifndef J3DSKINDEFORM_H #define J3DSKINDEFORM_H +#include "JSystem/J3DGraphAnimator/J3DCluster.h" +#include "JSystem/J3DGraphAnimator/J3DModelData.h" +#include "JSystem/J3DGraphAnimator/J3DMtxBuffer.h" +#include "JSystem/J3DGraphBase/J3DVertex.h" #include "dolphin/types.h" +class J3DModel; +class J3DAnmCluster; + +class J3DDeformData { +public: + /* 8032E1F8 */ J3DDeformData(); + /* 8032E230 */ void offAllFlag(u32); + /* 8032E298 */ void deform(J3DVertexBuffer*); + /* 8032E274 */ void deform(J3DModel*); + /* 8032E364 */ void setAnm(J3DAnmCluster*); + +private: + /* 0x00 */ u16 mClusterNum; + /* 0x02 */ u16 mClusterKeyNum; + /* 0x04 */ u16 field_0x4; + /* 0x08 */ J3DCluster** mClusterPointer; + /* 0x0C */ J3DClusterKey** mClusterKeyPointer; + /* 0x10 */ int field_0x10; + /* 0x14 */ u16 field_0x14; + /* 0x16 */ u16 field_0x16; + /* 0x18 */ void* mVtxPos; + /* 0x1C */ void* mVtxNrm; + /* 0x20 */ int field_0x20; + /* 0x24 */ int field_0x24; +}; // Size: 0x28 + +struct J3DSkinNList { + /* 8032C6E4 */ J3DSkinNList(); + /* 8032C85C */ void calcSkin_VtxPosF32(f32 (*)[4], void*, void*); + /* 8032C8E4 */ void calcSkin_VtxNrmF32(f32 (*)[4], void*, void*); + + /* 0x00 */ int field_0x0; + /* 0x04 */ int field_0x4; + /* 0x08 */ int field_0x8; + /* 0x0C */ int field_0xc; + /* 0x10 */ u16 field_0x10; + /* 0x12 */ u16 field_0x12; +}; // Size: 0x14 + +class J3DSkinDeform { +public: + /* 8032C96C */ J3DSkinDeform(); + /* 8032C9B0 */ void initSkinInfo(J3DModelData*); + /* 8032CF44 */ void initMtxIndexArray(J3DModelData*); + /* 8032D378 */ void changeFastSkinDL(J3DModelData*); + /* 8032D5C4 */ void calcNrmMtx(J3DMtxBuffer*); + /* 8032D738 */ void transformVtxPosNrm(J3DModelData*); + /* 8032D87C */ void calcAnmInvJointMtx(J3DMtxBuffer*); + /* 8032D8F4 */ void deformFastVtxPos_F32(J3DVertexBuffer*, J3DMtxBuffer*) const; + /* 8032DA1C */ void deformFastVtxNrm_F32(J3DVertexBuffer*, J3DMtxBuffer*) const; + /* 8032DB50 */ void deformVtxPos_F32(J3DVertexBuffer*, J3DMtxBuffer*) const; + /* 8032DC74 */ void deformVtxPos_S16(J3DVertexBuffer*, J3DMtxBuffer*) const; + /* 8032DDB8 */ void deformVtxNrm_F32(J3DVertexBuffer*) const; + /* 8032DEBC */ void deformVtxNrm_S16(J3DVertexBuffer*) const; + /* 8032DFDC */ void deform(J3DModel*); + + /* 8032E064 */ virtual void deform(J3DVertexBuffer*, J3DMtxBuffer*); + /* 8032E1B0 */ virtual ~J3DSkinDeform(); + + static u8 sWorkArea_WEvlpMixMtx[4096]; + static u8 sWorkArea_WEvlpMixWeight[4096]; + static u8 sWorkArea_MtxReg[2048 + 8 /* padding */]; + +private: + /* 0x04 */ void** mPosData; + /* 0x08 */ void** field_0x8; + /* 0x0C */ void** field_0xc; + /* 0x10 */ Mtx** mNrmMtx; + /* 0x14 */ u32 mFlags; + /* 0x18 */ u8 field_0x18; + /* 0x19 */ u8 field_0x19; + /* 0x1C */ int field_0x1c; + /* 0x20 */ int field_0x20; + /* 0x24 */ J3DSkinNList** mSkinNList; +}; + +class J3DDeformer { +public: + /* 8032E39C */ J3DDeformer(J3DDeformData*); + /* 8032EAB4 */ void deform(J3DVertexBuffer*, u16, f32*); + /* 8032E3BC */ void deform(J3DVertexBuffer*, u16); + /* 8032E4A4 */ void deform_VtxPosF32(J3DVertexBuffer*, J3DCluster*, J3DClusterKey*, f32*); + /* 8032E60C */ void deform_VtxNrmF32(J3DVertexBuffer*, J3DCluster*, J3DClusterKey*, f32*); + /* 8032EBCC */ void normalizeWeight(int, f32*); + +private: + /* 0x00 */ J3DDeformData* mDeformData; + /* 0x04 */ J3DAnmCluster* mAnmCluster; + /* 0x08 */ int field_0x8; + /* 0x0C */ int field_0xc; + /* 0x10 */ u32 mFlags; +}; // Size: 0x14 + #endif /* J3DSKINDEFORM_H */ diff --git a/include/JSystem/J3DGraphBase/J3DMatBlock.h b/include/JSystem/J3DGraphBase/J3DMatBlock.h index ff5235ef2d..c62fa07850 100644 --- a/include/JSystem/J3DGraphBase/J3DMatBlock.h +++ b/include/JSystem/J3DGraphBase/J3DMatBlock.h @@ -1,14 +1,926 @@ #ifndef J3DMATBLOCK_H #define J3DMATBLOCK_H +#include "JSystem/J3DGraphBase/J3DStruct.h" +#include "JSystem/J3DGraphBase/J3DTevs.h" +#include "JSystem/J3DGraphBase/J3DTexture.h" #include "dolphin/gx/GXTexture.h" +#include "dolphin/mtx/mtx.h" #include "dolphin/types.h" -class J3DGXColorS10 { -public: +struct J3DGXColorS10 { /* 8000E460 */ J3DGXColorS10(); _GXColorS10 mColor; }; +struct J3DGXColor : public _GXColor { + /* 8000E538 */ J3DGXColor(); +}; + +struct J3DNBTScaleInfo { + /* 8032587C */ void operator=(J3DNBTScaleInfo const&); + + /* 0x0 */ u8 field_0x0; + /* 0x4 */ Vec mScale; +}; // Size: 0x10 + +struct J3DNBTScale : public J3DNBTScaleInfo {}; + +class J3DTexGenBlock { +public: + /* 80317354 */ virtual void reset(J3DTexGenBlock*); + virtual void calc(f32 const (*)[4]) = 0; + virtual void calcWithoutViewMtx(f32 const (*)[4]) = 0; + virtual void calcPostTexMtx(f32 const (*)[4]) = 0; + virtual void calcPostTexMtxWithoutViewMtx(f32 const (*)[4]) = 0; + virtual void load() = 0; + virtual void patch() = 0; + virtual void diff(u32) = 0; + virtual void diffTexMtx() = 0; + virtual void diffTexGen() = 0; + /* 803172FC */ virtual bool countDLSize(); + virtual void getType() = 0; + /* 8031741C */ virtual void setTexGenNum(u32 const*); + /* 8000E0D0 */ virtual void setTexGenNum(u32); + /* 8000DFE8 */ virtual bool getTexGenNum() const; + /* 8000E0CC */ virtual void setTexCoord(u32, J3DTexCoord const*); + /* 8000DFE0 */ virtual bool getTexCoord(u32); + /* 8003AB2C */ virtual void setTexMtx(u32, J3DTexMtx*); + /* 8000DFD8 */ virtual J3DTexMtx* getTexMtx(u32); + /* 80317424 */ virtual void setNBTScale(J3DNBTScale const*); + /* 80317420 */ virtual void setNBTScale(J3DNBTScale); + /* 80317334 */ virtual bool getNBTScale(); + /* 80317428 */ virtual bool getTexMtxOffset() const; + /* 80317430 */ virtual void setTexMtxOffset(u32); + /* 803171DC */ virtual ~J3DTexGenBlock(); +}; + +class J3DTexGenBlockPatched : public J3DTexGenBlock { +public: + /* 80317644 */ void initialize(); + + /* 80320084 */ virtual void reset(J3DTexGenBlock*); + /* 803213C0 */ virtual void calc(f32 const (*)[4]); + /* 80321584 */ virtual void calcWithoutViewMtx(f32 const (*)[4]); + /* 803216D8 */ virtual void calcPostTexMtx(f32 const (*)[4]); + /* 8032181C */ virtual void calcPostTexMtxWithoutViewMtx(f32 const (*)[4]); + /* 80322E70 */ virtual void load(); + /* 8031AA88 */ virtual void patch(); + /* 8031AC68 */ virtual void diff(u32); + /* 8031ACD0 */ virtual void diffTexMtx(); + /* 8031AD30 */ virtual void diffTexGen(); + /* 80317B9C */ virtual s32 countDLSize(); + /* 80322E74 */ virtual void getType(); + /* 80322D3C */ virtual void setTexGenNum(u32 const*); + /* 80322D34 */ virtual void setTexGenNum(u32); + /* 80322D48 */ virtual void getTexGenNum() const; + /* 80322D50 */ virtual void setTexCoord(u32, J3DTexCoord const*); + /* 80322D64 */ virtual void getTexCoord(u32); + /* 80322D78 */ virtual void setTexMtx(u32, J3DTexMtx*); + /* 80322D88 */ virtual void getTexMtx(u32); + /* 80322D98 */ virtual void getTexMtxOffset() const; + /* 80322DA0 */ virtual void setTexMtxOffset(u32); + /* 80317180 */ virtual ~J3DTexGenBlockPatched(); + +private: + /* 0x04 */ u32 mTexGenNum; + /* 0x08 */ J3DTexCoord mTexCoord[9]; + /* 0x38 */ J3DTexMtx* mTexMtx[8]; + /* 0x58 */ u32 mTexMtxOffset; +}; // Size: 0x5C + +class J3DTexGenBlockBasic : public J3DTexGenBlockPatched { +public: + /* 803176A4 */ void initialize(); + + /* 803202DC */ virtual void reset(J3DTexGenBlock*); + /* 8031A9E8 */ virtual void load(); + /* 8031ABC0 */ virtual void patch(); + /* 80317BAC */ virtual s32 countDLSize(); + /* 80322C6C */ virtual void getType(); + /* 80322C9C */ virtual void setNBTScale(J3DNBTScale const*); + /* 80322C78 */ virtual void setNBTScale(J3DNBTScale); + /* 80322CC0 */ virtual void getNBTScale(); + /* 80322CC8 */ virtual ~J3DTexGenBlockBasic(); + +private: + /* 0x5C */ J3DNBTScale mNBTScale; +}; // Size: 0x6C + +class J3DTexGenBlock4 : public J3DTexGenBlockPatched { +public: + /* 80317674 */ void initialize(); + + /* 803201A0 */ virtual void reset(J3DTexGenBlock*); + /* 8031A948 */ virtual void load(); + /* 8031AB18 */ virtual void patch(); + /* 80317BA4 */ virtual s32 countDLSize(); + /* 80322DA8 */ virtual void getType(); + /* 80322DD8 */ virtual void setNBTScale(J3DNBTScale const*); + /* 80322DB4 */ virtual void setNBTScale(J3DNBTScale); + /* 80322DFC */ virtual void getNBTScale(); + /* 80322E04 */ virtual ~J3DTexGenBlock4(); + +private: + /* 0x5C */ J3DNBTScale mNBTScale; +}; // Size: 0x6C + +class J3DTevBlock { +public: + /* 80317350 */ virtual void reset(J3DTevBlock*); + /* 80317330 */ virtual void load(); + /* 8031CD44 */ virtual void diff(u32); + /* 80321948 */ virtual void diffTexNo(); + /* 80321938 */ virtual void diffTevReg(); + /* 80321944 */ virtual void diffTexCoordScale(); + /* 80321940 */ virtual void diffTevStage(); + /* 8032193C */ virtual void diffTevStageIndirect(); + /* 8000DBD4 */ virtual void patch(); + /* 8032353C */ virtual void patchTexNo(); + /* 80323540 */ virtual void patchTevReg(); + /* 8000DBC8 */ virtual void patchTexNoAndTexCoordScale(); + virtual void ptrToIndex() = 0; + virtual void indexToPtr() = 0; + virtual void getType() = 0; + /* 8031730C */ virtual bool countDLSize(); + /* 80323544 */ virtual void setTexNo(u32, u16 const*); + /* 8000E0AC */ virtual void setTexNo(u32, u16); + /* 8000DF94 */ virtual void getTexNo(u32) const; + /* 80323548 */ virtual void setTevOrder(u32, J3DTevOrder const*); + /* 8000E0BC */ virtual void setTevOrder(u32, J3DTevOrder); + /* 8000DFB8 */ virtual bool getTevOrder(u32); + /* 80110E80 */ virtual void setTevColor(u32, J3DGXColorS10 const*); + /* 8000E0C4 */ virtual void setTevColor(u32, J3DGXColorS10); + /* 8000DFC8 */ virtual _GXColorS10* getTevColor(u32); + /* 800732AC */ virtual void setTevKColor(u32, J3DGXColor const*); + /* 8000E0C0 */ virtual void setTevKColor(u32, J3DGXColor); + /* 8000DFC0 */ virtual _GXColor* getTevKColor(u32); + /* 80322950 */ virtual void setTevKColorSel(u32, u8 const*); + /* 8000E0B8 */ virtual void setTevKColorSel(u32, u8); + /* 8000DFB0 */ virtual bool getTevKColorSel(u32); + /* 80322954 */ virtual void setTevKAlphaSel(u32, u8 const*); + /* 8000E0B4 */ virtual void setTevKAlphaSel(u32, u8); + /* 8000DFA8 */ virtual bool getTevKAlphaSel(u32); + /* 8032354C */ virtual void setTevStageNum(u8 const*); + /* 8000E0C8 */ virtual void setTevStageNum(u8); + /* 8000DFD0 */ virtual u8 getTevStageNum() const; + /* 80323550 */ virtual void setTevStage(u32, J3DTevStage const*); + /* 8000E0A8 */ virtual void setTevStage(u32, J3DTevStage); + /* 8000DF8C */ virtual bool getTevStage(u32); + /* 8032295C */ virtual void setTevSwapModeInfo(u32, J3DTevSwapModeInfo const*); + /* 80322958 */ virtual void setTevSwapModeInfo(u32, J3DTevSwapModeInfo); + /* 80322960 */ virtual void setTevSwapModeTable(u32, J3DTevSwapModeTable const*); + /* 8000E0B0 */ virtual void setTevSwapModeTable(u32, J3DTevSwapModeTable); + /* 8000DFA0 */ virtual bool getTevSwapModeTable(u32); + /* 80323554 */ virtual void setIndTevStage(u32, J3DIndTevStage const*); + /* 8000E0A4 */ virtual void setIndTevStage(u32, J3DIndTevStage); + /* 8000DF84 */ virtual bool getIndTevStage(u32); + /* 80323558 */ virtual bool getTexNoOffset() const; + /* 80322964 */ virtual bool getTevRegOffset() const; + /* 80321FE0 */ virtual void setTexNoOffset(u32); + /* 8032296C */ virtual void setTevRegOffset(u32); + /* 80317224 */ virtual ~J3DTevBlock(); + +private: + /* 8031E098 */ void indexToPtr_private(u32); + + /* 0x4 */ u32 mTexNoOffset; +}; + +class J3DTevBlockPatched : public J3DTevBlock { +public: + /* 803176E0 */ void initialize(); + + /* 80320418 */ virtual void reset(J3DTevBlock*); + /* 80322970 */ virtual void load(); + /* 8031CE00 */ virtual void diffTexNo(); + /* 8031D028 */ virtual void diffTevReg(); + /* 8031D0C4 */ virtual void diffTexCoordScale(); + /* 8031CE64 */ virtual void diffTevStage(); + /* 8031CF78 */ virtual void diffTevStageIndirect(); + /* 8031C228 */ virtual void patch(); + /* 8031BF4C */ virtual void patchTexNo(); + /* 8031BFE0 */ virtual void patchTevReg(); + /* 8031C0AC */ virtual void patchTexNoAndTexCoordScale(); + /* 8031DFB4 */ virtual void ptrToIndex(); + /* 80322974 */ virtual void indexToPtr(); + /* 80322998 */ virtual void getType(); + /* 80317BB4 */ virtual s32 countDLSize(); + /* 803229D0 */ virtual void setTexNo(u32, u16 const*); + /* 803229C0 */ virtual void setTexNo(u32, u16); + /* 803229E4 */ virtual void getTexNo(u32) const; + /* 80322A08 */ virtual void setTevOrder(u32, J3DTevOrder const*); + /* 803229F4 */ virtual void setTevOrder(u32, J3DTevOrder); + /* 80322A1C */ virtual void getTevOrder(u32); + /* 80322B24 */ virtual void setTevColor(u32, J3DGXColorS10 const*); + /* 80322AF8 */ virtual void setTevColor(u32, J3DGXColorS10); + /* 80322B50 */ virtual void getTevColor(u32); + /* 80322B90 */ virtual void setTevKColor(u32, J3DGXColor const*); + /* 80322B64 */ virtual void setTevKColor(u32, J3DGXColor); + /* 80322BBC */ virtual void getTevKColor(u32); + /* 80322BDC */ virtual void setTevKColorSel(u32, u8 const*); + /* 80322BD0 */ virtual void setTevKColorSel(u32, u8); + /* 80322BEC */ virtual void getTevKColorSel(u32); + /* 803229AC */ virtual void setTevStageNum(u8 const*); + /* 803229A4 */ virtual void setTevStageNum(u8); + /* 803229B8 */ virtual void getTevStageNum() const; + /* 80322A6C */ virtual void setTevStage(u32, J3DTevStage const*); + /* 80322A30 */ virtual void setTevStage(u32, J3DTevStage); + /* 80322AA8 */ virtual void getTevStage(u32); + /* 80322AD0 */ virtual void setIndTevStage(u32, J3DIndTevStage const*); + /* 80322ABC */ virtual void setIndTevStage(u32, J3DIndTevStage); + /* 80322AE4 */ virtual void getIndTevStage(u32); + /* 80322BF8 */ virtual void getTexNoOffset() const; + /* 80322C00 */ virtual void getTevRegOffset() const; + /* 80322C08 */ virtual void setTevRegOffset(u32); + /* 80322C10 */ virtual ~J3DTevBlockPatched(); + +private: + /* 0x08 */ u16 mTexNo[8]; + /* 0x18 */ J3DTevOrder mTevOrder[8]; + /* 0x38 */ J3DTevStage mTevStage[8]; + /* 0x78 */ J3DIndTevStage mIndTevStage[8]; + /* 0x98 */ J3DGXColorS10 mTevColor[4]; + /* 0xB8 */ J3DGXColor mTevKColor[4]; + /* 0xC8 */ u8 mTevKColorSel[8]; + /* 0xD0 */ u8 mTevStageNum; + /* 0xD4 */ u32 mTevRegOffset; +}; // Size: 0xD8 + +class J3DTevBlockNull : public J3DTevBlock { + /* 803176D4 */ void initialize(); +}; + +class J3DTevBlock4 : public J3DTevBlock { +public: + /* 803178EC */ void initialize(); + + /* 8032098C */ virtual void reset(J3DTevBlock*); + /* 8031B4C0 */ virtual void load(); + /* 8031D758 */ virtual void diffTexNo(); + /* 8031D7BC */ virtual void diffTevReg(); + /* 8031DA1C */ virtual void diffTexCoordScale(); + /* 8031D858 */ virtual void diffTevStage(); + /* 8031D96C */ virtual void diffTevStageIndirect(); + /* 8031C9D0 */ virtual void patch(); + /* 8031C6F4 */ virtual void patchTexNo(); + /* 8031C788 */ virtual void patchTevReg(); + /* 8031C854 */ virtual void patchTexNoAndTexCoordScale(); + /* 80321FE8 */ virtual void ptrToIndex(); + /* 80321FEC */ virtual void indexToPtr(); + /* 80322010 */ virtual void getType(); + /* 80317BCC */ virtual s32 countDLSize(); + /* 8032202C */ virtual void setTexNo(u32, u16 const*); + /* 8032201C */ virtual void setTexNo(u32, u16); + /* 80322040 */ virtual void getTexNo(u32) const; + /* 80322064 */ virtual void setTevOrder(u32, J3DTevOrder const*); + /* 80322050 */ virtual void setTevOrder(u32, J3DTevOrder); + /* 80322078 */ virtual void getTevOrder(u32); + /* 803220B8 */ virtual void setTevColor(u32, J3DGXColorS10 const*); + /* 8032208C */ virtual void setTevColor(u32, J3DGXColorS10); + /* 803220E4 */ virtual void getTevColor(u32); + /* 80322124 */ virtual void setTevKColor(u32, J3DGXColor const*); + /* 803220F8 */ virtual void setTevKColor(u32, J3DGXColor); + /* 80322150 */ virtual void getTevKColor(u32); + /* 80322170 */ virtual void setTevKColorSel(u32, u8 const*); + /* 80322164 */ virtual void setTevKColorSel(u32, u8); + /* 80322180 */ virtual void getTevKColorSel(u32); + /* 80322198 */ virtual void setTevKAlphaSel(u32, u8 const*); + /* 8032218C */ virtual void setTevKAlphaSel(u32, u8); + /* 803221A8 */ virtual void getTevKAlphaSel(u32); + /* 803221BC */ virtual void setTevStageNum(u8 const*); + /* 803221B4 */ virtual void setTevStageNum(u8); + /* 803221C8 */ virtual void getTevStageNum() const; + /* 8032220C */ virtual void setTevStage(u32, J3DTevStage const*); + /* 803221D0 */ virtual void setTevStage(u32, J3DTevStage); + /* 80322248 */ virtual void getTevStage(u32); + /* 80322294 */ virtual void setTevSwapModeInfo(u32, J3DTevSwapModeInfo const*); + /* 8032225C */ virtual void setTevSwapModeInfo(u32, J3DTevSwapModeInfo); + /* 803222DC */ virtual void setTevSwapModeTable(u32, J3DTevSwapModeTable const*); + /* 803222CC */ virtual void setTevSwapModeTable(u32, J3DTevSwapModeTable); + /* 803222EC */ virtual void getTevSwapModeTable(u32); + /* 80322310 */ virtual void setIndTevStage(u32, J3DIndTevStage const*); + /* 803222FC */ virtual void setIndTevStage(u32, J3DIndTevStage); + /* 80322324 */ virtual void getIndTevStage(u32); + /* 80322338 */ virtual void getTexNoOffset() const; + /* 80322340 */ virtual void getTevRegOffset() const; + /* 80322348 */ virtual void setTevRegOffset(u32); + /* 80322350 */ virtual ~J3DTevBlock4(); + +private: + /* 0x08 */ u16 mTexNo[4]; + /* 0x10 */ J3DTevOrder mTevOrder[4]; + /* 0x20 */ u8 mTevStageNum; + /* 0x21 */ J3DTevStage mTevStage[4]; + /* 0x42 */ J3DGXColorS10 mTevColor[4]; + /* 0x62 */ J3DGXColor mTevKColor[4]; + /* 0x72 */ u8 mTevKColorSel[4]; + /* 0x76 */ u8 mTevKAlphaSel[4]; + /* 0x7A */ J3DTevSwapModeTable mTevSwapModeTable[4]; + /* 0x80 */ J3DIndTevStage mIndTevStage[4]; + /* 0x90 */ u32 mTevRegOffset; +}; // Size: 0x94 + +class J3DTevBlock2 : public J3DTevBlock { +public: + /* 80317810 */ void initialize(); + + /* 803206AC */ virtual void reset(J3DTevBlock*); + /* 8031AFA4 */ virtual void load(); + /* 8031D3D0 */ virtual void diffTexNo(); + /* 8031D434 */ virtual void diffTevReg(); + /* 8031D694 */ virtual void diffTexCoordScale(); + /* 8031D4D0 */ virtual void diffTevStage(); + /* 8031D5E4 */ virtual void diffTevStageIndirect(); + /* 8031C6A8 */ virtual void patch(); + /* 8031C3F8 */ virtual void patchTexNo(); + /* 8031C48C */ virtual void patchTevReg(); + /* 8031C558 */ virtual void patchTexNoAndTexCoordScale(); + /* 803223AC */ virtual void ptrToIndex(); + /* 803223B0 */ virtual void indexToPtr(); + /* 803223D4 */ virtual void getType(); + /* 80317BC4 */ virtual s32 countDLSize(); + /* 803223F0 */ virtual void setTexNo(u32, u16 const*); + /* 803223E0 */ virtual void setTexNo(u32, u16); + /* 80322404 */ virtual void getTexNo(u32) const; + /* 80322428 */ virtual void setTevOrder(u32, J3DTevOrder const*); + /* 80322414 */ virtual void setTevOrder(u32, J3DTevOrder); + /* 8032243C */ virtual void getTevOrder(u32); + /* 8032247C */ virtual void setTevColor(u32, J3DGXColorS10 const*); + /* 80322450 */ virtual void setTevColor(u32, J3DGXColorS10); + /* 803224A8 */ virtual void getTevColor(u32); + /* 803224E8 */ virtual void setTevKColor(u32, J3DGXColor const*); + /* 803224BC */ virtual void setTevKColor(u32, J3DGXColor); + /* 80322514 */ virtual void getTevKColor(u32); + /* 80322534 */ virtual void setTevKColorSel(u32, u8 const*); + /* 80322528 */ virtual void setTevKColorSel(u32, u8); + /* 80322544 */ virtual void getTevKColorSel(u32); + /* 8032255C */ virtual void setTevKAlphaSel(u32, u8 const*); + /* 80322550 */ virtual void setTevKAlphaSel(u32, u8); + /* 8032256C */ virtual void getTevKAlphaSel(u32); + /* 80322580 */ virtual void setTevStageNum(u8 const*); + /* 80322578 */ virtual void setTevStageNum(u8); + /* 8032258C */ virtual void getTevStageNum() const; + /* 803225D0 */ virtual void setTevStage(u32, J3DTevStage const*); + /* 80322594 */ virtual void setTevStage(u32, J3DTevStage); + /* 8032260C */ virtual void getTevStage(u32); + /* 80322658 */ virtual void setTevSwapModeInfo(u32, J3DTevSwapModeInfo const*); + /* 80322620 */ virtual void setTevSwapModeInfo(u32, J3DTevSwapModeInfo); + /* 803226A0 */ virtual void setTevSwapModeTable(u32, J3DTevSwapModeTable const*); + /* 80322690 */ virtual void setTevSwapModeTable(u32, J3DTevSwapModeTable); + /* 803226B0 */ virtual void getTevSwapModeTable(u32); + /* 803226D4 */ virtual void setIndTevStage(u32, J3DIndTevStage const*); + /* 803226C0 */ virtual void setIndTevStage(u32, J3DIndTevStage); + /* 803226E8 */ virtual void getIndTevStage(u32); + /* 803226FC */ virtual void getTexNoOffset() const; + /* 80322704 */ virtual void getTevRegOffset() const; + /* 8032270C */ virtual void setTevRegOffset(u32); + /* 80322714 */ virtual ~J3DTevBlock2(); + +private: + /* 0x08 */ u16 mTexNo[2]; + /* 0x0C */ J3DTevOrder mTevOrder[2]; + /* 0x14 */ J3DGXColorS10 mTevColor[4]; + /* 0x34 */ u8 mTevStageNum; + /* 0x35 */ J3DTevStage mTevStage[2]; + /* 0x45 */ J3DGXColor mTevKColor[4]; + /* 0x55 */ u8 mTevKColorSel[2]; + /* 0x57 */ u8 mTevKAlphaSel[2]; + /* 0x59 */ J3DTevSwapModeTable mTevSwapModeTable[4]; + /* 0x60 */ J3DIndTevStage mIndTevStage[2]; + /* 0x68 */ u32 mTevRegOffset; +}; // Size: 0x6C + +class J3DTevBlock16 : public J3DTevBlock { +public: + /* 80317A00 */ void initialize(); + + /* 80320E24 */ virtual void reset(J3DTevBlock*); + /* 8031BA04 */ virtual void load(); + /* 8031DB14 */ virtual void diffTexNo(); + /* 8031DB78 */ virtual void diffTevReg(); + /* 8031DDD8 */ virtual void diffTexCoordScale(); + /* 8031DC14 */ virtual void diffTevStage(); + /* 8031DD28 */ virtual void diffTevStageIndirect(); + /* 8031CCF8 */ virtual void patch(); + /* 8031CA1C */ virtual void patchTexNo(); + /* 8031CAB0 */ virtual void patchTevReg(); + /* 8031CB7C */ virtual void patchTexNoAndTexCoordScale(); + /* 8031DED0 */ virtual void ptrToIndex(); + /* 80321C20 */ virtual void indexToPtr(); + /* 80321C44 */ virtual void getType(); + /* 80317BD4 */ virtual s32 countDLSize(); + /* 80321C60 */ virtual void setTexNo(u32, u16 const*); + /* 80321C50 */ virtual void setTexNo(u32, u16); + /* 80321C74 */ virtual void getTexNo(u32) const; + /* 80321C98 */ virtual void setTevOrder(u32, J3DTevOrder const*); + /* 80321C84 */ virtual void setTevOrder(u32, J3DTevOrder); + /* 80321CAC */ virtual void getTevOrder(u32); + /* 80321CEC */ virtual void setTevColor(u32, J3DGXColorS10 const*); + /* 80321CC0 */ virtual void setTevColor(u32, J3DGXColorS10); + /* 80321D18 */ virtual void getTevColor(u32); + /* 80321D58 */ virtual void setTevKColor(u32, J3DGXColor const*); + /* 80321D2C */ virtual void setTevKColor(u32, J3DGXColor); + /* 80321D84 */ virtual void getTevKColor(u32); + /* 80321DA4 */ virtual void setTevKColorSel(u32, u8 const*); + /* 80321D98 */ virtual void setTevKColorSel(u32, u8); + /* 80321DB4 */ virtual void getTevKColorSel(u32); + /* 80321DCC */ virtual void setTevKAlphaSel(u32, u8 const*); + /* 80321DC0 */ virtual void setTevKAlphaSel(u32, u8); + /* 80321DDC */ virtual void getTevKAlphaSel(u32); + /* 80321DE8 */ virtual void setTevStageNum(u8); + /* 80321DF0 */ virtual void setTevStageNum(u8 const*); + /* 80321DFC */ virtual void getTevStageNum() const; + /* 80321E40 */ virtual void setTevStage(u32, J3DTevStage const*); + /* 80321E04 */ virtual void setTevStage(u32, J3DTevStage); + /* 80321E7C */ virtual void getTevStage(u32); + /* 80321EC8 */ virtual void setTevSwapModeInfo(u32, J3DTevSwapModeInfo const*); + /* 80321E90 */ virtual void setTevSwapModeInfo(u32, J3DTevSwapModeInfo); + /* 80321F10 */ virtual void setTevSwapModeTable(u32, J3DTevSwapModeTable const*); + /* 80321F00 */ virtual void setTevSwapModeTable(u32, J3DTevSwapModeTable); + /* 80321F20 */ virtual void getTevSwapModeTable(u32); + /* 80321F44 */ virtual void setIndTevStage(u32, J3DIndTevStage const*); + /* 80321F30 */ virtual void setIndTevStage(u32, J3DIndTevStage); + /* 80321F58 */ virtual void getIndTevStage(u32); + /* 80321F6C */ virtual void getTexNoOffset() const; + /* 80321F74 */ virtual void getTevRegOffset() const; + /* 80321F7C */ virtual void setTevRegOffset(u32); + /* 80321F84 */ virtual ~J3DTevBlock16(); + +private: + /* 0x008 */ u16 mTexNo[8]; + /* 0x018 */ J3DTevOrder mTevOrder[16]; + /* 0x058 */ u8 mTevStageNum; + /* 0x059 */ J3DTevStage mTevStage[16]; + /* 0x0DA */ J3DGXColorS10 mTevColor[4]; + /* 0x0FA */ J3DGXColor mTevKColor[4]; + /* 0x10A */ u8 mTevKColorSel[16]; + /* 0x11A */ u8 mTevKAlphaSel[16]; + /* 0x12A */ J3DTevSwapModeTable mTevSwapModeTable[4]; + /* 0x130 */ J3DIndTevStage mIndTevStage[16]; + /* 0x170 */ u32 mTevRegOffset; +}; // Size: 0x174 + +class J3DTevBlock1 : public J3DTevBlock { +public: + /* 803177E8 */ void initialize(); + + /* 803205D4 */ virtual void reset(J3DTevBlock*); + /* 8031AD64 */ virtual void load(); + /* 8031D1BC */ virtual void diffTexNo(); + /* 8031D1F4 */ virtual void diffTevReg(); + /* 8031D368 */ virtual void diffTexCoordScale(); + /* 8031D1F8 */ virtual void diffTevStage(); + /* 8031D2E8 */ virtual void diffTevStageIndirect(); + /* 8031C3CC */ virtual void patch(); + /* 8031C274 */ virtual void patchTexNo(); + /* 8031C2E4 */ virtual void patchTevReg(); + /* 8031C2E8 */ virtual void patchTexNoAndTexCoordScale(); + /* 80322770 */ virtual void ptrToIndex(); + /* 80322774 */ virtual void indexToPtr(); + /* 80322798 */ virtual void getType(); + /* 80317BBC */ virtual s32 countDLSize(); + /* 803227B4 */ virtual void setTexNo(u32, u16 const*); + /* 803227A4 */ virtual void setTexNo(u32, u16); + /* 803227C8 */ virtual void getTexNo(u32) const; + /* 803227EC */ virtual void setTevOrder(u32, J3DTevOrder const*); + /* 803227D8 */ virtual void setTevOrder(u32, J3DTevOrder); + /* 80322800 */ virtual void getTevOrder(u32); + /* 80322818 */ virtual void setTevStageNum(u8 const*); + /* 80322814 */ virtual void setTevStageNum(u8); + /* 8032281C */ virtual bool getTevStageNum() const; + /* 80322860 */ virtual void setTevStage(u32, J3DTevStage const*); + /* 80322824 */ virtual void setTevStage(u32, J3DTevStage); + /* 8032289C */ virtual void getTevStage(u32); + /* 803228C4 */ virtual void setIndTevStage(u32, J3DIndTevStage const*); + /* 803228B0 */ virtual void setIndTevStage(u32, J3DIndTevStage); + /* 803228D8 */ virtual void getIndTevStage(u32); + /* 803228EC */ virtual void getTexNoOffset() const; + /* 803228F4 */ virtual ~J3DTevBlock1(); + +private: + /* 0x08 */ u16 mTexNo[1]; + /* 0x0A */ J3DTevOrder mTevOrder[1]; + /* 0x0E */ J3DTevStage mTevStage[1]; + /* 0x18 */ J3DIndTevStage mIndTevStage[1]; +}; // Size: 0x1C + +struct J3DZMode { + /* 0x0 */ u16 mZModeID; +}; + +struct J3DBlendInfo { + /* 0x0 */ u8 mType; + /* 0x1 */ u8 mSrcFactor; + /* 0x2 */ u8 mDstFactor; + /* 0x3 */ u8 mOp; +}; + +struct J3DBlend : public J3DBlendInfo {}; + +struct J3DFogInfo { + /* 80325800 */ void operator=(J3DFogInfo const&); + + /* 0x00 */ u8 field_0x0; + /* 0x01 */ u8 field_0x1; + /* 0x02 */ u16 field_0x2; + /* 0x04 */ f32 field_0x4; + /* 0x08 */ f32 field_0x8; + /* 0x0C */ f32 field_0xc; + /* 0x10 */ f32 field_0x10; + /* 0x14 */ u8 field_0x14; + /* 0x15 */ u8 field_0x15; + /* 0x16 */ u8 field_0x16; + /* 0x17 */ u8 field_0x17; + /* 0x18 */ u16 field_0x18[10]; +}; // Size: 0x2C + +struct J3DFog : public J3DFogInfo {}; + +struct J3DAlphaComp { + /* 0x0 */ u16 field_0x0; + /* 0x2 */ u8 mRef0; + /* 0x3 */ u8 mRef1; +}; // Size: 0x4 + +class J3DPEBlock { +public: + /* 80317348 */ virtual void reset(J3DPEBlock*); + virtual void load() = 0; + /* 8000DBCC */ virtual void patch(); + /* 80317344 */ virtual void diff(u32); + /* 8031735C */ virtual void diffFog(); + /* 80317360 */ virtual void diffBlend(); + virtual bool countDLSize(); + virtual void getType() = 0; + /* 80317368 */ virtual void setFog(J3DFog); + /* 80317364 */ virtual void setFog(J3DFog*); + /* 8000DF5C */ virtual bool getFog(); + /* 8031736C */ virtual void setAlphaComp(J3DAlphaComp const*); + /* 8000E01C */ virtual void setAlphaComp(J3DAlphaComp const&); + /* 8000DF54 */ virtual bool getAlphaComp(); + /* 80317370 */ virtual void setBlend(J3DBlend const*); + /* 8000E018 */ virtual void setBlend(J3DBlend const&); + /* 8000DF4C */ virtual bool getBlend(); + /* 80317374 */ virtual void setZMode(J3DZMode const*); + /* 8000E014 */ virtual void setZMode(J3DZMode); + /* 8000DF44 */ virtual bool getZMode(); + /* 80317378 */ virtual void setZCompLoc(u8 const*); + /* 8000E010 */ virtual void setZCompLoc(u8); + /* 8000DF3C */ virtual bool getZCompLoc() const; + /* 80317380 */ virtual void setDither(u8 const*); + /* 8031737C */ virtual void setDither(u8); + /* 80317384 */ virtual bool getDither() const; + /* 8031738C */ virtual bool getFogOffset() const; + /* 80317394 */ virtual void setFogOffset(u32); + virtual ~J3DPEBlock(); +}; + +class J3DPEBlockXlu : public J3DPEBlock { +public: + /* 8031E98C */ virtual void load(); + /* 80317BF4 */ virtual s32 countDLSize(); + /* 80323258 */ virtual void getType(); + /* 80323264 */ virtual ~J3DPEBlockXlu(); +}; + +class J3DPEBlockTexEdge : public J3DPEBlock { +public: + /* 8031E6C8 */ virtual void load(); + /* 80317BEC */ virtual s32 countDLSize(); + /* 803232C0 */ virtual void getType(); + /* 803232CC */ virtual ~J3DPEBlockTexEdge(); +}; + +class J3DPEBlockOpa : public J3DPEBlock { +public: + /* 8031E408 */ virtual void load(); + /* 80317BE4 */ virtual s32 countDLSize(); + /* 80323328 */ virtual void getType(); + /* 80323334 */ virtual ~J3DPEBlockOpa(); +}; + +class J3DPEBlockFull : public J3DPEBlock { +public: + /* 80317B58 */ void initialize(); + + /* 8032129C */ virtual void reset(J3DPEBlock*); + /* 8031F3C0 */ virtual void load(); + /* 8031F890 */ virtual void patch(); + /* 8031FCA0 */ virtual void diff(u32); + /* 8031F940 */ virtual void diffFog(); + /* 8031F9B8 */ virtual void diffBlend(); + /* 80317C04 */ virtual s32 countDLSize(); + /* 8032194C */ virtual void getType(); + /* 8032197C */ virtual void setFog(J3DFog); + /* 80321958 */ virtual void setFog(J3DFog*); + /* 803219A0 */ virtual void getFog(); + /* 803219C4 */ virtual void setAlphaComp(J3DAlphaComp const*); + /* 803219A8 */ virtual void setAlphaComp(J3DAlphaComp const&); + /* 803219E0 */ virtual void getAlphaComp(); + /* 803219F4 */ virtual void setBlend(J3DBlend const*); + /* 803219E8 */ virtual void setBlend(J3DBlend const&); + /* 80321A00 */ virtual void getBlend(); + /* 80321A14 */ virtual void setZMode(J3DZMode const*); + /* 80321A08 */ virtual void setZMode(J3DZMode); + /* 80321A20 */ virtual void getZMode(); + /* 80321A30 */ virtual void setZCompLoc(u8 const*); + /* 80321A28 */ virtual void setZCompLoc(u8); + /* 80321A3C */ virtual void getZCompLoc() const; + /* 80321A4C */ virtual void setDither(u8 const*); + /* 80321A44 */ virtual void setDither(u8); + /* 80321A58 */ virtual void getDither() const; + /* 80321A60 */ virtual void getFogOffset() const; + /* 80321A68 */ virtual void setFogOffset(u32); + /* 80321A70 */ virtual ~J3DPEBlockFull(); + +private: + /* 0x04 */ J3DFog mFog; + /* 0x30 */ J3DAlphaComp mAlphaComp; + /* 0x34 */ J3DBlend mBlend; + /* 0x38 */ J3DZMode mZMode; + /* 0x3A */ u8 mZCompLoc; + /* 0x3B */ u8 mDither; + /* 0x3C */ u32 mFogOffset; +}; // Size: 0x40 + +class J3DPEBlockFogOff : public J3DPEBlock { +public: + /* 80317B34 */ void initialize(); + + /* 803211B4 */ virtual void reset(J3DPEBlock*); + /* 8031EC50 */ virtual void load(); + /* 80321ACC */ virtual void diff(u32); + /* 8031F0D8 */ virtual void diffBlend(); + /* 80317BFC */ virtual s32 countDLSize(); + /* 80321B00 */ virtual void getType(); + /* 80321B28 */ virtual void setAlphaComp(J3DAlphaComp const*); + /* 80321B0C */ virtual void setAlphaComp(J3DAlphaComp const&); + /* 80321B44 */ virtual void getAlphaComp(); + /* 80321B58 */ virtual void setBlend(J3DBlend const*); + /* 80321B4C */ virtual void setBlend(J3DBlend const&); + /* 80321B64 */ virtual void getBlend(); + /* 80321B78 */ virtual void setZMode(J3DZMode const*); + /* 80321B6C */ virtual void setZMode(J3DZMode); + /* 80321B84 */ virtual void getZMode(); + /* 80321B94 */ virtual void setZCompLoc(u8 const*); + /* 80321B8C */ virtual void setZCompLoc(u8); + /* 80321BA0 */ virtual void getZCompLoc() const; + /* 80321BB0 */ virtual void setDither(u8 const*); + /* 80321BA8 */ virtual void setDither(u8); + /* 80321BBC */ virtual void getDither() const; + /* 80321BC4 */ virtual ~J3DPEBlockFogOff(); + +private: + /* 0x04 */ J3DAlphaComp mAlphaComp; + /* 0x08 */ J3DBlend mBlend; + /* 0x0C */ J3DZMode mZMode; + /* 0x0E */ u8 mZCompLoc; + /* 0x0F */ u8 mDither; +}; // Size: 0x10 + +struct J3DIndTexCoordScale { + /* 8000E024 */ ~J3DIndTexCoordScale(); + /* 8000E0E4 */ J3DIndTexCoordScale(); + + /* 0x0 */ u8 mScaleS; + /* 0x1 */ u8 mScaleT; +}; + +struct J3DIndTexMtx { + /* 8000E064 */ ~J3DIndTexMtx(); + /* 8000E0F0 */ J3DIndTexMtx(); + + /* 0x00 */ Mtx23 mOffsetMtx; + /* 0x18 */ u8 mScaleExp; +}; // Size: 0x1C + +struct J3DIndTexOrder { + /* 8000E128 */ J3DIndTexOrder(); + + /* 0x0 */ u8 mMap; + /* 0x1 */ u8 mCoord; +}; + +class J3DIndBlock { +public: + /* 8031734C */ virtual void reset(J3DIndBlock*); + virtual void load() = 0; + virtual void diff(u32) = 0; + /* 80317314 */ virtual bool countDLSize(); + virtual void getType() = 0; + /* 8000E0A0 */ virtual void setIndTexStageNum(u8); + /* 8000DF7C */ virtual bool getIndTexStageNum() const; + /* 80317410 */ virtual void setIndTexOrder(u32, J3DIndTexOrder); + /* 8031740C */ virtual void setIndTexOrder(u32, J3DIndTexOrder const*); + /* 8000DF74 */ virtual bool getIndTexOrder(u32); + /* 80317414 */ virtual void setIndTexMtx(u32, J3DIndTexMtx const*); + /* 8000E060 */ virtual void setIndTexMtx(u32, J3DIndTexMtx); + /* 8000DF6C */ virtual bool getIndTexMtx(u32); + /* 8000E020 */ virtual void setIndTexCoordScale(u32, J3DIndTexCoordScale); + /* 80317418 */ virtual void setIndTexCoordScale(u32, J3DIndTexCoordScale const*); + /* 8000DF64 */ virtual bool getIndTexCoordScale(u32); + /* 8031726C */ virtual ~J3DIndBlock(); +}; + +class J3DIndBlockFull : public J3DIndBlock { +public: + /* 80317B28 */ void initialize(); + + /* 803210B0 */ virtual void reset(J3DIndBlock*); + /* 8031E328 */ virtual void diff(u32); + /* 8031E12C */ virtual void load(); + /* 80317BDC */ virtual s32 countDLSize(); + /* 80323390 */ virtual void getType(); + /* 8032339C */ virtual void setIndTexStageNum(u8); + /* 803233A4 */ virtual void getIndTexStageNum() const; + /* 803233AC */ virtual void setIndTexOrder(u32, J3DIndTexOrder); + /* 803233C0 */ virtual void setIndTexOrder(u32, J3DIndTexOrder const*); + /* 803233D4 */ virtual void getIndTexOrder(u32); + /* 8032341C */ virtual void setIndTexMtx(u32, J3DIndTexMtx const*); + /* 803233E8 */ virtual void setIndTexMtx(u32, J3DIndTexMtx); + /* 80323450 */ virtual void getIndTexMtx(u32); + /* 80323478 */ virtual void setIndTexCoordScale(u32, J3DIndTexCoordScale const*); + /* 80323464 */ virtual void setIndTexCoordScale(u32, J3DIndTexCoordScale); + /* 8032348C */ virtual void getIndTexCoordScale(u32); + /* 803234A0 */ virtual ~J3DIndBlockFull(); + +private: + /* 0x04 */ u8 mIndTexStageNum; + /* 0x05 */ J3DIndTexOrder mIndTexOrder[4]; + /* 0x18 */ J3DIndTexMtx mIndTexMtx[3]; + /* 0x6C */ J3DIndTexCoordScale mIndTexCoordScale[4]; +}; // Size: 0x7C + +class J3DIndBlockNull : public J3DIndBlock { +public: + /* 803173A0 */ virtual void reset(J3DIndBlock*); + /* 80317398 */ virtual void diff(u32); + /* 8031739C */ virtual void load(); + /* 803173A4 */ virtual void getType(); + /* 803173B0 */ virtual ~J3DIndBlockNull(); +}; + +struct J3DColorChanInfo { + /* 0x0 */ u8 field_0x0; + /* 0x1 */ u8 field_0x1; + /* 0x2 */ u8 field_0x2; + /* 0x3 */ u8 field_0x3; + /* 0x4 */ u8 field_0x4; + /* 0x5 */ u8 field_0x5; +}; + +struct J3DColorChan { + /* 8000E47C */ J3DColorChan(); + + /* 0x0 */ u16 mColorChanID; +}; + +class J3DColorBlock { +public: + /* 80317324 */ virtual void load(); + /* 80317358 */ virtual void reset(J3DColorBlock*); + /* 8031733C */ virtual void patch(); + /* 80317434 */ virtual void patchMatColor(); + /* 8000DBD0 */ virtual void patchLight(); + /* 80317340 */ virtual void diff(u32); + /* 80317438 */ virtual void diffAmbColor(); + /* 8031743C */ virtual void diffMatColor(); + /* 80317440 */ virtual void diffColorChan(); + /* 80317444 */ virtual void diffLightObj(u32); + /* 80317304 */ virtual bool countDLSize(); + virtual void getType() = 0; + /* 80317448 */ virtual void setMatColor(u32, J3DGXColor const*); + /* 8000E0DC */ virtual void setMatColor(u32, J3DGXColor); + /* 8000E000 */ virtual _GXColor* getMatColor(u32); + /* 801A4C0C */ virtual void setAmbColor(u32, J3DGXColor const*); + /* 8000E0D4 */ virtual void setAmbColor(u32, J3DGXColor); + /* 8000DFF0 */ virtual bool getAmbColor(u32); + /* 8000E0E0 */ virtual void setColorChanNum(u8); + /* 8031744C */ virtual void setColorChanNum(u8 const*); + /* 8000E008 */ virtual bool getColorChanNum() const; + /* 8000E0D8 */ virtual void setColorChan(u32, J3DColorChan const&); + /* 80317450 */ virtual void setColorChan(u32, J3DColorChan const*); + /* 8000DFF8 */ virtual bool getColorChan(u32); + /* 801A4C08 */ virtual void setLight(u32, J3DLightObj*); + /* 80317454 */ virtual bool getLight(u32); + /* 80317460 */ virtual void setCullMode(u8 const*); + /* 8031745C */ virtual void setCullMode(u8); + /* 80317328 */ virtual s32 getCullMode() const; + /* 80317464 */ virtual bool getMatColorOffset() const; + /* 8031746C */ virtual bool getColorChanOffset() const; + /* 80317474 */ virtual void setMatColorOffset(u32); + /* 80317478 */ virtual void setColorChanOffset(u32); + /* 80317138 */ virtual ~J3DColorBlock(); +}; + +class J3DColorBlockLightOn : public J3DColorBlock { +public: + /* 80317580 */ void initialize(); + + /* 803187F4 */ virtual void load(); + /* 8031FF34 */ virtual void reset(J3DColorBlock*); + /* 803194E8 */ virtual void patch(); + /* 80319534 */ virtual void patchMatColor(); + /* 803196E0 */ virtual void patchLight(); + /* 8031A13C */ virtual void diff(u32); + /* 8031A1DC */ virtual void diffAmbColor(); + /* 8031A358 */ virtual void diffMatColor(); + /* 8031A4D4 */ virtual void diffColorChan(); + /* 8031A8E0 */ virtual void diffLightObj(u32); + /* 80317B94 */ virtual s32 countDLSize(); + /* 80322E80 */ virtual void getType(); + /* 80322EB8 */ virtual void setMatColor(u32, J3DGXColor const*); + /* 80322E8C */ virtual void setMatColor(u32, J3DGXColor); + /* 80322EE4 */ virtual void getMatColor(u32); + /* 80322F24 */ virtual void setAmbColor(u32, J3DGXColor const*); + /* 80322EF8 */ virtual void setAmbColor(u32, J3DGXColor); + /* 80322F50 */ virtual void getAmbColor(u32); + /* 80322F70 */ virtual void setColorChanNum(u8); + /* 80322F64 */ virtual void setColorChanNum(u8 const*); + /* 80322F78 */ virtual void getColorChanNum() const; + /* 80322F94 */ virtual void setColorChan(u32, J3DColorChan const&); + /* 80322F80 */ virtual void setColorChan(u32, J3DColorChan const*); + /* 80322FA8 */ virtual void getColorChan(u32); + /* 80322FBC */ virtual void setLight(u32, J3DLightObj*); + /* 80322FCC */ virtual void getLight(u32); + /* 80322FE4 */ virtual void setCullMode(u8 const*); + /* 80322FDC */ virtual void setCullMode(u8); + /* 80322FF0 */ virtual void getCullMode() const; + /* 80322FF8 */ virtual void getMatColorOffset() const; + /* 80323000 */ virtual void getColorChanOffset() const; + /* 80323008 */ virtual void setMatColorOffset(u32); + /* 80323010 */ virtual void setColorChanOffset(u32); + /* 80323018 */ virtual ~J3DColorBlockLightOn(); + +private: + /* 0x04 */ J3DGXColor mMatColor[2]; + /* 0x0C */ J3DGXColor mAmbColor[2]; + /* 0x14 */ u8 mColorChanNum; + /* 0x16 */ J3DColorChan mColorChan[4]; + /* 0x20 */ J3DLightObj* mLight[8]; + /* 0x40 */ u8 mCullMode; + /* 0x44 */ u32 mMatColorOffset; + /* 0x48 */ u32 mColorChanOffset; +}; // Size: 0x4C + +class J3DColorBlockLightOff : public J3DColorBlock { +public: + /* 8031747C */ void initialize(); + + /* 80317C0C */ virtual void load(); + /* 8031FD08 */ virtual void reset(J3DColorBlock*); + /* 80318EB4 */ virtual void patch(); + /* 80318F00 */ virtual void patchMatColor(); + /* 803190AC */ virtual void patchLight(); + /* 80319B4C */ virtual void diff(u32); + /* 80319BB4 */ virtual void diffMatColor(); + /* 80319D30 */ virtual void diffColorChan(); + /* 80317B84 */ virtual s32 countDLSize(); + /* 80323560 */ virtual void getType(); + /* 80323184 */ virtual void setMatColor(u32, J3DGXColor const*); + /* 80323158 */ virtual void setMatColor(u32, J3DGXColor); + /* 803231B0 */ virtual void getMatColor(u32); + /* 803231D0 */ virtual void setColorChanNum(u8); + /* 803231C4 */ virtual void setColorChanNum(u8 const*); + /* 803231D8 */ virtual void getColorChanNum() const; + /* 803231F4 */ virtual void setColorChan(u32, J3DColorChan const&); + /* 803231E0 */ virtual void setColorChan(u32, J3DColorChan const*); + /* 80323208 */ virtual void getColorChan(u32); + /* 80323224 */ virtual void setCullMode(u8 const*); + /* 8032321C */ virtual void setCullMode(u8); + /* 80323230 */ virtual void getCullMode() const; + /* 80323238 */ virtual void getMatColorOffset() const; + /* 80323240 */ virtual void getColorChanOffset() const; + /* 80323248 */ virtual void setMatColorOffset(u32); + /* 80323250 */ virtual void setColorChanOffset(u32); + /* 803170DC */ virtual ~J3DColorBlockLightOff(); + +private: + /* 0x04 */ J3DGXColor mMatColor[2]; + /* 0x0C */ u8 mColorChanNum; + /* 0x0E */ J3DColorChan mColorChan[4]; + /* 0x16 */ u8 mCullMode; + /* 0x18 */ u32 mMatColorOffset; + /* 0x1C */ u32 mColorChanOffset; +}; // Size: 0x20 + +class J3DColorBlockAmbientOn : public J3DColorBlockLightOff { +public: + /* 803174DC */ void initialize(); + + /* 8031816C */ virtual void load(); + /* 8031FDE4 */ virtual void reset(J3DColorBlock*); + /* 80317B8C */ virtual s32 countDLSize(); + /* 80323074 */ virtual void getType(); + /* 803230AC */ virtual void setAmbColor(u32, J3DGXColor const*); + /* 80323080 */ virtual void setAmbColor(u32, J3DGXColor); + /* 803230D8 */ virtual void getAmbColor(u32); + /* 803230EC */ virtual ~J3DColorBlockAmbientOn(); + +private: + /* 0x20 */ J3DGXColor mAmbColor[2]; +}; // Size: 0x28 + #endif /* J3DMATBLOCK_H */ diff --git a/include/JSystem/J3DGraphBase/J3DMaterial.h b/include/JSystem/J3DGraphBase/J3DMaterial.h index 65305008df..d4219a9985 100644 --- a/include/JSystem/J3DGraphBase/J3DMaterial.h +++ b/include/JSystem/J3DGraphBase/J3DMaterial.h @@ -1,6 +1,107 @@ #ifndef J3DMATERIAL_H #define J3DMATERIAL_H +#include "JSystem/J3DGraphBase/J3DMatBlock.h" +#include "JSystem/J3DGraphBase/J3DPacket.h" +#include "JSystem/J3DGraphBase/J3DShape.h" +#include "JSystem/J3DGraphBase/J3DStruct.h" +#include "JSystem/J3DGraphBase/J3DTevs.h" +#include "JSystem/J3DGraphBase/J3DTexture.h" #include "dolphin/types.h" +class J3DJoint; +class J3DMaterialAnm; + +class J3DMaterial { +public: + /* 803157A0 */ void createColorBlock(u32); + /* 803159A0 */ void createTexGenBlock(u32); + /* 80315B04 */ void createTevBlock(int); + /* 80315E78 */ void createIndBlock(int); + /* 80315F60 */ void createPEBlock(u32, u32); + /* 80316100 */ void calcSizeColorBlock(u32); + /* 80316150 */ void calcSizeTexGenBlock(u32); + /* 8031617C */ void calcSizeTevBlock(int); + /* 803161C4 */ void calcSizeIndBlock(int); + /* 803161D8 */ void calcSizePEBlock(u32, u32); + /* 80316240 */ void initialize(); + /* 80316290 */ u32 countDLSize(); + /* 80316344 */ void makeDisplayList_private(J3DDisplayListObj*); + /* 80316AB0 */ void setCurrentMtx(); + /* 80316AC8 */ void calcCurrentMtx(); + /* 80316D68 */ void copy(J3DMaterial*); + /* 80316E90 */ s32 newSharedDisplayList(u32); + /* 80316F24 */ s32 newSingleSharedDisplayList(u32); + + /* 803169DC */ virtual void calc(f32 const (*)[4]); + /* 80316A54 */ virtual void calcDiffTexMtx(f32 const (*)[4]); + /* 80316620 */ virtual void makeDisplayList(); + /* 80316668 */ virtual void makeSharedDisplayList(); + /* 8031668C */ virtual void load(); + /* 803166DC */ virtual void loadSharedDL(); + /* 80316740 */ virtual void patch(); + /* 803167D8 */ virtual void diff(u32); + /* 80316E14 */ virtual void reset(); + /* 80316E70 */ virtual void change(); + + J3DMaterial* getNext() const { return mNext; } + J3DTevBlock* getTevBlock() const { return mTevBlock; } + J3DColorBlock* getColorBlock() const { return mColorBlock; } + J3DTexGenBlock* getTexGenBlock() const { return mTexGenBlock; } + J3DDisplayListObj* getSharedDisplayListObj() const { return mSharedDLObj; } + J3DMaterialAnm* getMaterialAnm() const { + if ((u32)mMaterialAnm < 0xC0000000) { + return mMaterialAnm; + } else { + return NULL; + } + } + +private: + /* 0x04 */ J3DMaterial* mNext; + /* 0x08 */ J3DShape* mShape; + /* 0x0C */ J3DJoint* mJoint; + /* 0x10 */ u32 mMaterialMode; + /* 0x14 */ u16 mIndex; + /* 0x18 */ u32 mInvalid; + /* 0x1C */ u32 field_0x1c; + /* 0x20 */ u32 field_0x20; + /* 0x24 */ J3DColorBlock* mColorBlock; + /* 0x28 */ J3DTexGenBlock* mTexGenBlock; + /* 0x2C */ J3DTevBlock* mTevBlock; + /* 0x30 */ J3DIndBlock* mIndBlock; + /* 0x34 */ J3DPEBlock* mPEBlock; + /* 0x38 */ J3DMaterial* field_0x38; + /* 0x3C */ J3DMaterialAnm* mMaterialAnm; + /* 0x40 */ J3DCurrentMtx mCurrentMtx; + /* 0x48 */ J3DDisplayListObj* mSharedDLObj; +}; + +class J3DPatchedMaterial : public J3DMaterial { +public: + /* 80316FB8 */ void initialize(); + + /* 80316FD8 */ virtual void makeDisplayList(); + /* 80316FDC */ virtual void makeSharedDisplayList(); + /* 80316FE0 */ virtual void load(); + /* 80316FFC */ virtual void loadSharedDL(); + /* 8031703C */ virtual void reset(); + /* 80317040 */ virtual void change(); +}; + +class J3DLockedMaterial : public J3DMaterial { +public: + /* 80317044 */ void initialize(); + + /* 803170D0 */ virtual void calc(f32 const (*)[4]); + /* 80317064 */ virtual void makeDisplayList(); + /* 80317068 */ virtual void makeSharedDisplayList(); + /* 8031706C */ virtual void load(); + /* 80317088 */ virtual void loadSharedDL(); + /* 803170C8 */ virtual void patch(); + /* 803170CC */ virtual void diff(u32); + /* 803170D4 */ virtual void reset(); + /* 803170D8 */ virtual void change(); +}; + #endif /* J3DMATERIAL_H */ diff --git a/include/JSystem/J3DGraphBase/J3DPacket.h b/include/JSystem/J3DGraphBase/J3DPacket.h index 3ef6ac0840..cca1e0c60b 100644 --- a/include/JSystem/J3DGraphBase/J3DPacket.h +++ b/include/JSystem/J3DGraphBase/J3DPacket.h @@ -2,6 +2,7 @@ #define J3DPACKET_H #include "JSystem/J3DGraphBase/J3DSys.h" +#include "dolphin/gd/GDBase.h" #include "dolphin/mtx/mtx.h" #include "dolphin/types.h" @@ -18,6 +19,13 @@ class J3DTexture; class J3DDisplayListObj { public: + J3DDisplayListObj() { + mpData[0] = NULL; + mpData[1] = NULL; + mSize = 0; + mCapacity = 0; + } + J3DError newDisplayList(u32); J3DError newSingleDisplayList(u32); J3DError single_To_Double(); @@ -25,17 +33,20 @@ public: void swapBuffer(); void callDL() const; void beginDL(); - void endDL(); + u32 endDL(); void beginPatch(); - void endPatch(); + u32 endPatch(); + + u8* getDisplayList(int idx) const { return (u8*)mpData[idx]; } + u32 getDisplayListSize() const { return mSize; } - static u8 sGDLObj[16]; - static u8 sInterruptFlag[4 + 4 /* padding */]; + static GDLObj sGDLObj; + static s32 sInterruptFlag; - void* mpData[2]; - u32 mSize; - u32 mCapacity; -}; + /* 0x0 */ void* mpData[2]; + /* 0x8 */ u32 mSize; + /* 0xC */ u32 mCapacity; +}; // Size: 0x10 class J3DPacket { public: @@ -45,14 +56,14 @@ public: mpUserData = NULL; } - void addChildPacket(J3DPacket* pChild); + void addChildPacket(J3DPacket*); inline void clear() { mpNextSibling = NULL; mpFirstChild = NULL; } - virtual bool entry(J3DDrawBuffer* pDrawBuffer); + virtual bool entry(J3DDrawBuffer*); virtual void draw(); virtual ~J3DPacket(); @@ -60,7 +71,7 @@ public: /* 0x04 */ J3DPacket* mpNextSibling; /* 0x08 */ J3DPacket* mpFirstChild; /* 0x0C */ void* mpUserData; -}; // Size = 0x10 +}; // Size: 0x10 class J3DDrawPacket : public J3DPacket { public: @@ -70,31 +81,37 @@ public: J3DError newSingleDisplayList(u32); virtual void draw(); + J3DDisplayListObj* getDisplayListObj() { return mpDisplayListObj; } + void setDisplayListObj(J3DDisplayListObj* pObj) { mpDisplayListObj = pObj; } + public: - int mFlags; - char mPad0[0x0C]; // unk - J3DDisplayListObj* mpDisplayListObj; - J3DTexMtx* mpTexMtx; -}; + /* 0x10 */ u32 mFlags; + /* 0x14 */ char mPad0[0x0C]; // unk + /* 0x20 */ J3DDisplayListObj* mpDisplayListObj; + /* 0x24 */ J3DTexMtx* mpTexMtx; +}; // Size: 0x28 class J3DShapePacket : public J3DDrawPacket { public: J3DShapePacket(); - void calcDifferedBufferSize(u32); - void newDifferedDisplayList(u32); + u32 calcDifferedBufferSize(u32); + J3DError newDifferedDisplayList(u32); void prepareDraw() const; void drawFast(); virtual ~J3DShapePacket(); virtual void draw(); + void setShape(J3DShape* pShape) { mpShape = pShape; } + void setModel(J3DModel* pModel) { mpModel = pModel; } + public: - J3DShape* mpShape; - J3DMtxBuffer* mpMtxBuffer; - Mtx* mpViewMtx; - u32 mDiffFlag; - J3DModel* mpModel; -}; + /* 0x28 */ J3DShape* mpShape; + /* 0x2C */ J3DMtxBuffer* mpMtxBuffer; + /* 0x30 */ Mtx* mpViewMtx; + /* 0x34 */ u32 mDiffFlag; + /* 0x38 */ J3DModel* mpModel; +}; // Size: 0x3C class J3DMatPacket : public J3DDrawPacket { public: @@ -102,19 +119,19 @@ public: void addShapePacket(J3DShapePacket*); void beginDiff(); void endDiff(); - void isSame(J3DMatPacket*) const; + bool isSame(J3DMatPacket*) const; virtual ~J3DMatPacket(); - virtual bool entry(J3DDrawBuffer* pDrawBuffer); + virtual bool entry(J3DDrawBuffer*); virtual void draw(); public: - J3DShapePacket* mpShapePacket; - J3DShapePacket* mpFirstShapePacket; - J3DMaterial* mpMaterial; - s32 mSortFlags; - J3DTexture* mpTexture; - J3DMaterialAnm* mpMaterialAnm; -}; + /* 0x28 */ J3DShapePacket* mpShapePacket; + /* 0x2C */ J3DShapePacket* mpFirstShapePacket; + /* 0x30 */ J3DMaterial* mpMaterial; + /* 0x34 */ u32 mSortFlags; + /* 0x38 */ J3DTexture* mpTexture; + /* 0x3C */ J3DMaterialAnm* mpMaterialAnm; +}; // Size: 0x40 #endif /* J3DPACKET_H */ diff --git a/include/JSystem/J3DGraphBase/J3DShape.h b/include/JSystem/J3DGraphBase/J3DShape.h index 5496e77094..9410d61ab9 100644 --- a/include/JSystem/J3DGraphBase/J3DShape.h +++ b/include/JSystem/J3DGraphBase/J3DShape.h @@ -31,7 +31,7 @@ public: /* 80314DA8 */ void calcNBTScale(Vec const&, f32 (*)[3][3], f32 (*)[3][3]); /* 80314E28 */ void countBumpMtxNum() const; /* 80314EEC */ void loadVtxArray() const; - /* 80314F5C */ void isSameVcdVatCmd(J3DShape*); + /* 80314F5C */ bool isSameVcdVatCmd(J3DShape*); /* 80314F98 */ void makeVtxArrayCmd(); /* 80315260 */ void makeVcdVatCmd(); /* 80315300 */ void loadPreDrawSetting() const; @@ -42,6 +42,13 @@ public: /* 80315628 */ virtual void simpleDraw() const; /* 803156AC */ virtual void simpleDrawCache() const; + void onFlag(u32 flag) { mFlags |= flag; } + void offFlag(u32 flag) { mFlags &= ~flag; } + void setDrawMtxDataPointer(J3DDrawMtxData* pMtxData) { mDrawMtxData = pMtxData; } + void setVertexDataPointer(J3DVertexData* pVtxData) { mVertexData = pVtxData; } + void* getVcdVatCmd() const { return mVcdVatCmd; } + void setVcdVatCmd(void* pVatCmd) { mVcdVatCmd = pVatCmd; } + static void resetVcdVatCache() { sOldVcdVatCmd = NULL; } static void* sOldVcdVatCmd; diff --git a/include/JSystem/J3DGraphBase/J3DShapeMtx.h b/include/JSystem/J3DGraphBase/J3DShapeMtx.h index 1b52660e25..bfc1f90c33 100644 --- a/include/JSystem/J3DGraphBase/J3DShapeMtx.h +++ b/include/JSystem/J3DGraphBase/J3DShapeMtx.h @@ -29,4 +29,66 @@ private: /* 0x04 */ u16 mUseMtxIndex; }; +class J3DShapeMtxConcatView : public J3DShapeMtx { +public: + /* 80314730 */ virtual ~J3DShapeMtxConcatView(); + /* 8031478C */ virtual void getType() const; + /* 80313C54 */ virtual void load() const; + /* 80314598 */ virtual void loadNrmMtx(int, u16) const; + /* 80313D28 */ virtual void loadNrmMtx(int, u16, f32 (*)[4]) const; + + /* 80313828 */ void loadMtxConcatView_PNGP(int, u16) const; + /* 803138C8 */ void loadMtxConcatView_PCPU(int, u16) const; + /* 8031396C */ void loadMtxConcatView_NCPU(int, u16) const; + /* 80313A14 */ void loadMtxConcatView_PNCPU(int, u16) const; + /* 80313AC8 */ void loadMtxConcatView_PNGP_LOD(int, u16) const; + + static u8 sMtxLoadPipeline[48]; + static u8 sMtxLoadLODPipeline[48]; + static u8 sMtxPtrTbl[8]; +}; + +class J3DShapeMtxYBBoardConcatView : public J3DShapeMtxConcatView { +public: + /* 80314520 */ virtual ~J3DShapeMtxYBBoardConcatView(); + /* 8031458C */ virtual void getType() const; + /* 803143E4 */ virtual void load() const; +}; + +class J3DShapeMtxBBoardConcatView : public J3DShapeMtxConcatView { +public: + /* 803145A4 */ virtual ~J3DShapeMtxBBoardConcatView(); + /* 80314610 */ virtual void getType() const; + /* 803142D4 */ virtual void load() const; +}; + +class J3DShapeMtxMulti : public J3DShapeMtx { +public: + /* 803146B0 */ virtual ~J3DShapeMtxMulti(); + /* 8031470C */ virtual void getType() const; + /* 80314718 */ virtual void getUseMtxNum() const; + /* 80314720 */ virtual void getUseMtxIndex(u16) const; + /* 80313E4C */ virtual void load() const; + /* 80313EEC */ virtual void calcNBTScale(Vec const&, f32 (*)[3][3], f32 (*)[3][3]); + +private: + /* 0x6 */ u16 mUseMtxNum; + /* 0x8 */ u16* mUseMtxIndex; +}; + +class J3DShapeMtxMultiConcatView : public J3DShapeMtx { +public: + /* 8031461C */ virtual ~J3DShapeMtxMultiConcatView(); + /* 80314688 */ virtual void getType() const; + /* 80314694 */ virtual void getUseMtxNum() const; + /* 8031469C */ virtual void getUseMtxIndex(u16) const; + /* 80313FA4 */ virtual void load() const; + /* 803146AC */ virtual void loadNrmMtx(int, u16) const; + /* 8031419C */ virtual void loadNrmMtx(int, u16, f32 (*)[4]) const; + +private: + /* 0x6 */ u16 mUseMtxNum; + /* 0x8 */ u16* mUseMtxIndex; +}; + #endif /* J3DSHAPEMTX_H */ diff --git a/include/JSystem/J3DGraphBase/J3DSys.h b/include/JSystem/J3DGraphBase/J3DSys.h index 298a50870a..b5b91f4136 100644 --- a/include/JSystem/J3DGraphBase/J3DSys.h +++ b/include/JSystem/J3DGraphBase/J3DSys.h @@ -1,6 +1,7 @@ #ifndef J3DSYS_H #define J3DSYS_H +#include "dolphin/gx/GXTexture.h" #include "dolphin/mtx/mtx.h" #include "dolphin/types.h" @@ -21,19 +22,23 @@ class J3DDrawBuffer; class J3DTexture; struct J3DSys { - /* 0x00 */ Mtx mMtx; - /* 0x30 */ J3DMtxCalc* mMtxCalc; - /* 0x34 */ u32 mFlags; - /* 0x38 */ J3DModel* mModel; - /* 0x3C */ J3DMatPacket* mMatPacket; - /* 0x40 */ J3DShapePacket* mShapePacket; - /* 0x44 */ J3DShape* mShape; - /* 0x48 */ J3DDrawBuffer* mDrawBuffer[2]; - /* 0x50 */ u32 mDrawMode; - /* 0x54 */ u32 mMaterialMode; - /* 0x58 */ J3DTexture* mTexture; - - u8 field_0x5c[0x11C - 0x5C]; + /* 0x000 */ Mtx mMtx; + /* 0x030 */ J3DMtxCalc* mCurrentMtxCalc; + /* 0x034 */ u32 mFlags; + /* 0x038 */ J3DModel* mModel; + /* 0x03C */ J3DMatPacket* mMatPacket; + /* 0x040 */ J3DShapePacket* mShapePacket; + /* 0x044 */ J3DShape* mShape; + /* 0x048 */ J3DDrawBuffer* mDrawBuffer[2]; + /* 0x050 */ u32 mDrawMode; + /* 0x054 */ u32 mMaterialMode; + /* 0x058 */ J3DTexture* mTexture; + /* 0x05C */ u8 field_0x5c[0x10C - 0x5C]; + /* 0x10C */ void* mVtxPos; + /* 0x110 */ void* mVtxNrm; + /* 0x114 */ _GXColor* mVtxCol; + /* 0x118 */ Vec* mNBTScale; + /* 8030FDE8 */ J3DSys(); /* 8030FEC0 */ void loadPosMtxIndx(int, u16) const; /* 8030FEE4 */ void loadNrmMtxIndx(int, u16) const; @@ -57,9 +62,23 @@ struct J3DSys { void setDrawModeXlu() { mDrawMode = XLU; } + void setVtxPos(void* pVtxPos) { mVtxPos = pVtxPos; } + + void setVtxNrm(void* pVtxNrm) { mVtxNrm = pVtxNrm; } + + void setVtxCol(_GXColor* pVtxCol) { mVtxCol = pVtxCol; } + + void setModel(J3DModel* pModel) { mModel = pModel; } + + void setTexture(J3DTexture* pTex) { mTexture = pTex; } + + void onFlag(u32 flag) { mFlags |= flag; } + + void offFlag(u32 flag) { mFlags &= ~flag; } + static Mtx mCurrentMtx; - static f32 mCurrentS[3]; - static f32 mParentS[3]; + static Vec mCurrentS; + static Vec mParentS; static u16 sTexCoordScaleTable[34]; }; diff --git a/include/JSystem/J3DGraphBase/J3DTevs.h b/include/JSystem/J3DGraphBase/J3DTevs.h index 8da6b41764..32f5e1277a 100644 --- a/include/JSystem/J3DGraphBase/J3DTevs.h +++ b/include/JSystem/J3DGraphBase/J3DTevs.h @@ -3,4 +3,57 @@ #include "dolphin/types.h" +struct J3DTevStageInfo {}; + +struct J3DTevStage { + /* 8000E230 */ J3DTevStage(); + /* 8000E298 */ void setTevStageInfo(J3DTevStageInfo const&); + /* 8003AACC */ J3DTevStage(J3DTevStageInfo const&); + + /* 0x0 */ u8 field_0x0; + /* 0x1 */ u8 mTevColorOp; + /* 0x2 */ u8 mTevColorAB; + /* 0x3 */ u8 mTevColorCD; + /* 0x4 */ u8 field_0x4; + /* 0x5 */ u8 mTevAlphaOp; + /* 0x6 */ u8 mTevAlphaAB; + /* 0x7 */ u8 mTevSwapModeInfo; +}; + +struct J3DIndTevStageInfo { + /* 0x0 */ u8 mIndStage; + /* 0x1 */ u8 mIndFormat; + /* 0x2 */ u8 mBiasSel; + /* 0x3 */ u8 mMtxSel; + /* 0x4 */ u8 mWrapS; + /* 0x5 */ u8 mWrapT; + /* 0x6 */ u8 mPrev; + /* 0x7 */ u8 mLod; + /* 0x8 */ u8 mAlphaSel; +}; + +struct J3DIndTevStage { + /* 8000E14C */ J3DIndTevStage(); + + /* 0x0 */ u32 mInfo; +}; + +struct J3DTevOrderInfo { + /* 0x0 */ u8 field_0x0; + /* 0x1 */ u8 mTexMap; + /* 0x2 */ u8 field_0x2; +}; + +struct J3DTevOrder : public J3DTevOrderInfo { + /* 8000E140 */ J3DTevOrder(); +}; + +struct J3DTevSwapModeTable { + /* 8000E134 */ J3DTevSwapModeTable(); + + /* 0x0 */ u8 field_0x0; +}; // Size: 0x1 + +struct J3DTevSwapModeInfo {}; + #endif /* J3DTEVS_H */ diff --git a/include/JSystem/J3DGraphBase/J3DTexture.h b/include/JSystem/J3DGraphBase/J3DTexture.h index 743cfb48dd..52d11fca65 100644 --- a/include/JSystem/J3DGraphBase/J3DTexture.h +++ b/include/JSystem/J3DGraphBase/J3DTexture.h @@ -1,6 +1,72 @@ #ifndef J3DTEXTURE_H #define J3DTEXTURE_H +#include "JSystem/JUtility/JUTTexture.h" +#include "dolphin/mtx/mtx.h" #include "dolphin/types.h" +class J3DTexture { +private: + /* 0x0 */ u16 mNum; + /* 0x4 */ ResTIMG** mpRes; + +public: + /* 8031204C */ void loadGX(u16, _GXTexMapID) const; + /* 803121A4 */ void entryNum(u16); + /* 8031221C */ void addResTIMG(u16, ResTIMG const*); + /* 803366A4 */ virtual ~J3DTexture(); +}; + +struct J3DTextureSRTInfo { + /* 0x00 */ f32 field_0x0; + /* 0x04 */ f32 field_0x4; + /* 0x08 */ s16 field_0x8; + /* 0x0C */ f32 field_0xc; + /* 0x10 */ f32 field_0x10; +}; // Size: 0x14 + +struct J3DTexMtxInfo { + /* 80325718 */ void operator=(J3DTexMtxInfo const&); + + /* 0x00 */ u8 field_0x0; + /* 0x01 */ u8 field_0x1; + /* 0x04 */ f32 field_0x04; + /* 0x08 */ f32 field_0x08; + /* 0x0C */ f32 field_0x0c; + /* 0x10 */ J3DTextureSRTInfo field_0x10; + /* 0x24 */ Mtx mEffectMtx; + /* 0x54 */ f32 field_0x54; + /* 0x58 */ f32 field_0x58; + /* 0x5C */ f32 field_0x5c; + /* 0x60 */ f32 field_0x60; +}; // Size: 0x64 + +class J3DTexMtx { +public: + /* 803238C4 */ void load(u32) const; + /* 80323900 */ void calc(f32 const (*)[4]); + /* 80323920 */ void calcTexMtx(f32 const (*)[4]); + /* 80323C0C */ void calcPostTexMtx(f32 const (*)[4]); + /* 80324358 */ void loadTexMtx(u32) const; + /* 803243BC */ void loadPostTexMtx(u32) const; + + J3DTexMtxInfo& getTexMtxInfo() { return mTexMtxInfo; } + +private: + /* 0x00 */ J3DTexMtxInfo mTexMtxInfo; + /* 0x64 */ Mtx mMtx; +}; // Size: 0x94 + +struct J3DTexCoordInfo { + /* 0x0 */ u8 mTexGenType; + /* 0x1 */ u8 mTexGenSrc; + /* 0x2 */ u8 mTexGenMtx; +}; + +struct J3DTexCoord : public J3DTexCoordInfo { + /* 8000E464 */ J3DTexCoord(); + + /* 0x4 */ u16 mTexMtxReg; +}; // Size: 0x6 + #endif /* J3DTEXTURE_H */ diff --git a/include/JSystem/J3DGraphBase/J3DTransform.h b/include/JSystem/J3DGraphBase/J3DTransform.h index 5ec5353ba5..1bdc7ebb88 100644 --- a/include/JSystem/J3DGraphBase/J3DTransform.h +++ b/include/JSystem/J3DGraphBase/J3DTransform.h @@ -1,6 +1,20 @@ #ifndef J3DTRANSFORM_H #define J3DTRANSFORM_H +#include "dolphin/mtx/mtxvec.h" #include "dolphin/types.h" +struct J3DTransformInfo { + /* 0x00 */ Vec mScale; + /* 0x0C */ SVec mRotation; + /* 0x14 */ Vec mTranslate; +}; // Size: 0x20 + +extern J3DTransformInfo const j3dDefaultTransformInfo; +extern Vec const j3dDefaultScale; +extern Mtx const j3dDefaultMtx; + +void J3DGetTranslateRotateMtx(J3DTransformInfo const&, Mtx); +void J3DGetTranslateRotateMtx(s16, s16, s16, f32, f32, f32, Mtx); + #endif /* J3DTRANSFORM_H */ diff --git a/include/JSystem/J3DGraphBase/J3DVertex.h b/include/JSystem/J3DGraphBase/J3DVertex.h index 3960e5e76a..9543468037 100644 --- a/include/JSystem/J3DGraphBase/J3DVertex.h +++ b/include/JSystem/J3DGraphBase/J3DVertex.h @@ -1,6 +1,94 @@ #ifndef J3DVERTEX_H #define J3DVERTEX_H +#include "dolphin/gx/GX.h" #include "dolphin/types.h" +class J3DModel; +struct J3DAnmVtxColor; + +struct J3DVtxColorCalc { + /* 8032E180 */ void calc(J3DModel*); + + /* 0x0 */ void* vtable; // inlined vtable? + /* 0x4 */ u32 mFlags; + /* 0x8 */ J3DAnmVtxColor* mpVtxColor; +}; + +class J3DVertexData { +public: + J3DVertexData(); + + void* getVtxPosArray() const { return mVtxPosArray; } + + void* getVtxNrmArray() const { return mVtxNrmArray; } + + _GXColor* getVtxColorArray(u8 idx) const { return mVtxColorArray[idx]; } + + u32 getNrmNum() const { return mNrmNum; } + + u32 getVtxNum() const { return mVtxNum; } + +private: + /* 0x00 */ u32 mVtxNum; + /* 0x04 */ u32 mNrmNum; + /* 0x08 */ u32 mColNum; + /* 0x0C */ u32 field_0xc; + /* 0x10 */ u32 field_0x10; + /* 0x14 */ void* mVtxAttrFmtList; + /* 0x18 */ void* mVtxPosArray; + /* 0x1C */ void* mVtxNrmArray; + /* 0x20 */ void* mVtxNBTArray; + /* 0x24 */ _GXColor* mVtxColorArray[2]; + /* 0x2C */ void* mVtxTexCoordArray[8]; + /* 0x4C */ u8 mVtxPosFrac; + /* 0x50 */ _GXCompType mVtxPosType; + /* 0x54 */ u8 mVtxNrmFrac; + /* 0x58 */ _GXCompType mVtxNrmType; +}; + +class J3DVertexBuffer { +public: + /* 80310F78 */ void setVertexData(J3DVertexData*); + /* 80310FD8 */ void init(); + /* 80311030 */ ~J3DVertexBuffer(); + /* 8031106C */ void setArray() const; + /* 80311090 */ s32 copyLocalVtxPosArray(u32); + /* 803111B0 */ s32 copyLocalVtxNrmArray(u32); + /* 803112D0 */ s32 copyLocalVtxArray(u32); + /* 80311478 */ s32 allocTransformedVtxPosArray(); + /* 8031152C */ s32 allocTransformedVtxNrmArray(); + + void setCurrentVtxPos(void* pVtxPos) { mCurrentVtxPos = pVtxPos; } + + void setCurrentVtxNrm(void* pVtxNrm) { mCurrentVtxNrm = pVtxNrm; } + + void setCurrentVtxCol(_GXColor* pVtxCol) { mCurrentVtxCol = pVtxCol; } + + void frameInit() { + setCurrentVtxPos(mVtxPosArray[0]); + setCurrentVtxNrm(mVtxNrmArray[0]); + setCurrentVtxCol(mVtxColArray[0]); + } + +private: + /* 0x00 */ J3DVertexData* mVtxData; + /* 0x04 */ void* mVtxPosArray[2]; + /* 0x0C */ void* mVtxNrmArray[2]; + /* 0x14 */ _GXColor* mVtxColArray[2]; + /* 0x1C */ void* mTransformedVtxPosArray[2]; + /* 0x24 */ void* mTransformedVtxNrmArray[2]; + /* 0x2C */ void* mCurrentVtxPos; + /* 0x30 */ void* mCurrentVtxNrm; + /* 0x34 */ _GXColor* mCurrentVtxCol; +}; // Size: 0x38 + +struct VertexNormal { + u8 data[0xC]; +}; + +struct VertexPosition { + u8 data[0xC]; +}; + #endif /* J3DVERTEX_H */ diff --git a/include/JSystem/J3DGraphLoader/J3DAnmLoader.h b/include/JSystem/J3DGraphLoader/J3DAnmLoader.h index 99253a0e58..265bc83c18 100644 --- a/include/JSystem/J3DGraphLoader/J3DAnmLoader.h +++ b/include/JSystem/J3DGraphLoader/J3DAnmLoader.h @@ -3,4 +3,13 @@ #include "dolphin/types.h" +struct J3DAnmLoaderDataBaseFlag {}; + +struct J3DAnmBase; + +struct J3DAnmLoaderDataBase { + /* 80337B40 */ void load(void const*, J3DAnmLoaderDataBaseFlag); + /* 80338134 */ void setResource(J3DAnmBase*, void const*); +}; + #endif /* J3DANMLOADER_H */ diff --git a/include/JSystem/J3DGraphLoader/J3DClusterLoader.h b/include/JSystem/J3DGraphLoader/J3DClusterLoader.h index b67571f054..78e22688b1 100644 --- a/include/JSystem/J3DGraphLoader/J3DClusterLoader.h +++ b/include/JSystem/J3DGraphLoader/J3DClusterLoader.h @@ -3,4 +3,8 @@ #include "dolphin/types.h" +struct J3DClusterLoaderDataBase { + /* 80334130 */ void load(void const*); +}; + #endif /* J3DCLUSTERLOADER_H */ diff --git a/include/JSystem/J3DGraphLoader/J3DModelLoader.h b/include/JSystem/J3DGraphLoader/J3DModelLoader.h index ced256a531..c86393eb81 100644 --- a/include/JSystem/J3DGraphLoader/J3DModelLoader.h +++ b/include/JSystem/J3DGraphLoader/J3DModelLoader.h @@ -3,4 +3,9 @@ #include "dolphin/types.h" +class J3DModelLoaderDataBase { +public: + /* 803346BC */ void load(void const*, u32); +}; + #endif /* J3DMODELLOADER_H */ diff --git a/include/JSystem/JMath/JMath.h b/include/JSystem/JMath/JMath.h index 802d24f2aa..d71f5de5e7 100644 --- a/include/JSystem/JMath/JMath.h +++ b/include/JSystem/JMath/JMath.h @@ -1,6 +1,21 @@ #ifndef JMATH_H #define JMATH_H +#include "dolphin/mtx/mtx.h" #include "dolphin/types.h" +void JMAMTXApplyScale(const Mtx, Mtx, f32, f32, f32); + +inline f32 JMAFastReciprocal(f32 value) { + return __fres(value); +} + +namespace JMath { + +inline f32 fastReciprocal(f32 value) { + return JMAFastReciprocal(value); +} + +}; // namespace JMath + #endif /* JMATH_H */ diff --git a/include/JSystem/JParticle/JPAParticle.h b/include/JSystem/JParticle/JPAParticle.h index 23821622c7..b36c6b6bd1 100644 --- a/include/JSystem/JParticle/JPAParticle.h +++ b/include/JSystem/JParticle/JPAParticle.h @@ -17,10 +17,9 @@ struct JPABaseEmitter { class JPAParticleCallBack { public: - virtual void temp(); // temp to build OK, remove later ~JPAParticleCallBack(); - virtual void draw(JPABaseEmitter*, JPABaseParticle*); virtual void execute(JPABaseEmitter*, JPABaseParticle*); + virtual void draw(JPABaseEmitter*, JPABaseParticle*); }; #endif /* JPAPARTICLE_H */ diff --git a/include/JSystem/JUtility/JUTTexture.h b/include/JSystem/JUtility/JUTTexture.h index c573f2731a..901503df7e 100644 --- a/include/JSystem/JUtility/JUTTexture.h +++ b/include/JSystem/JUtility/JUTTexture.h @@ -7,29 +7,29 @@ struct ResTIMG { /* Acts as the header to image data. Usually texture data immediately follows it, so any pointer arithmetic to go past the end of this structure is so that a variable sized allocated buffer can be accessed. */ - u8 format; - bool alphaEnabled; - u16 width; - u16 height; - u8 wrapS; - u8 wrapT; - bool palettesEnabled; - u8 paletteFormat; - u16 paletteCount; - u32 paletteOffset; - bool mipmapEnabled; - bool doEdgeLOD; - bool biasClamp; - u8 maxAnisotropy; - u8 minFilter; - u8 magFilter; - s8 minLOD; - s8 maxLOD; - u8 mipmapCount; - u8 unknown; - s16 LODBias; - u32 texDataOffset; -}; + /* 0x00 */ u8 format; + /* 0x01 */ bool alphaEnabled; + /* 0x02 */ u16 width; + /* 0x04 */ u16 height; + /* 0x06 */ u8 wrapS; + /* 0x07 */ u8 wrapT; + /* 0x08 */ bool palettesEnabled; + /* 0x09 */ u8 paletteFormat; + /* 0x0A */ u16 paletteCount; + /* 0x0C */ u32 paletteOffset; + /* 0x10 */ bool mipmapEnabled; + /* 0x11 */ bool doEdgeLOD; + /* 0x12 */ bool biasClamp; + /* 0x13 */ u8 maxAnisotropy; + /* 0x14 */ u8 minFilter; + /* 0x15 */ u8 magFilter; + /* 0x16 */ s8 minLOD; + /* 0x17 */ s8 maxLOD; + /* 0x18 */ u8 mipmapCount; + /* 0x19 */ u8 unknown; + /* 0x1A */ s16 LODBias; + /* 0x1B */ u32 texDataOffset; +}; // Size: 0x1C class JUTTexture { public: diff --git a/include/MSL_C.PPCEABI.bare.H/MSL_Common/Src/string.h b/include/MSL_C.PPCEABI.bare.H/MSL_Common/Src/string.h index c36ea98f28..9a30c9db61 100644 --- a/include/MSL_C.PPCEABI.bare.H/MSL_Common/Src/string.h +++ b/include/MSL_C.PPCEABI.bare.H/MSL_Common/Src/string.h @@ -3,4 +3,8 @@ #include "dolphin/types.h" +extern "C" { +void* memcpy(void*, const void*, s32); +}; + #endif /* MSL_COMMON_SRC_STRING_H */ diff --git a/include/SSystem/SComponent/c_sxyz.h b/include/SSystem/SComponent/c_sxyz.h index ad1bf45b45..bcc78040d0 100644 --- a/include/SSystem/SComponent/c_sxyz.h +++ b/include/SSystem/SComponent/c_sxyz.h @@ -1,17 +1,9 @@ #ifndef C_SXYZ_H #define C_SXYZ_H +#include "dolphin/mtx/vec.h" #include "dolphin/types.h" -struct SVec { - s16 x, y, z; - - void set(s16 oX, s16 oY, s16 oZ) { - x = oX; - y = oY; - z = oZ; - } -}; class csXyz : public SVec { public: static const csXyz Zero; diff --git a/include/d/a/d_a_alink.h b/include/d/a/d_a_alink.h index 84fd08b103..cdce05bcbf 100644 --- a/include/d/a/d_a_alink.h +++ b/include/d/a/d_a_alink.h @@ -29,11 +29,10 @@ class J2DScreen; class J2DPane; class J2DAnmBase; -class daAlink_lockCursor_c { +class daAlink_lockCursor_c : public dDlst_base_c { public: /* 80125F14 */ void create(); /* 80126358 */ void update(); - virtual void temp(); // temp to build OK, remove later /* 80126424 */ virtual void draw(); /* 800CFE68 */ virtual ~daAlink_lockCursor_c(); @@ -58,10 +57,10 @@ private: class daAlink_sight_c : public daPy_sightPacket_c { public: /* 80126650 */ void create(); - virtual void test(); // temp to build OK, remove later + /* 80126710 */ void onLockFlg(); + /* 801266C0 */ virtual void draw(); /* 800CFDF4 */ virtual ~daAlink_sight_c(); - /* 80126710 */ void onLockFlg(); private: /* 0x4C */ bool mLockFlag; @@ -74,7 +73,7 @@ public: /* 801256EC */ void initBlur(f32, int, cXyz const*, cXyz const*, cXyz const*); /* 8012589C */ void copyBlur(cXyz const*, cXyz const*, cXyz const*); /* 80125B0C */ void traceBlur(cXyz const*, cXyz const*, s16); - virtual void temp(); // temp to build OK, remove later + /* 80125BF4 */ virtual void draw(); /* 800CFD58 */ virtual ~daAlink_blur_c(); @@ -93,9 +92,8 @@ private: class dAlink_bottleWaterPcallBack_c : public JPAParticleCallBack { public: - virtual void temp(); // temp to build OK, remove later - /* 800CFCF8 */ virtual ~dAlink_bottleWaterPcallBack_c(); /* 80124A2C */ virtual void execute(JPABaseEmitter*, JPABaseParticle*); + /* 800CFCF8 */ virtual ~dAlink_bottleWaterPcallBack_c(); private: /* 0x04 */ s16 mHitFlg; @@ -2010,7 +2008,6 @@ public: /* 80140984 */ void statusWindowDraw(); /* 80140AC8 */ void resetStatusWindow(); - virtual void unk(); virtual bool getMidnaAtnPos(void) const; virtual void setMidnaMsgNum(fopAc_ac_c*, u16); virtual Mtx* getModelMtx(void); @@ -2079,7 +2076,7 @@ public: virtual void setOutPower(float, short, int); virtual void setGrabCollisionOffset(float, float, cBgS_PolyInfo*); virtual void onFrollCrashFlg(u8, int); - virtual Mtx* getModelJointMtx(u16); + virtual MtxP getModelJointMtx(u16); virtual bool getHeadMtx(void); virtual bool setHookshotCarryOffset(unsigned int, cXyz const*); virtual bool checkIronBallReturn(void) const; diff --git a/include/d/a/d_a_player.h b/include/d/a/d_a_player.h index 0685c9fdb1..5807f9b45c 100644 --- a/include/d/a/d_a_player.h +++ b/include/d/a/d_a_player.h @@ -11,10 +11,10 @@ #include "dolphin/types.h" #include "f_op/f_op_actor.h" -class daPy_sightPacket_c { - /* 80140CDC */ ~daPy_sightPacket_c(); - virtual void test(); // temp to build OK, remove later +class daPy_sightPacket_c : public dDlst_base_c { /* 8015F1A0 */ virtual void draw(); + /* 80140CDC */ virtual ~daPy_sightPacket_c(); + /* 8015F2FC */ void setSight(); /* 8015F384 */ void setSightImage(ResTIMG*); @@ -80,7 +80,6 @@ private: fopAc_ac_c* mActor; }; -#pragma pack(push, 1) class daPy_frameCtrl_c : public J3DFrameCtrl { public: /* 80140D24 */ ~daPy_frameCtrl_c(); @@ -103,7 +102,6 @@ private: /* 0x14 */ u16 mEndFlg; /* 0x16 */ u16 mNowSetFlg; }; -#pragma pack(pop) class daPy_demo_c { public: @@ -294,6 +292,7 @@ public: virtual bool getModelJointMtx(u16); virtual bool getHeadMtx(void); virtual bool setHookshotCarryOffset(unsigned int, cXyz const*); + // virtual void checkCutJumpCancelTurn() const; virtual bool checkIronBallReturn(void) const; virtual bool checkIronBallGroundStop(void) const; virtual bool checkSingleBoarBattleSecondBowReady(void) const; diff --git a/include/d/d_attention.h b/include/d/d_attention.h index 7758314a47..0edb7ab71b 100644 --- a/include/d/d_attention.h +++ b/include/d/d_attention.h @@ -7,8 +7,6 @@ #include "dolphin/types.h" #include "m_Do/m_Do_ext.h" -struct J3DTransformInfo {}; - class dAttHint_c { public: dAttHint_c() {} diff --git a/include/d/d_resorce.h b/include/d/d_resorce.h index 378ae0cd93..b19e2993c8 100644 --- a/include/d/d_resorce.h +++ b/include/d/d_resorce.h @@ -91,8 +91,4 @@ public: /* 0x1200 */ dRes_info_c mStageInfo[0x40]; }; // Size: 0x1B00 -struct J3DAnmBase { - /* 8003C734 */ ~J3DAnmBase(); -}; - #endif /* D_D_RESORCE_H */ diff --git a/include/dolphin/gd/GDBase.h b/include/dolphin/gd/GDBase.h index f08ff18025..ef685d3519 100644 --- a/include/dolphin/gd/GDBase.h +++ b/include/dolphin/gd/GDBase.h @@ -3,4 +3,23 @@ #include "dolphin/types.h" +struct GDLObj { + /* 0x0 */ u8* start; + /* 0x4 */ u32 length; + /* 0x8 */ u8* ptr; + /* 0xC */ u8* end; +}; // Size: 0x10 + +extern "C" void GDInitGDLObj(GDLObj*, u8*, u32); + +extern GDLObj* __GDCurrentDL; + +inline void GDSetCurrent(GDLObj* obj) { + __GDCurrentDL = obj; +} + +inline u32 GDGetGDLObjOffset(GDLObj* obj) { + return (u32)(obj->ptr - obj->start); +} + #endif /* GDBASE_H */ diff --git a/include/dolphin/gx/GXTexture.h b/include/dolphin/gx/GXTexture.h index 6b8684c21d..1823855bf1 100644 --- a/include/dolphin/gx/GXTexture.h +++ b/include/dolphin/gx/GXTexture.h @@ -10,11 +10,11 @@ typedef struct _GXColor { u8 a; } GXColor; -struct _GXColorS10 { +typedef struct _GXColorS10 { s16 r; s16 g; s16 b; s16 a; -}; +} GXColorS10; #endif /* GXTEXTURE_H */ diff --git a/include/dolphin/mtx/mtx.h b/include/dolphin/mtx/mtx.h index 8124777766..21e9bf3616 100644 --- a/include/dolphin/mtx/mtx.h +++ b/include/dolphin/mtx/mtx.h @@ -6,6 +6,9 @@ #include "dolphin/types.h" typedef float Mtx[3][4]; +typedef float Mtx33[3][3]; +typedef float Mtx23[2][3]; +typedef f32 (*MtxP)[4]; extern "C" { void PSMTXIdentity(Mtx matrix); diff --git a/include/dolphin/mtx/vec.h b/include/dolphin/mtx/vec.h index 174f84ad9c..a1accce9bc 100644 --- a/include/dolphin/mtx/vec.h +++ b/include/dolphin/mtx/vec.h @@ -23,6 +23,16 @@ struct Vec { } }; +struct SVec { + s16 x, y, z; + + void set(s16 oX, s16 oY, s16 oZ) { + x = oX; + y = oY; + z = oZ; + } +}; + extern "C" { void PSVECAdd(const Vec* src_a, const Vec* src_b, Vec* dst); void PSVECSubtract(const Vec* a, const Vec* b, Vec* dst); diff --git a/include/init.h b/include/init.h index 177006544b..bfe78198e7 100644 --- a/include/init.h +++ b/include/init.h @@ -1,6 +1,7 @@ #ifndef INIT_H #define INIT_H +#include "MSL_C.PPCEABI.bare.H/MSL_Common/Src/string.h" #include "dolphin/types.h" #endif /* INIT_H */ diff --git a/include/m_Do/m_Do_ext.h b/include/m_Do/m_Do_ext.h index dc90469fbd..47c48def6c 100644 --- a/include/m_Do/m_Do_ext.h +++ b/include/m_Do/m_Do_ext.h @@ -8,39 +8,6 @@ #include "JSystem/JKernel/JKRSolidHeap.h" #include "global.h" -struct J3DMaterialTable; -struct J3DAnmTextureSRTKey { - /* 80329E5C */ J3DAnmTextureSRTKey(); - /* 8032B0C0 */ void searchUpdateMaterialID(J3DMaterialTable*); -}; - -struct J3DAnmTexPattern { - /* 8032AED8 */ J3DAnmTexPattern(); - /* 8032AF50 */ void getTexNo(u16, u16*) const; - /* 8032B004 */ void searchUpdateMaterialID(J3DMaterialTable*); -}; - -struct J3DAnmTevRegKey { - /* 8032B780 */ void searchUpdateMaterialID(J3DMaterialTable*); -}; - -struct J3DAnmColor { - /* 8032A8A4 */ void searchUpdateMaterialID(J3DMaterialTable*); -}; - -struct J3DMaterialTable { - /* 8032FAF4 */ void entryMatColorAnimator(J3DAnmColor*); - /* 8032FBC8 */ void entryTexNoAnimator(J3DAnmTexPattern*); - /* 8032FCC4 */ void entryTexMtxAnimator(J3DAnmTextureSRTKey*); - /* 8032FE70 */ void entryTevRegAnimator(J3DAnmTevRegKey*); -}; - -struct J3DAnmTransform { - /* 8003B93C */ ~J3DAnmTransform(); - /* 8003C77C */ bool getKind() const; - /* 80328E40 */ J3DAnmTransform(s16, f32*, s16*, f32*); -}; - class mDoExt_baseAnm { public: mDoExt_baseAnm() {} |
