diff options
| author | TakaRikka <38417346+TakaRikka@users.noreply.github.com> | 2024-01-22 07:23:54 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-22 17:23:54 +0200 |
| commit | 697cd08979c12f2a1ebd32f12a1a306b730f14ec (patch) | |
| tree | cf87190adf687a837db8424dc00ffa21da99e837 /include | |
| parent | 5a735a495680b6b410a242cbe570a72b789d7016 (diff) | |
some various J2D/J3D work (#2043)
* most of J2DPicture done
* fix GXSetTexCoordGen
* some j3d work
Diffstat (limited to 'include')
| -rw-r--r-- | include/JSystem/J2DGraph/J2DPicture.h | 6 | ||||
| -rw-r--r-- | include/JSystem/J3DGraphAnimator/J3DAnimation.h | 13 | ||||
| -rw-r--r-- | include/JSystem/J3DGraphAnimator/J3DCluster.h | 56 | ||||
| -rw-r--r-- | include/JSystem/J3DGraphAnimator/J3DSkinDeform.h | 32 | ||||
| -rw-r--r-- | include/JSystem/J3DGraphBase/J3DVertex.h | 20 | ||||
| -rw-r--r-- | include/JSystem/JGeometry.h | 3 | ||||
| -rw-r--r-- | include/JSystem/JUtility/TColor.h | 4 | ||||
| -rw-r--r-- | include/dolphin/gx/GXAttr.h | 4 |
8 files changed, 93 insertions, 45 deletions
diff --git a/include/JSystem/J2DGraph/J2DPicture.h b/include/JSystem/J2DGraph/J2DPicture.h index a3fc4f4d62..b3ff43f6ee 100644 --- a/include/JSystem/J2DGraph/J2DPicture.h +++ b/include/JSystem/J2DGraph/J2DPicture.h @@ -119,7 +119,7 @@ public: protected: /* 0x100 */ JUTTexture* mTexture[2]; - /* 0x108 */ u8 mTextureCount; + /* 0x108 */ u8 mTextureNum; /* 0x109 */ u8 field_0x109; /* 0x10A */ JGeometry::TVec2<s16> field_0x10a[4]; /* 0x11C */ f32 field_0x11c[2]; @@ -128,8 +128,8 @@ protected: /* 0x130 */ JUtility::TColor mWhite; /* 0x134 */ JUtility::TColor mBlack; /* 0x138 */ JUtility::TColor mCornerColor[4]; - /* 0x148 */ JUtility::TColor field_0x148; - /* 0x14C */ JUtility::TColor field_0x14c; + /* 0x148 */ JUtility::TColor mBlendKonstColor; + /* 0x14C */ JUtility::TColor mBlendKonstAlpha; }; #endif /* J2DPICTURE_H */ diff --git a/include/JSystem/J3DGraphAnimator/J3DAnimation.h b/include/JSystem/J3DGraphAnimator/J3DAnimation.h index 81afd9898f..a35eed551d 100644 --- a/include/JSystem/J3DGraphAnimator/J3DAnimation.h +++ b/include/JSystem/J3DGraphAnimator/J3DAnimation.h @@ -64,7 +64,7 @@ struct J3DAnmTransformFullTable { struct J3DAnmTexPatternFullTable { /* 0x00 */ u16 mMaxFrame; /* 0x02 */ u16 mOffset; - /* 0x04 */ u8 _4; + /* 0x04 */ u8 mTexNo; /* 0x06 */ u16 _6; }; // Size = 0x8 @@ -421,13 +421,18 @@ public: /* 8032BD20 */ virtual ~J3DAnmTexPattern(); /* 8032BD94 */ virtual s32 getKind() const; + u16 getUpdateMaterialID(u16 idx) const { return mUpdateMaterialID[idx]; } + u16 getUpdateMaterialNum() const { return mUpdateMaterialNum; } + bool isValidUpdateMaterialID(u16 id) const { return mUpdateMaterialID[id] != 0xFFFF; } + J3DAnmTexPatternFullTable* getAnmTable() { return mAnmTable; } + private: /* 0x0C */ void* field_0xc; - /* 0x10 */ void* mAnmTable; + /* 0x10 */ J3DAnmTexPatternFullTable* mAnmTable; /* 0x14 */ u16 field_0x14; /* 0x16 */ u16 mUpdateMaterialNum; - /* 0x18 */ u16* field_0x18; - /* 0x1C */ JUTNameTab field_0x1c; + /* 0x18 */ u16* mUpdateMaterialID; + /* 0x1C */ JUTNameTab mUpdateMaterialName; }; // Size: 0x2C class J3DAnmTevRegKey : public J3DAnmBase { diff --git a/include/JSystem/J3DGraphAnimator/J3DCluster.h b/include/JSystem/J3DGraphAnimator/J3DCluster.h index 511c17eed2..4db7189f2d 100644 --- a/include/JSystem/J3DGraphAnimator/J3DCluster.h +++ b/include/JSystem/J3DGraphAnimator/J3DCluster.h @@ -4,21 +4,59 @@ #include "dolphin/types.h" class J3DDeformer; +class J3DClusterKey; +class J3DClusterVertex; +class J3DVertexBuffer; +class J3DModel; +class J3DAnmCluster; +class JUTNameTab; -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; +class J3DCluster { +public: + J3DDeformer* getDeformer() { return mDeformer; } + void setDeformer(J3DDeformer* deformer) { mDeformer = deformer; } + + /* 0x00 */ f32 mMaxAngle; + /* 0x04 */ f32 mMinAngle; + /* 0x08 */ J3DClusterKey* mClusterKey; + /* 0x0C */ u8 mFlags; + /* 0x0E */ u8 field_0xe[0x10 - 0xD]; + /* 0x10 */ u16 mKeyNum; + /* 0x12 */ u16 mPosNum; /* 0x14 */ u16 field_0x14; /* 0x16 */ u16 field_0x16; - /* 0x18 */ u16 field_0x18[2]; - /* 0x1C */ int field_0x1c; + /* 0x18 */ u16* field_0x18; + /* 0x1C */ J3DClusterVertex* mClusterVertex; /* 0x20 */ J3DDeformer* mDeformer; }; struct J3DClusterKey {}; +class J3DDeformData { +public: + /* 8032E1F8 */ J3DDeformData(); + /* 8032E230 */ void offAllFlag(u32); + /* 8032E298 */ void deform(J3DVertexBuffer*); + /* 8032E274 */ void deform(J3DModel*); + /* 8032E364 */ void setAnm(J3DAnmCluster*); + + J3DCluster* getClusterPointer(u16 index) { + return &mClusterPointer[index]; + } + +private: + /* 0x00 */ u16 mClusterNum; + /* 0x02 */ u16 mClusterKeyNum; + /* 0x04 */ u16 mClusterVertexNum; + /* 0x08 */ J3DCluster* mClusterPointer; + /* 0x0C */ J3DClusterKey* mClusterKeyPointer; + /* 0x10 */ J3DClusterVertex* mClusterVertex; + /* 0x14 */ u16 mVtxPosNum; + /* 0x16 */ u16 mVtxNrmNum; + /* 0x18 */ f32* mVtxPos; + /* 0x1C */ f32* mVtxNrm; + /* 0x20 */ JUTNameTab* mClusterName; + /* 0x24 */ JUTNameTab* mClusterKeyName; +}; // Size: 0x28 + #endif /* J3DCLUSTER_H */ diff --git a/include/JSystem/J3DGraphAnimator/J3DSkinDeform.h b/include/JSystem/J3DGraphAnimator/J3DSkinDeform.h index 1844f2f15e..ac68a97489 100644 --- a/include/JSystem/J3DGraphAnimator/J3DSkinDeform.h +++ b/include/JSystem/J3DGraphAnimator/J3DSkinDeform.h @@ -8,29 +8,8 @@ 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 +class J3DClusterVertex; +class JUTNameTab; struct J3DSkinNList { /* 8032C6E4 */ J3DSkinNList(); @@ -98,11 +77,14 @@ public: /* 8032E60C */ void deform_VtxNrmF32(J3DVertexBuffer*, J3DCluster*, J3DClusterKey*, f32*); /* 8032EBCC */ void normalizeWeight(int, f32*); + void offFlag(u32 i_flag) { mFlags &= ~i_flag; } + void setAnmCluster(J3DAnmCluster* anm) { mAnmCluster = anm; } + private: /* 0x00 */ J3DDeformData* mDeformData; /* 0x04 */ J3DAnmCluster* mAnmCluster; - /* 0x08 */ int field_0x8; - /* 0x0C */ int field_0xc; + /* 0x08 */ f32* field_0x8; + /* 0x0C */ f32* field_0xc; /* 0x10 */ u32 mFlags; }; // Size: 0x14 diff --git a/include/JSystem/J3DGraphBase/J3DVertex.h b/include/JSystem/J3DGraphBase/J3DVertex.h index 1f0c7c421b..4e5129a3bf 100644 --- a/include/JSystem/J3DGraphBase/J3DVertex.h +++ b/include/JSystem/J3DGraphBase/J3DVertex.h @@ -105,6 +105,26 @@ public: mTransformedVtxNrmArray[1] = tmp; } + void swapVtxPosArrayPointer() { + void* temp = mVtxPosArray[0]; + mVtxPosArray[0] = mVtxPosArray[1]; + mVtxPosArray[1] = temp; + } + + void swapVtxNrmArrayPointer() { + void* temp = mVtxNrmArray[0]; + mVtxNrmArray[0] = mVtxNrmArray[1]; + mVtxNrmArray[1] = temp; + } + + void* getVtxPosArrayPointer(int index) { + return mVtxPosArray[index]; + } + + void* getVtxNrmArrayPointer(int index) { + return mVtxNrmArray[index]; + } + private: /* 0x00 */ J3DVertexData* mVtxData; /* 0x04 */ void* mVtxPosArray[2]; diff --git a/include/JSystem/JGeometry.h b/include/JSystem/JGeometry.h index 848a79e1a5..325d4f7432 100644 --- a/include/JSystem/JGeometry.h +++ b/include/JSystem/JGeometry.h @@ -296,8 +296,11 @@ struct TVec3<f32> { template <typename T> struct TVec2 { TVec2() {} + TVec2(T v) { set(v); } TVec2(T x, T y) { set(x, y); } + void set(T v) { y = x = v; } + void set(T x, T y) { this->x = x; this->y = y; diff --git a/include/JSystem/JUtility/TColor.h b/include/JSystem/JUtility/TColor.h index 6550a48c0a..fd11ee8a7b 100644 --- a/include/JSystem/JUtility/TColor.h +++ b/include/JSystem/JUtility/TColor.h @@ -11,10 +11,6 @@ struct TColor : public GXColor { TColor(GXColor color) { set(color); } // TColor(const TColor& other) { set(other.toUInt32()); } - TColor& operator=(const TColor& other) { - ((GXColor*)this)->operator=(other); - return *this; - } operator u32() const { return toUInt32(); } u32 toUInt32() const { return *(u32*)&r; } diff --git a/include/dolphin/gx/GXAttr.h b/include/dolphin/gx/GXAttr.h index d820e96979..667c7f33db 100644 --- a/include/dolphin/gx/GXAttr.h +++ b/include/dolphin/gx/GXAttr.h @@ -38,6 +38,10 @@ void GXGetVtxAttrFmt(GXVtxFmt param_0, int param_1, GXCompCnt* param_2, GXCompTy u8* param_4); void GXGetVtxDescv(GXVtxDescList* attrPtr); +static inline void GXSetTexCoordGen(GXTexCoordID dst, GXTexGenType type, GXTexGenSrc src, u32 mtx) { + GXSetTexCoordGen2(dst, type, src, mtx, GX_FALSE, GX_PTIDENTITY); +} + #ifdef __cplusplus }; #endif |
