work on J3DMaterialFactory and J3DMaterialFactory_v21 (#2012)

This commit is contained in:
Caroline Madsen
2023-12-27 20:17:39 -05:00
committed by GitHub
parent 83969f6dc1
commit 9780adcc4e
90 changed files with 5594 additions and 7128 deletions
@@ -1,10 +1,76 @@
#ifndef J3DMATERIALFACTORY_H
#define J3DMATERIALFACTORY_H
#include "JSystem/J3DGraphBase/J3DMatBlock.h"
#include "JSystem/J3DGraphLoader/J3DModelLoader.h"
#include "dolphin/gx/GXEnum.h"
#include "dolphin/gx/GXStruct.h"
class J3DMaterial;
struct J3DMaterialInitData {
/* 0x000 */ u8 mMaterialMode;
/* 0x001 */ u8 mCullModeIdx;
/* 0x002 */ u8 mColorChanNumIdx;
/* 0x003 */ u8 mTexGenNumIdx;
/* 0x004 */ u8 mTevStageNumIdx;
/* 0x005 */ u8 mZCompLocIdx;
/* 0x006 */ u8 mZModeIdx;
/* 0x007 */ u8 mDitherIdx;
/* 0x008 */ u16 mMatColorIdx[2];
/* 0x00C */ u16 mColorChanIdx[4];
/* 0x014 */ u16 mAmbColorIdx[2];
/* 0x018 */ u8 field_0x018[0x10];
/* 0x028 */ u16 mTexCoordIdx[8];
/* 0x038 */ u8 field_0x038[0x10];
/* 0x048 */ u16 mTexMtxIdx[8];
/* 0x058 */ u8 field_0x058[0x2c];
/* 0x084 */ u16 mTexNoIdx[8];
/* 0x094 */ u16 mTevKColorIdx[4];
/* 0x09C */ u8 mTevKColorSel[0x10];
/* 0x0AC */ u8 mTevKAlphaSel[0x10];
/* 0x0BC */ u16 mTevOrderIdx[0x10];
/* 0x0DC */ u16 mTevColorIdx[4];
/* 0x0E4 */ u16 mTevStageIdx[0x10];
/* 0x104 */ u16 mTevSwapModeIdx[0x10];
/* 0x124 */ u16 mTevSwapModeTableIdx[4];
/* 0x12C */ u8 field_0x12c[0x18];
/* 0x144 */ u16 mFogIdx;
/* 0x146 */ u16 mAlphaCompIdx;
/* 0x148 */ u16 mBlendIdx;
/* 0x14A */ u16 mNBTScaleIdx;
}; // size 0x14C
struct J3DIndInitData {
/* 0x000 */ bool mEnabled;
/* 0x001 */ u8 mIndTexStageNum;
/* 0x002 */ u8 field_0x002[2];
/* 0x004 */ J3DIndTexOrderInfo mIndTexOrderInfo[3];
/* 0x010 */ u8 field_0x010[4];
/* 0x014 */ J3DIndTexMtxInfo mIndTexMtxInfo[3];
/* 0x068 */ J3DIndTexCoordScaleInfo mIndTexCoordScaleInfo[3];
/* 0x074 */ u8 field_0x074[4];
/* 0x078 */ J3DIndTevStageInfo mIndTevStageInfo[0x10];
}; // size 0x138
struct J3DPatchingInfo {
/* 0x0 */ u16 mMatColorOffset;
/* 0x2 */ u16 mColorChanOffset;
/* 0x4 */ u16 mTexMtxOffset;
/* 0x6 */ u16 mTexNoOffset;
/* 0x8 */ u16 mTevRegOffset;
/* 0xA */ u16 mFogOffset;
/* 0xC */ u8 field_0xc[4];
}; // size 0x10
struct J3DDisplayListInit {
/* 0x0 */ u32 mOffset;
/* 0x4 */ u32 field_0x4;
}; // size 8
struct J3DTexCoord2Info;
struct J3DCurrentMtxInfo;
class J3DMaterialFactory {
public:
enum MaterialType {
@@ -16,50 +82,87 @@ public:
/* 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;
/* 80330304 */ u32 countTexGens(int) const;
/* 8033033C */ u32 countStages(int) const;
/* 803303C4 */ J3DMaterial* create(J3DMaterial*, MaterialType, int, u32) const;
/* 80330440 */ J3DMaterial* createNormalMaterial(J3DMaterial*, int, u32) const;
/* 80330D84 */ J3DMaterial* 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;
/* 803317D4 */ J3DMaterial* createLockedMaterial(J3DMaterial*, int, u32) const;
/* 80331A7C */ u32 calcSize(J3DMaterial*, MaterialType, int, u32) const;
/* 80331AFC */ u32 calcSizeNormalMaterial(J3DMaterial*, int, u32) const;
/* 80331C30 */ u32 calcSizePatchedMaterial(J3DMaterial*, int, u32) const;
/* 80331D00 */ u32 calcSizeLockedMaterial(J3DMaterial*, int, u32) const;
/* 80331D18 */ J3DGXColor newMatColor(int, int) const;
/* 80331D74 */ u8 newColorChanNum(int) const;
/* 80331DAC */ J3DColorChan newColorChan(int, int) const;
/* 80331F50 */ J3DGXColor newAmbColor(int, int) const;
/* 80331FAC */ u32 newTexGenNum(int) const;
/* 80331FE4 */ J3DTexCoord newTexCoord(int, int) const;
/* 80332044 */ J3DTexMtx* newTexMtx(int, int) const;
/* 803320CC */ u8 newCullMode(int) const;
/* 8033210C */ u16 newTexNo(int, int) const;
/* 80332154 */ J3DTevOrder newTevOrder(int, int) const;
/* 803321A0 */ J3DGXColorS10 newTevColor(int, int) const;
/* 80332210 */ J3DGXColor newTevKColor(int, int) const;
/* 8033226C */ u8 newTevStageNum(int) const;
/* 803322A4 */ J3DTevStage newTevStage(int, int) const;
/* 80332304 */ J3DTevSwapModeTable newTevSwapModeTable(int, int) const;
/* 803323A0 */ u8 newIndTexStageNum(int) const;
/* 803323C8 */ J3DIndTexOrder newIndTexOrder(int, int) const;
/* 8033240C */ J3DIndTexMtx newIndTexMtx(int, int) const;
/* 803324B4 */ J3DIndTevStage newIndTevStage(int, int) const;
/* 80332648 */ J3DIndTexCoordScale newIndTexCoordScale(int, int) const;
/* 8033268C */ J3DFog newFog(int) const;
/* 80332768 */ J3DAlphaComp newAlphaComp(int) const;
/* 803327E8 */ J3DBlend newBlend(int) const;
/* 8033282C */ J3DZMode newZMode(int) const;
/* 8033288C */ u8 newZCompLoc(int) const;
/* 803328C4 */ u8 newDither(int) const;
/* 803328FC */ J3DNBTScale newNBTScale(int) const;
u16 getMaterialID(int i_idx) { return mpMaterialID[i_idx]; }
u16 getMaterialID(int idx) const { return mpMaterialID[idx]; }
u8 getMaterialMode(int idx) const { return mpMaterialInitData[mpMaterialID[idx]].mMaterialMode; }
static u32 getMdlDataFlag_TevStageNum(u32 flags) { return (flags >> 0x10) & 0x1f; }
static u32 getMdlDataFlag_TexGenFlag(u32 flags) { return flags & 0x0c000000; }
static u32 getMdlDataFlag_ColorFlag(u32 flags) { return flags & 0xc0000000; }
static u32 getMdlDataFlag_PEFlag(u32 flags) { return flags & 0x30000000; }
/* 0x00 */ u8 field_0x00[8];
/* 0x00 */ u16 mMaterialNum;
/* 0x04 */ J3DMaterialInitData* mpMaterialInitData;
/* 0x08 */ u16* mpMaterialID;
/* 0x0C */ u8 field_0x0c[0x7C];
/* 0x0C */ J3DIndInitData* mpIndInitData;
/* 0x10 */ GXColor* mpMatColor;
/* 0x14 */ u8* mpColorChanNum;
/* 0x18 */ J3DColorChanInfo* mpColorChanInfo;
/* 0x1C */ GXColor* mpAmbColor;
/* 0x20 */ J3DLightInfo* mpLightInfo;
/* 0x24 */ u8* mpTexGenNum;
/* 0x28 */ J3DTexCoordInfo* mpTexCoordInfo;
/* 0x2C */ J3DTexCoord2Info* mpTexCoord2Info;
/* 0x30 */ J3DTexMtxInfo* mpTexMtxInfo;
/* 0x34 */ J3DTexMtxInfo* field_0x34;
/* 0x38 */ u16* mpTexNo;
/* 0x3C */ GXCullMode* mpCullMode;
/* 0x40 */ J3DTevOrderInfo* mpTevOrderInfo;
/* 0x44 */ GXColorS10* mpTevColor;
/* 0x48 */ GXColor* mpTevKColor;
/* 0x4C */ u8* mpTevStageNum;
/* 0x50 */ J3DTevStageInfo* mpTevStageInfo;
/* 0x54 */ J3DTevSwapModeInfo* mpTevSwapModeInfo;
/* 0x58 */ J3DTevSwapModeTableInfo* mpTevSwapModeTableInfo;
/* 0x5C */ J3DFogInfo* mpFogInfo;
/* 0x60 */ J3DAlphaCompInfo* mpAlphaCompInfo;
/* 0x64 */ J3DBlendInfo* mpBlendInfo;
/* 0x68 */ J3DZModeInfo* mpZModeInfo;
/* 0x6C */ u8* mpZCompLoc;
/* 0x70 */ u8* mpDither;
/* 0x74 */ J3DNBTScaleInfo* mpNBTScaleInfo;
/* 0x78 */ J3DDisplayListInit* mpDisplayListInit;
/* 0x7C */ J3DPatchingInfo* mpPatchingInfo;
/* 0x80 */ J3DCurrentMtxInfo* mpCurrentMtxInfo;
/* 0x84 */ u8* mpMaterialMode;
};
#endif /* J3DMATERIALFACTORY_H */
@@ -1,92 +1,107 @@
#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 */
#ifndef J3DMATERIALFACTORY_V21_H
#define J3DMATERIALFACTORY_V21_H
#include "JSystem/J3DGraphBase/J3DMatBlock.h"
#include "JSystem/J3DGraphLoader/J3DModelLoader.h"
#include "dolphin/gx/GXEnum.h"
#include "dolphin/gx/GXStruct.h"
class J3DMaterial;
struct J3DTexCoord2Info;
struct J3DCurrentMtxInfo;
struct J3DMaterialInitData_v21 {
/* 0x000 */ u8 mMaterialMode;
/* 0x001 */ u8 mCullModeIdx;
/* 0x002 */ u8 mColorChanNumIdx;
/* 0x003 */ u8 mTexGenNumIdx;
/* 0x004 */ u8 mTevStageNumIdx;
/* 0x005 */ u8 mZCompLocIdx;
/* 0x006 */ u8 mZModeIdx;
/* 0x007 */ u8 mDitherIdx;
/* 0x008 */ u16 mMatColorIdx[2];
/* 0x00C */ u16 mColorChanIdx[4];
/* 0x014 */ u16 mTexCoordIdx[8];
/* 0x024 */ u8 field_0x038[0x10];
/* 0x034 */ u16 mTexMtxIdx[8];
/* 0x044 */ u8 field_0x058[0x2c];
/* 0x070 */ u16 mTexNoIdx[8];
/* 0x080 */ u16 mTevKColorIdx[4];
/* 0x088 */ u8 mTevKColorSel[0x10];
/* 0x098 */ u8 mTevKAlphaSel[0x10];
/* 0x0A8 */ u16 mTevOrderIdx[0x10];
/* 0x0C8 */ u16 mTevColorIdx[4];
/* 0x0D0 */ u16 mTevStageIdx[0x10];
/* 0x0F0 */ u16 mTevSwapModeIdx[0x10];
/* 0x110 */ u16 mTevSwapModeTableIdx[4];
/* 0x118 */ u8 field_0x12c[0x18];
/* 0x130 */ u16 mFogIdx;
/* 0x132 */ u16 mAlphaCompIdx;
/* 0x134 */ u16 mBlendIdx;
/* 0x136 */ u16 mNBTScaleIdx;
}; // size 0x138
class J3DMaterialFactory_v21 {
public:
/* 80332DA4 */ J3DMaterialFactory_v21(J3DMaterialBlock_v21 const&);
/* 80332F84 */ u16 countUniqueMaterials();
/* 80332FA8 */ u32 countTexGens(int) const;
/* 80332FE0 */ u32 countStages(int) const;
/* 80333068 */ J3DMaterial* create(J3DMaterial*, int, u32) const;
/* 803337D8 */ J3DGXColor newMatColor(int, int) const;
/* 80333834 */ u8 newColorChanNum(int) const;
/* 8033386C */ J3DColorChan newColorChan(int, int) const;
/* 80333A10 */ u32 newTexGenNum(int) const;
/* 80333A48 */ J3DTexCoord newTexCoord(int, int) const;
/* 80333AA8 */ J3DTexMtx* newTexMtx(int, int) const;
/* 80333B30 */ u8 newCullMode(int) const;
/* 80333B70 */ u16 newTexNo(int, int) const;
/* 80333BB8 */ J3DTevOrder newTevOrder(int, int) const;
/* 80333C04 */ J3DGXColorS10 newTevColor(int, int) const;
/* 80333C74 */ J3DGXColor newTevKColor(int, int) const;
/* 80333CD0 */ u8 newTevStageNum(int) const;
/* 80333D08 */ J3DTevStage newTevStage(int, int) const;
/* 80333D68 */ J3DTevSwapModeTable newTevSwapModeTable(int, int) const;
/* 80333E04 */ J3DFog newFog(int) const;
/* 80333EE0 */ J3DAlphaComp newAlphaComp(int) const;
/* 80333F60 */ J3DBlend newBlend(int) const;
/* 80333FA4 */ J3DZMode newZMode(int) const;
/* 80334004 */ u8 newZCompLoc(int) const;
/* 8033403C */ u8 newDither(int) const;
/* 80334074 */ J3DNBTScale newNBTScale(int) const;
u16 getMaterialID(u16 idx) { return mpMaterialID[idx]; }
/* 0x00 */ u16 mMaterialNum;
/* 0x04 */ J3DMaterialInitData_v21* mpMaterialInitData;
/* 0x08 */ u16* mpMaterialID;
/* 0x0C */ GXColor* mpMatColor;
/* 0x10 */ u8* mpColorChanNum;
/* 0x14 */ J3DColorChanInfo* mpColorChanInfo;
/* 0x18 */ u8* mpTexGenNum;
/* 0x1C */ J3DTexCoordInfo* mpTexCoordInfo;
/* 0x20 */ J3DTexCoord2Info* mpTexCoord2Info;
/* 0x24 */ J3DTexMtxInfo* mpTexMtxInfo;
/* 0x28 */ J3DTexMtxInfo* field_0x28;
/* 0x2C */ u16* mpTexNo;
/* 0x30 */ GXCullMode* mpCullMode;
/* 0x34 */ J3DTevOrderInfo* mpTevOrderInfo;
/* 0x38 */ GXColorS10* mpTevColor;
/* 0x3C */ GXColor* mpTevKColor;
/* 0x40 */ u8* mpTevStageNum;
/* 0x44 */ J3DTevStageInfo* mpTevStageInfo;
/* 0x48 */ J3DTevSwapModeInfo* mpTevSwapModeInfo;
/* 0x4C */ J3DTevSwapModeTableInfo* mpTevSwapModeTableInfo;
/* 0x50 */ J3DFogInfo* mpFogInfo;
/* 0x54 */ J3DAlphaCompInfo* mpAlphaCompInfo;
/* 0x58 */ J3DBlendInfo* mpBlendInfo;
/* 0x5C */ J3DZModeInfo* mpZModeInfo;
/* 0x60 */ u8* mpZCompLoc;
/* 0x64 */ u8* mpDither;
/* 0x68 */ J3DNBTScaleInfo* mpNBTScaleInfo;
/* 0x6C */ u16 field_0x6c;
/* 0x6E */ u8 field_0x6e;
/* 0x6F */ u8 field_0x6f;
};
#endif /* J3DMATERIALFACTORY_V21_H */
+249 -227
View File
@@ -1,227 +1,249 @@
#ifndef J3DMODELLOADER_H
#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 J3DModelData* load(void const* i_data, u32 i_flags);
};
#endif /* J3DMODELLOADER_H */
#ifndef J3DMODELLOADER_H
#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* mpMaterialInitData;
/* 0x10 */ void* mpMaterialID;
/* 0x14 */ void* mpNameTable;
/* 0x18 */ void* mpCullMode;
/* 0x1C */ void* mpMatColor;
/* 0x20 */ void* mpColorChanNum;
/* 0x24 */ void* mpColorChanInfo;
/* 0x28 */ void* mpTexGenNum;
/* 0x2C */ void* mpTexCoordInfo;
/* 0x30 */ void* mpTexCoord2Info;
/* 0x34 */ void* mpTexMtxInfo;
/* 0x38 */ void* field_0x38;
/* 0x3C */ void* mpTexNo;
/* 0x40 */ void* mpTevOrderInfo;
/* 0x44 */ void* mpTevColor;
/* 0x48 */ void* mpTevKColor;
/* 0x4C */ void* mpTevStageNum;
/* 0x50 */ void* mpTevStageInfo;
/* 0x54 */ void* mpTevSwapModeInfo;
/* 0x58 */ void* mpTevSwapModeTableInfo;
/* 0x5C */ void* mpFogInfo;
/* 0x60 */ void* mpAlphaCompInfo;
/* 0x64 */ void* mpBlendInfo;
/* 0x68 */ void* mpZModeInfo;
/* 0x6C */ void* mpZCompLoc;
/* 0x70 */ void* mpDither;
/* 0x74 */ void* mpNBTScaleInfo;
};
struct J3DMaterialDLBlock : public J3DModelBlock {
/* 0x08 */ u16 mMaterialNum;
/* 0x0C */ void* mpDisplayListInit;
/* 0x10 */ void* mpPatchingInfo;
/* 0x14 */ void* mpCurrentMtxInfo;
/* 0x18 */ void* mpMaterialMode;
/* 0x1C */ void* field_0x1c;
/* 0x20 */ void* mpNameTable;
};
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 J3DModelData* load(void const* i_data, u32 i_flags);
};
#endif /* J3DMODELLOADER_H */