work on J3DModelLoader (#1982)

This commit is contained in:
Caroline Madsen
2023-11-08 22:56:00 -05:00
committed by GitHub
parent 7d0a02de52
commit 014d13f4dc
35 changed files with 1092 additions and 1608 deletions
@@ -69,6 +69,7 @@ public:
J3DMtxCalc* getMtxCalc() { return mMtxCalc; }
J3DMtxCalc* getCurrentMtxCalc() { return mCurrentMtxCalc; };
J3DJoint* getChild() { return mChild; }
void setMtxType(u8 type) { mKind = (mKind & ~0xf0) | (type << 4); }
static J3DMtxCalc* mCurrentMtxCalc;
@@ -35,6 +35,9 @@ public:
/* 80325CAC */ virtual void calc(J3DMtxBuffer*, Vec const&, f32 const (&)[3][4]);
/* 80325D24 */ virtual ~J3DJointTree();
J3DModelHierarchy const* getHierarchy() { return mHierarchy; }
void setHierarchy(J3DModelHierarchy* hierarchy) { mHierarchy = hierarchy; }
void setBasicMtxCalc(J3DMtxCalc* calc) { mBasicMtxCalc = calc; }
u16 getWEvlpMtxNum() const { return mWEvlpMtxNum; }
u8 getWEvlpMixMtxNum(u16 idx) const { return mWEvlpMixMtxNum[idx]; }
u16 * getWEvlpMixIndex() const { return mWEvlpMixIndex; }
@@ -45,15 +48,20 @@ public:
u16 getDrawMtxNum() const { return mDrawMtxData.mEntryNum; }
u8 getDrawMtxFlag(u16 idx) const { return mDrawMtxData.mDrawMtxFlag[idx]; }
u16 getDrawMtxIndex(u16 idx) const { return mDrawMtxData.mDrawMtxIndex[idx]; }
J3DDrawMtxData* getDrawMtxData() { return &mDrawMtxData; }
JUTNameTab* getJointName() const { return mJointName; }
J3DJoint* getRootNode() { return mRootNode; }
J3DJoint* getJointNodePointer(u16 idx) const { return mJointNodePointer[idx]; }
J3DMtxCalc* getBasicMtxCalc() const { return mBasicMtxCalc; }
Mtx& getInvJointMtx(s32 idx) const { return mInvJointMtx[idx]; }
u32 getModelDataType() const { return mModelDataType; }
void setModelDataType(u32 type) { mModelDataType = type; }
bool checkFlag(u32 flag) { return mFlags & flag; }
void setFlag(u32 flag) { mFlags = flag; }
private:
friend class J3DModelLoader;
/* 0x04 */ J3DModelHierarchy* mHierarchy;
/* 0x08 */ u32 mFlags;
/* 0x0C */ u32 mModelDataType;
@@ -38,11 +38,15 @@ public:
bool isLocked() const { return field_0x1c == 1; }
private:
friend class J3DModelLoader;
friend class J3DModelLoader_v26;
friend class J3DModelLoader_v21;
/* 0x04 */ u16 mMaterialNum;
/* 0x06 */ u16 mUniqueMatNum;
/* 0x08 */ J3DMaterial** mMaterialNodePointer;
/* 0x0C */ JUTNameTab* mMaterialName;
/* 0x10 */ u32 field_0x10;
/* 0x10 */ J3DMaterial* field_0x10;
/* 0x14 */ J3DTexture* mTexture;
/* 0x18 */ JUTNameTab* mTextureName;
/* 0x1C */ u16 field_0x1c;
@@ -37,9 +37,14 @@ public:
u32 getNrmNum() const { return mVertexData.getNrmNum(); }
u8 getDrawMtxFlag(u16 idx) const { return mJointTree.getDrawMtxFlag(idx); }
u16 getDrawMtxIndex(u16 idx) const { return mJointTree.getDrawMtxIndex(idx); }
J3DDrawMtxData* getDrawMtxData() { return mJointTree.getDrawMtxData(); }
J3DShapeTable* getShapeTable() { return &mShapeTable; }
J3DShape* getShapeNodePointer(u16 idx) const { return mShapeTable.getShapeNodePointer(idx); }
J3DJoint* getJointNodePointer(u16 idx) const { return mJointTree.getJointNodePointer(idx); }
J3DJointTree& getJointTree() { return mJointTree; }
J3DModelHierarchy const* getHierarchy() { return mJointTree.getHierarchy(); }
void setHierarchy(J3DModelHierarchy* hierarchy) { mJointTree.setHierarchy(hierarchy); }
void setBasicMtxCalc(J3DMtxCalc* calc) { mJointTree.setBasicMtxCalc(calc); }
JUTNameTab* getJointName() const { return mJointTree.getJointName(); }
Mtx& getInvJointMtx(s32 idx) const { return mJointTree.getInvJointMtx(idx); }
J3DTexture* getTexture() const { return mMaterialTable.getTexture(); }
@@ -49,12 +54,13 @@ public:
f32* getWEvlpMixWeight() const { return mJointTree.getWEvlpMixWeight(); }
u8 getWEvlpMixMtxNum(u16 idx) const { return mJointTree.getWEvlpMixMtxNum(idx); }
u32 getModelDataType() const { return mJointTree.getModelDataType(); }
void setModelDataType(u32 type) { mJointTree.setModelDataType(type); }
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; }
u32 getFlag() const { return mFlags; }
void* getRawData() const { return mpRawData; }
void const* getRawData() const { return mpRawData; }
u16 checkBumpFlag() const { return mbHasBumpArray; }
void setBumpFlag(u32 flag) { mbHasBumpArray = flag; }
bool checkBBoardFlag() const { return mbHasBillboard == 1; }
@@ -78,9 +84,15 @@ public:
syncJ3DSysFlags();
syncJ3DSysPointers();
}
void makeHierarchy(J3DJoint* joint, J3DModelHierarchy const** hierarchy) {
mJointTree.makeHierarchy(joint, hierarchy, &mMaterialTable, &mShapeTable);
mShapeTable.initShapeNodes(getDrawMtxData(), &getVertexData());
}
private:
/* 0x04 */ void* mpRawData;
friend class J3DModelLoader;
/* 0x04 */ void const* mpRawData;
/* 0x08 */ u32 mFlags;
/* 0x0C */ u16 mbHasBumpArray;
/* 0x0E */ u16 mbHasBillboard;
@@ -25,6 +25,8 @@ public:
J3DShape* getShapeNodePointer(u16 idx) const { return mShapeNodePointer[idx]; }
private:
friend class J3DModelLoader;
/* 0x4 */ u16 mShapeNum;
/* 0x8 */ J3DShape** mShapeNodePointer;
/* 0xC */ JUTNameTab* mShapeName;
+20 -6
View File
@@ -175,7 +175,7 @@ public:
/* 8000DFD0 */ virtual u8 getTevStageNum() const;
/* 80323550 */ virtual void setTevStage(u32, J3DTevStage const*);
/* 8000E0A8 */ virtual void setTevStage(u32, J3DTevStage);
/* 8000DF8C */ virtual bool getTevStage(u32);
/* 8000DF8C */ virtual J3DTevStage* getTevStage(u32);
/* 8032295C */ virtual void setTevSwapModeInfo(u32, J3DTevSwapModeInfo const*);
/* 80322958 */ virtual void setTevSwapModeInfo(u32, J3DTevSwapModeInfo);
/* 80322960 */ virtual void setTevSwapModeTable(u32, J3DTevSwapModeTable const*);
@@ -238,7 +238,7 @@ public:
/* 803229B8 */ virtual u8 getTevStageNum() const;
/* 80322A6C */ virtual void setTevStage(u32, J3DTevStage const*);
/* 80322A30 */ virtual void setTevStage(u32, J3DTevStage);
/* 80322AA8 */ virtual bool getTevStage(u32);
/* 80322AA8 */ virtual J3DTevStage* getTevStage(u32);
/* 80322AD0 */ virtual void setIndTevStage(u32, J3DIndTevStage const*);
/* 80322ABC */ virtual void setIndTevStage(u32, J3DIndTevStage);
/* 80322AE4 */ virtual bool getIndTevStage(u32);
@@ -308,7 +308,7 @@ public:
/* 803221C8 */ virtual u8 getTevStageNum() const;
/* 8032220C */ virtual void setTevStage(u32, J3DTevStage const*);
/* 803221D0 */ virtual void setTevStage(u32, J3DTevStage);
/* 80322248 */ virtual bool getTevStage(u32);
/* 80322248 */ virtual J3DTevStage* getTevStage(u32);
/* 80322294 */ virtual void setTevSwapModeInfo(u32, J3DTevSwapModeInfo const*);
/* 8032225C */ virtual void setTevSwapModeInfo(u32, J3DTevSwapModeInfo);
/* 803222DC */ virtual void setTevSwapModeTable(u32, J3DTevSwapModeTable const*);
@@ -381,7 +381,7 @@ public:
/* 8032258C */ virtual u8 getTevStageNum() const;
/* 803225D0 */ virtual void setTevStage(u32, J3DTevStage const*);
/* 80322594 */ virtual void setTevStage(u32, J3DTevStage);
/* 8032260C */ virtual bool getTevStage(u32);
/* 8032260C */ virtual J3DTevStage* getTevStage(u32);
/* 80322658 */ virtual void setTevSwapModeInfo(u32, J3DTevSwapModeInfo const*);
/* 80322620 */ virtual void setTevSwapModeInfo(u32, J3DTevSwapModeInfo);
/* 803226A0 */ virtual void setTevSwapModeTable(u32, J3DTevSwapModeTable const*);
@@ -454,7 +454,7 @@ public:
/* 80321DFC */ virtual u8 getTevStageNum() const;
/* 80321E40 */ virtual void setTevStage(u32, J3DTevStage const*);
/* 80321E04 */ virtual void setTevStage(u32, J3DTevStage);
/* 80321E7C */ virtual bool getTevStage(u32);
/* 80321E7C */ virtual J3DTevStage* getTevStage(u32);
/* 80321EC8 */ virtual void setTevSwapModeInfo(u32, J3DTevSwapModeInfo const*);
/* 80321E90 */ virtual void setTevSwapModeInfo(u32, J3DTevSwapModeInfo);
/* 80321F10 */ virtual void setTevSwapModeTable(u32, J3DTevSwapModeTable const*);
@@ -515,7 +515,7 @@ public:
/* 8032281C */ virtual u8 getTevStageNum() const;
/* 80322860 */ virtual void setTevStage(u32, J3DTevStage const*);
/* 80322824 */ virtual void setTevStage(u32, J3DTevStage);
/* 8032289C */ virtual bool getTevStage(u32);
/* 8032289C */ virtual J3DTevStage* getTevStage(u32);
/* 803228C4 */ virtual void setIndTevStage(u32, J3DIndTevStage const*);
/* 803228B0 */ virtual void setIndTevStage(u32, J3DIndTevStage);
/* 803228D8 */ virtual bool getIndTevStage(u32);
@@ -758,6 +758,13 @@ private:
/* 0x0F */ u8 mDither;
}; // Size: 0x10
struct J3DIndTexCoordScaleInfo {
/* 0x0 */ u8 mScaleS;
/* 0x1 */ u8 mScaleT;
/* 0x2 */ u8 field_0x2;
/* 0x3 */ u8 field_0x3;
};
struct J3DIndTexCoordScale {
/* 8000E024 */ ~J3DIndTexCoordScale();
/* 8000E0E4 */ J3DIndTexCoordScale();
@@ -776,6 +783,13 @@ struct J3DIndTexMtx {
/* 0x18 */ u8 mScaleExp;
}; // Size: 0x1C
struct J3DIndTexOrderInfo {
/* 0x0 */ u8 mMap;
/* 0x1 */ u8 mCoord;
/* 0x2 */ u8 field_0x2;
/* 0x3 */ u8 field_0x3;
};
struct J3DIndTexOrder {
/* 8000E128 */ J3DIndTexOrder();
@@ -42,6 +42,8 @@ public:
/* 80316E14 */ virtual void reset();
/* 80316E70 */ virtual void change();
J3DMaterial() { initialize(); }
~J3DMaterial() {}
J3DMaterial* getNext() const { return mNext; }
J3DShape* getShape() const { return mShape; }
J3DTevBlock* getTevBlock() const { return mTevBlock; }
+3 -1
View File
@@ -9,13 +9,15 @@
class J3DTexture {
private:
/* 0x0 */ u16 mNum;
/* 0x2 */ u16 field_0x2;
/* 0x4 */ ResTIMG* mpRes;
public:
J3DTexture(u16 num, ResTIMG* res) : mNum(num), field_0x2(0), mpRes(res) {}
/* 8031204C */ void loadGX(u16, _GXTexMapID) const;
/* 803121A4 */ void entryNum(u16);
/* 8031221C */ void addResTIMG(u16, ResTIMG const*);
/* 803366A4 */ virtual ~J3DTexture();
/* 803366A4 */ virtual ~J3DTexture() {}
u16 getNum() const { return mNum; }
ResTIMG* getResTIMG(u16 entry) const { return &mpRes[entry]; }
+2
View File
@@ -42,6 +42,8 @@ public:
void setVtxNrmType(GXCompType type) { mVtxNrmType = type; }
private:
friend class J3DModelLoader;
/* 0x00 */ u32 mVtxNum;
/* 0x04 */ u32 mNrmNum;
/* 0x08 */ u32 mColNum;
@@ -5,7 +5,7 @@
#include "dolphin/types.h"
class J3DJoint;
struct ResNTAB;
struct J3DJointBlock;
struct J3DJointInitData {
/* 0x00 */ u16 mKind;
@@ -16,18 +16,6 @@ struct J3DJointInitData {
/* 0x2C */ Vec mMax;
}; // Size: 0x30
struct J3DJointBlock {
/* 0x00 */ u8 mMagic[4];
/* 0x04 */ u32 mSize;
/* 0x08 */ u16 mJointNum;
/* 0x0A */ u16 _pad;
/* 0x0C */ J3DJointInitData* mJointInitData;
/* 0x10 */ u16* mIndexTable;
/* 0x14 */ ResNTAB* mNameTable;
};
struct J3DJointFactory {
/* 80337178 */ J3DJointFactory(J3DJointBlock const&);
/* 803371D0 */ J3DJoint* create(int);
@@ -1,6 +1,65 @@
#ifndef J3DMATERIALFACTORY_H
#define J3DMATERIALFACTORY_H
#include "dolphin/types.h"
#include "JSystem/J3DGraphLoader/J3DModelLoader.h"
class J3DMaterial;
class J3DMaterialFactory {
public:
enum MaterialType {
MATERIAL_TYPE_NORMAL = 0,
MATERIAL_TYPE_LOCKED = 1,
MATERIAL_TYPE_PATCHED = 2,
};
/* 80330234 */ J3DMaterialFactory(J3DMaterialDLBlock const&);
/* 8032FFEC */ J3DMaterialFactory(J3DMaterialBlock const&);
/* 803302BC */ u16 countUniqueMaterials();
/* 80330304 */ void countTexGens(int) const;
/* 8033033C */ void countStages(int) const;
/* 803303C4 */ J3DMaterial* create(J3DMaterial*, J3DMaterialFactory::MaterialType, int, u32) const;
/* 80330440 */ void createNormalMaterial(J3DMaterial*, int, u32) const;
/* 80330D84 */ void createPatchedMaterial(J3DMaterial*, int, u32) const;
/* 8033168C */ void modifyPatchedCurrentMtx(J3DMaterial*, int) const;
/* 803317D4 */ void createLockedMaterial(J3DMaterial*, int, u32) const;
/* 80331A7C */ void calcSize(J3DMaterial*, J3DMaterialFactory::MaterialType, int, u32) const;
/* 80331AFC */ void calcSizeNormalMaterial(J3DMaterial*, int, u32) const;
/* 80331C30 */ void calcSizePatchedMaterial(J3DMaterial*, int, u32) const;
/* 80331D00 */ void calcSizeLockedMaterial(J3DMaterial*, int, u32) const;
/* 80331D18 */ void newMatColor(int, int) const;
/* 80331D74 */ void newColorChanNum(int) const;
/* 80331DAC */ void newColorChan(int, int) const;
/* 80331F50 */ void newAmbColor(int, int) const;
/* 80331FAC */ void newTexGenNum(int) const;
/* 80331FE4 */ void newTexCoord(int, int) const;
/* 80332044 */ void newTexMtx(int, int) const;
/* 803320CC */ void newCullMode(int) const;
/* 8033210C */ void newTexNo(int, int) const;
/* 80332154 */ void newTevOrder(int, int) const;
/* 803321A0 */ void newTevColor(int, int) const;
/* 80332210 */ void newTevKColor(int, int) const;
/* 8033226C */ void newTevStageNum(int) const;
/* 803322A4 */ void newTevStage(int, int) const;
/* 80332304 */ void newTevSwapModeTable(int, int) const;
/* 803323A0 */ void newIndTexStageNum(int) const;
/* 803323C8 */ void newIndTexOrder(int, int) const;
/* 8033240C */ void newIndTexMtx(int, int) const;
/* 803324B4 */ void newIndTevStage(int, int) const;
/* 80332648 */ void newIndTexCoordScale(int, int) const;
/* 8033268C */ void newFog(int) const;
/* 80332768 */ void newAlphaComp(int) const;
/* 803327E8 */ void newBlend(int) const;
/* 8033282C */ void newZMode(int) const;
/* 8033288C */ void newZCompLoc(int) const;
/* 803328C4 */ void newDither(int) const;
/* 803328FC */ void newNBTScale(int) const;
u16 getMaterialID(int i_idx) { return mpMaterialID[i_idx]; }
/* 0x00 */ u8 field_0x00[8];
/* 0x08 */ u16* mpMaterialID;
/* 0x0C */ u8 field_0x0c[0x7C];
};
#endif /* J3DMATERIALFACTORY_H */
@@ -1,6 +1,92 @@
#ifndef J3DMATERIALFACTORY_V21_H
#define J3DMATERIALFACTORY_V21_H
#include "JSystem/J3DGraphLoader/J3DModelLoader.h"
#include "dolphin/types.h"
#include "dolphin/gx/GXEnum.h"
#include "dolphin/gx/GXStruct.h"
class J3DMaterial;
class J3DMaterialInitData_v21;
class J3DIndInitData;
class J3DColorChanInfo;
class J3DLightInfo;
class J3DTexCoordInfo;
class J3DTexCoord2Info;
class J3DTexMtxInfo;
class J3DTevOrderInfo;
class J3DTevStageInfo;
class J3DTevSwapModeInfo;
class J3DTevSwapModeTableInfo;
class J3DFogInfo;
class J3DAlphaCompInfo;
class J3DBlendInfo;
class J3DZModeInfo;
class J3DNBTScaleInfo;
class J3DDisplayListInit;
class J3DPatchingInfo;
class J3DCurrentMtxInfo;
class J3DMaterialFactory_v21 {
public:
/* 80332DA4 */ J3DMaterialFactory_v21(J3DMaterialBlock_v21 const&);
/* 80332F84 */ u16 countUniqueMaterials();
/* 80332FA8 */ void countTexGens(int) const;
/* 80332FE0 */ void countStages(int) const;
/* 80333068 */ J3DMaterial* create(J3DMaterial*, int, u32) const;
/* 803337D8 */ void newMatColor(int, int) const;
/* 80333834 */ void newColorChanNum(int) const;
/* 8033386C */ void newColorChan(int, int) const;
/* 80333A10 */ void newTexGenNum(int) const;
/* 80333A48 */ void newTexCoord(int, int) const;
/* 80333AA8 */ void newTexMtx(int, int) const;
/* 80333B30 */ void newCullMode(int) const;
/* 80333B70 */ void newTexNo(int, int) const;
/* 80333BB8 */ void newTevOrder(int, int) const;
/* 80333C04 */ void newTevColor(int, int) const;
/* 80333C74 */ void newTevKColor(int, int) const;
/* 80333CD0 */ void newTevStageNum(int) const;
/* 80333D08 */ void newTevStage(int, int) const;
/* 80333D68 */ void newTevSwapModeTable(int, int) const;
/* 80333E04 */ void newFog(int) const;
/* 80333EE0 */ void newAlphaComp(int) const;
/* 80333F60 */ void newBlend(int) const;
/* 80333FA4 */ void newZMode(int) const;
/* 80334004 */ void newZCompLoc(int) const;
/* 8033403C */ void newDither(int) const;
/* 80334074 */ void newNBTScale(int) const;
u16 getMaterialID(u16 idx) { return mpMaterialID[idx]; }
/* 0x00 */ u16 mMaterialNum;
/* 0x04 */ J3DMaterialInitData_v21* field_0x04;
/* 0x08 */ u16* mpMaterialID;
/* 0x0C */ GXColor* field_0x0c;
/* 0x10 */ u8* field_0x10;
/* 0x14 */ J3DColorChanInfo* field_0x14;
/* 0x18 */ u8* field_0x18;
/* 0x1C */ J3DTexCoordInfo* field_0x1c;
/* 0x20 */ J3DTexCoord2Info* field_0x20;
/* 0x24 */ J3DTexMtxInfo* field_0x24;
/* 0x28 */ J3DTexMtxInfo* field_0x28;
/* 0x2C */ u16* field_0x2c;
/* 0x30 */ GXCullMode* field_0x30;
/* 0x34 */ J3DTevOrderInfo* field_0x34;
/* 0x38 */ GXColorS10* field_0x38;
/* 0x3C */ GXColor* field_0x3c;
/* 0x40 */ u8* field_0x40;
/* 0x44 */ J3DTevStageInfo* field_0x44;
/* 0x48 */ J3DTevSwapModeTableInfo* field_0x48;
/* 0x4C */ J3DFogInfo* field_0x4c;
/* 0x50 */ J3DAlphaCompInfo* field_0x50;
/* 0x54 */ J3DBlendInfo* field_0x54;
/* 0x58 */ J3DZModeInfo* field_0x58;
/* 0x5C */ u8* field_0x5c;
/* 0x60 */ u8* field_0x60;
/* 0x64 */ J3DNBTScaleInfo* field_0x64;
/* 0x68 */ u16 field_0x68;
/* 0x69 */ u8 field_0x69;
/* 0x6A */ u8 field_0x6a;
};
#endif /* J3DMATERIALFACTORY_V21_H */
+217 -1
View File
@@ -2,10 +2,226 @@
#define J3DMODELLOADER_H
#include "dolphin/types.h"
#include "dolphin/mtx/mtx.h"
class J3DModelData;
class J3DMaterialTable;
class J3DModelHierarchy;
struct J3DModelBlock {
/* 0x00 */ u32 mBlockType;
/* 0x04 */ u32 mBlockSize;
};
struct J3DModelFileData {
/* 0x00 */ u32 mMagic1;
/* 0x04 */ u32 mMagic2;
/* 0x08 */ u8 field_0x08[4];
/* 0x0C */ u32 mBlockNum;
/* 0x10 */ u8 field_0x10[0x10];
/* 0x20 */ J3DModelBlock mBlocks[1];
};
struct J3DModelInfoBlock : public J3DModelBlock {
/* 0x08 */ u16 mFlags;
/* 0x0C */ u32 mPacketNum;
/* 0x10 */ u32 mVtxNum;
/* 0x14 */ void* mpHierarchy;
}; // size 0x18
struct J3DVertexBlock : public J3DModelBlock {
/* 0x08 */ void* mpVtxAttrFmtList;
/* 0x0C */ void* mpVtxPosArray;
/* 0x10 */ void* mpVtxNrmArray;
/* 0x14 */ void* mpVtxNBTArray;
/* 0x18 */ void* mpVtxColorArray[2];
/* 0x20 */ void* mpVtxTexCoordArray[8];
}; // size 0x40
struct J3DEnvelopeBlock : public J3DModelBlock {
/* 0x08 */ u16 mWEvlpMtxNum;
/* 0x0C */ void* mpWEvlpMixMtxNum;
/* 0x10 */ void* mpWEvlpMixIndex;
/* 0x14 */ void* mpWEvlpMixWeight;
/* 0x18 */ void* mpInvJointMtx;
}; // size 0x1C
struct J3DDrawBlock : public J3DModelBlock {
/* 0x08 */ u16 mMtxNum;
/* 0x0C */ void* mpDrawMtxFlag;
/* 0x10 */ void* mpDrawMtxIndex;
}; // size 0x14
struct J3DJointBlock : public J3DModelBlock {
/* 0x08 */ u16 mJointNum;
/* 0x0C */ void* mpJointInitData;
/* 0x10 */ void* mpIndexTable;
/* 0x14 */ void* mpNameTable;
}; // size 0x18
struct J3DMaterialBlock : public J3DModelBlock {
/* 0x08 */ u16 mMaterialNum;
/* 0x0C */ void* mpMaterialInitData;
/* 0x10 */ void* mpMaterialID;
/* 0x14 */ void* mpNameTable;
/* 0x18 */ void* mpIndInitData;
/* 0x1C */ void* mpCullMode;
/* 0x20 */ void* mpMatColor;
/* 0x24 */ void* mpColorChanNum;
/* 0x28 */ void* mpColorChanInfo;
/* 0x2C */ void* mpAmbColor;
/* 0x30 */ void* mpLightInfo;
/* 0x34 */ void* mpTexGenNum;
/* 0x38 */ void* mpTexCoordInfo;
/* 0x3C */ void* mpTexCoord2Info;
/* 0x40 */ void* mpTexMtxInfo;
/* 0x44 */ void* field_0x44;
/* 0x48 */ void* mpTexNo;
/* 0x4C */ void* mpTevOrderInfo;
/* 0x50 */ void* mpTevColor;
/* 0x54 */ void* mpTevKColor;
/* 0x58 */ void* mpTevStageNum;
/* 0x5C */ void* mpTevStageInfo;
/* 0x60 */ void* mpTevSwapModeInfo;
/* 0x64 */ void* mpTevSwapModeTableInfo;
/* 0x68 */ void* mpFogInfo;
/* 0x6C */ void* mpAlphaCompInfo;
/* 0x70 */ void* mpBlendInfo;
/* 0x74 */ void* mpZModeInfo;
/* 0x78 */ void* mpZCompLoc;
/* 0x7C */ void* mpDither;
/* 0x80 */ void* mpNBTScaleInfo;
};
struct J3DMaterialBlock_v21 : public J3DModelBlock {
/* 0x08 */ u16 mMaterialNum;
/* 0x0C */ void* field_0x0c;
/* 0x10 */ void* field_0x10;
/* 0x14 */ void* mpNameTable;
/* more */
};
struct J3DMaterialDLBlock : public J3DModelBlock {
/* 0x08 */ u16 mMaterialNum;
/* 0x0C */ void* field_0x0c;
/* 0x10 */ void* field_0x10;
/* 0x14 */ void* field_0x14;
/* 0x18 */ void* field_0x18;
/* 0x1C */ void* field_0x1c;
/* 0x20 */ void* mpNameTable;
/* more */
};
struct J3DShapeBlock : public J3DModelBlock {
/* 0x08 */ u16 mShapeNum;
/* 0x0C */ void* mpShapeInitData;
/* 0x10 */ void* mpIndexTable;
/* 0x14 */ void* mpNameTable;
/* 0x18 */ void* mpVtxDescList;
/* 0x1C */ void* mpMtxTable;
/* 0x20 */ void* mpDisplayListData;
/* 0x24 */ void* mpMtxInitData;
/* 0x28 */ void* mpDrawInitData;
}; // size 0x2C
struct J3DTextureBlock : public J3DModelBlock {
/* 0x08 */ u16 mTextureNum;
/* 0x0C */ void* mpTextureRes;
/* 0x10 */ void* mpNameTable;
};
class J3DModelLoader {
public:
/* 8033468C */ J3DModelLoader();
/* 80335048 */ void readInformation(J3DModelInfoBlock const*, u32);
/* 803351D0 */ void readVertex(J3DVertexBlock const*);
/* 803353F0 */ void readEnvelop(J3DEnvelopeBlock const*);
/* 80335480 */ void readDraw(J3DDrawBlock const*);
/* 80335530 */ void readJoint(J3DJointBlock const*);
/* 80335AF4 */ void readShape(J3DShapeBlock const*, u32);
/* 80335C18 */ void readTexture(J3DTextureBlock const*);
/* 80335F5C */ void readTextureTable(J3DTextureBlock const*);
/* 80336028 */ void readPatchedMaterial(J3DMaterialBlock const*, u32);
/* 80336168 */ void readMaterialDL(J3DMaterialDLBlock const*, u32);
/* 8033631C */ void modifyMaterial(u32);
/* 80336CD8 */ u32 calcSizeInformation(J3DModelInfoBlock const*, u32);
/* 80336D64 */ u32 calcSizeJoint(J3DJointBlock const*);
/* 80336D90 */ u32 calcSizeEnvelope(J3DEnvelopeBlock const*);
/* 80336DA0 */ u32 calcSizeDraw(J3DDrawBlock const*);
/* 80336EA0 */ u32 calcSizeShape(J3DShapeBlock const*, u32);
/* 80336F44 */ u32 calcSizeTexture(J3DTextureBlock const*);
/* 80336FF0 */ u32 calcSizeTextureTable(J3DTextureBlock const*);
/* 80337010 */ u32 calcSizePatchedMaterial(J3DMaterialBlock const*, u32);
/* 803370A0 */ u32 calcSizeMaterialDL(J3DMaterialDLBlock const*, u32);
// virtuals
/* 803347E0 */ J3DModelData* load(void const*, u32);
/* 80334ABC */ J3DMaterialTable* loadMaterialTable(void const*);
/* 80334C20 */ J3DModelData* loadBinaryDisplayList(void const*, u32);
/* 803367D4 */ u32 calcLoadSize(void const*, u32);
/* 803369A0 */ u32 calcLoadMaterialTableSize(void const*);
/* 80336A98 */ u32 calcLoadBinaryDisplayListSize(void const*, u32);
/* 80336794 */ u16 countMaterialNum(void const*);
/* 80334EE0 */ void setupBBoardInfo();
/* 80336450 */ ~J3DModelLoader();
/* 8033649C */ void readMaterial(J3DMaterialBlock const*, u32);
/* 80336498 */ void readMaterial_v21(J3DMaterialBlock_v21 const*, u32);
/* 803364A4 */ void readMaterialTable(J3DMaterialBlock const*, u32);
/* 803364A0 */ void readMaterialTable_v21(J3DMaterialBlock_v21 const*, u32);
/* 803364A8 */ u32 calcSizeMaterial(J3DMaterialBlock const*, u32);
/* 803364B0 */ u32 calcSizeMaterialTable(J3DMaterialBlock const*, u32);
/* 0x00 */ void* _vtable;
/* 0x04 */ J3DModelData* mpModelData;
/* 0x08 */ J3DMaterialTable* mpMaterialTable;
/* 0x0C */ J3DShapeBlock const* mpShapeBlock;
/* 0x10 */ J3DMaterialBlock const* mpMaterialBlock;
/* 0x14 */ J3DModelHierarchy* mpModelHierarchy;
/* 0x18 */ u8 field_0x18;
/* 0x19 */ u8 field_0x19;
/* 0x1A */ u16 mEnvelopeSize;
};
class J3DModelLoader_v21 { // : public J3DModelLoader {
public:
/* 803363F4 */ ~J3DModelLoader_v21() {}
/* 80335890 */ void readMaterial_v21(J3DMaterialBlock_v21 const*, u32);
/* 80335E20 */ void readMaterialTable_v21(J3DMaterialBlock_v21 const*, u32);
/* 0x00 */ void* _vtable;
/* 0x04 */ J3DModelData* mpModelData;
/* 0x08 */ J3DMaterialTable* mpMaterialTable;
/* 0x0C */ J3DShapeBlock const* mpShapeBlock;
/* 0x10 */ J3DMaterialBlock const* mpMaterialBlock;
/* 0x14 */ J3DModelHierarchy* mpModelHierarchy;
/* 0x18 */ u8 field_0x18;
/* 0x19 */ u8 field_0x19;
/* 0x1A */ u16 mEnvelopeSize;
};
class J3DModelLoader_v26 { // : public J3DModelLoader {
public:
/* 80336398 */ ~J3DModelLoader_v26() {}
/* 80335614 */ void readMaterial(J3DMaterialBlock const*, u32);
/* 80335CE4 */ void readMaterialTable(J3DMaterialBlock const*, u32);
/* 80336DB4 */ u32 calcSizeMaterial(J3DMaterialBlock const*, u32);
/* 80336F60 */ u32 calcSizeMaterialTable(J3DMaterialBlock const*, u32);
/* 0x00 */ void* _vtable;
/* 0x04 */ J3DModelData* mpModelData;
/* 0x08 */ J3DMaterialTable* mpMaterialTable;
/* 0x0C */ J3DShapeBlock const* mpShapeBlock;
/* 0x10 */ J3DMaterialBlock const* mpMaterialBlock;
/* 0x14 */ J3DModelHierarchy* mpModelHierarchy;
/* 0x18 */ u8 field_0x18;
/* 0x19 */ u8 field_0x19;
/* 0x1A */ u16 mEnvelopeSize;
};
class J3DModelLoaderDataBase {
public:
/* 803346BC */ static void* load(void const*, u32);
/* 803346BC */ static J3DModelData* load(void const* i_data, u32 i_flags);
};
#endif /* J3DMODELLOADER_H */
@@ -1,6 +1,7 @@
#ifndef J3DSHAPEFACTORY_H
#define J3DSHAPEFACTORY_H
#include "JSystem/J3DGraphLoader/J3DModelLoader.h"
#include "dolphin/gx/GXAttr.h"
#include "dolphin/mtx/vec.h"
@@ -31,23 +32,6 @@ struct J3DShapeDrawInitData {
/* 0x04 */ u32 mDisplayListIndex;
};
struct J3DShapeBlock {
/* 0x00 */ u8 mMagic[4];
/* 0x04 */ u32 mSize;
/* 0x08 */ u16 mShapeNum;
/* 0x0A */ u16 _pad;
/* 0x0C */ J3DShapeInitData* mShapeInitData;
/* 0x10 */ u16* mIndexTable;
/* 0x14 */ ResNTAB* mNameTable;
/* 0x18 */ GXVtxDescList* mVtxDescList;
/* 0x1C */ u16* mMtxTable;
/* 0x20 */ u8* mDisplayListData;
/* 0x24 */ J3DShapeMtxInitData* mMtxInitData;
/* 0x28 */ J3DShapeDrawInitData* mDrawInitData;
};
struct J3DShapeFactory {
/* 80337350 */ J3DShapeFactory(J3DShapeBlock const&);
/* 80337400 */ J3DShape* create(int, u32, GXVtxDescList*);