summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLagoLunatic <LagoLunatic@users.noreply.github.com>2023-12-19 01:30:03 -0500
committerLagoLunatic <LagoLunatic@users.noreply.github.com>2023-12-19 01:30:03 -0500
commitfa59660bf249e00a75dd5afe37b2f05ef4484128 (patch)
treee68403e5e27a632b0c35bf0630fa693be4bd2a95 /include
parent0a5559c9a55b241c1e7cfd6550148c9bf0cdbb1b (diff)
J3DModelLoaderCalcSize 98%
Diffstat (limited to 'include')
-rw-r--r--include/JSystem/J3DGraphAnimator/J3DJointTree.h2
-rw-r--r--include/JSystem/J3DGraphLoader/J3DMaterialFactory.h8
-rw-r--r--include/JSystem/J3DGraphLoader/J3DModelLoader.h34
3 files changed, 24 insertions, 20 deletions
diff --git a/include/JSystem/J3DGraphAnimator/J3DJointTree.h b/include/JSystem/J3DGraphAnimator/J3DJointTree.h
index aaae4c8e..32f41941 100644
--- a/include/JSystem/J3DGraphAnimator/J3DJointTree.h
+++ b/include/JSystem/J3DGraphAnimator/J3DJointTree.h
@@ -8,7 +8,7 @@
class JUTNameTab;
struct J3DModelHierarchy {
- /* 0x0 */ u16 mType;
+ /* 0x0 */ u16 mType; // TODO enum
/* 0x2 */ u16 mValue;
inline u16 getValue() const { return mValue; }
diff --git a/include/JSystem/J3DGraphLoader/J3DMaterialFactory.h b/include/JSystem/J3DGraphLoader/J3DMaterialFactory.h
index 7eb47802..b2cf9836 100644
--- a/include/JSystem/J3DGraphLoader/J3DMaterialFactory.h
+++ b/include/JSystem/J3DGraphLoader/J3DMaterialFactory.h
@@ -25,10 +25,10 @@ public:
void createPatchedMaterial(J3DMaterial*, int, unsigned long) const;
void modifyPatchedCurrentMtx(J3DMaterial*, int) const;
void createLockedMaterial(J3DMaterial*, int, unsigned long) const;
- void calcSize(J3DMaterial*, MaterialType, int, unsigned long) const;
- void calcSizeNormalMaterial(J3DMaterial*, int, unsigned long) const;
- void calcSizePatchedMaterial(J3DMaterial*, int, unsigned long) const;
- void calcSizeLockedMaterial(J3DMaterial*, int, unsigned long) const;
+ u32 calcSize(J3DMaterial*, MaterialType, int, unsigned long) const;
+ u32 calcSizeNormalMaterial(J3DMaterial*, int, unsigned long) const;
+ u32 calcSizePatchedMaterial(J3DMaterial*, int, unsigned long) const;
+ u32 calcSizeLockedMaterial(J3DMaterial*, int, unsigned long) const;
void newMatColor(int, int) const;
void newColorChanNum(int) const;
void newColorChan(int, int) const;
diff --git a/include/JSystem/J3DGraphLoader/J3DModelLoader.h b/include/JSystem/J3DGraphLoader/J3DModelLoader.h
index da967138..3bdf6499 100644
--- a/include/JSystem/J3DGraphLoader/J3DModelLoader.h
+++ b/include/JSystem/J3DGraphLoader/J3DModelLoader.h
@@ -11,6 +11,10 @@ inline u32 getBdlFlag_MaterialType(u32 i_flags) {
struct J3DModelBlock {
/* 0x00 */ u32 mBlockType;
/* 0x04 */ u32 mBlockSize;
+
+ const J3DModelBlock* getNext() const {
+ return reinterpret_cast<const J3DModelBlock*>(reinterpret_cast<const u8*>(this) + mBlockSize);
+ }
};
struct J3DModelFileData {
@@ -135,18 +139,18 @@ public:
virtual J3DModelData* load(const void*, u32);
virtual J3DMaterialTable* loadMaterialTable(const void*);
virtual J3DModelData* loadBinaryDisplayList(const void*, u32);
- virtual void calcLoadSize(const void*, u32);
- virtual void calcLoadMaterialTableSize(const void*);
- virtual void calcLoadBinaryDisplayListSize(const void*, u32);
- virtual void countMaterialNum(const void*);
+ virtual u32 calcLoadSize(const void*, u32);
+ virtual u32 calcLoadMaterialTableSize(const void*);
+ virtual u32 calcLoadBinaryDisplayListSize(const void*, u32);
+ virtual u16 countMaterialNum(const void*);
virtual void setupBBoardInfo();
virtual ~J3DModelLoader() {}
virtual void readMaterial(const J3DMaterialBlock*, u32) {}
virtual void readMaterial_v21(const J3DMaterialBlock_v21*, u32) {}
virtual void readMaterialTable(const J3DMaterialBlock*, u32) {}
virtual void readMaterialTable_v21(const J3DMaterialBlock_v21*, u32) {}
- virtual s32 calcSizeMaterial(const J3DMaterialBlock*, u32) { return 0; }
- virtual s32 calcSizeMaterialTable(const J3DMaterialBlock*, u32) { return 0; }
+ virtual u32 calcSizeMaterial(const J3DMaterialBlock*, u32) { return 0; }
+ virtual u32 calcSizeMaterialTable(const J3DMaterialBlock*, u32) { return 0; }
void readInformation(const J3DModelInfoBlock*, u32);
void readVertex(const J3DVertexBlock*);
@@ -159,13 +163,13 @@ public:
void readPatchedMaterial(const J3DMaterialBlock*, u32);
void readMaterialDL(const J3DMaterialDLBlock*, u32);
void modifyMaterial(u32);
- void calcSizeInformation(const J3DModelInfoBlock*, u32);
- void calcSizeJoint(const J3DJointBlock*);
- void calcSizeShape(const J3DShapeBlock*, u32);
- void calcSizeTexture(const J3DTextureBlock*);
- void calcSizeTextureTable(const J3DTextureBlock*);
- void calcSizePatchedMaterial(const J3DMaterialBlock*, u32);
- void calcSizeMaterialDL(const J3DMaterialDLBlock*, u32);
+ u32 calcSizeInformation(const J3DModelInfoBlock*, u32);
+ u32 calcSizeJoint(const J3DJointBlock*);
+ u32 calcSizeShape(const J3DShapeBlock*, u32);
+ u32 calcSizeTexture(const J3DTextureBlock*);
+ u32 calcSizeTextureTable(const J3DTextureBlock*);
+ u32 calcSizePatchedMaterial(const J3DMaterialBlock*, u32);
+ u32 calcSizeMaterialDL(const J3DMaterialDLBlock*, u32);
protected:
/* 0x04 */ J3DModelData* mpModelData;
@@ -189,8 +193,8 @@ public:
~J3DModelLoader_v26() {}
void readMaterial(const J3DMaterialBlock*, u32);
void readMaterialTable(const J3DMaterialBlock*, u32);
- s32 calcSizeMaterial(const J3DMaterialBlock*, u32);
- s32 calcSizeMaterialTable(const J3DMaterialBlock*, u32);
+ u32 calcSizeMaterial(const J3DMaterialBlock*, u32);
+ u32 calcSizeMaterialTable(const J3DMaterialBlock*, u32);
};
#endif /* J3DMODELLOADER_H */