summaryrefslogtreecommitdiff
path: root/include/JSystem/J3DGraphLoader
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2023-09-10 12:14:15 -0700
committerJasper St. Pierre <jstpierre@mecheye.net>2023-09-10 12:14:15 -0700
commitaa738135ed578495a08ff867fecf44ac74e4810e (patch)
tree8e73fe217f7a0e97c325041d0d4ea2d8c8cdc8f4 /include/JSystem/J3DGraphLoader
parenta4c20f513675b160402160c2b34c141f84e87258 (diff)
d_a_Obj_Gryw00 nonmatching start
Diffstat (limited to 'include/JSystem/J3DGraphLoader')
-rw-r--r--include/JSystem/J3DGraphLoader/J3DAnmLoader.h17
-rw-r--r--include/JSystem/J3DGraphLoader/J3DClusterLoader.h9
-rw-r--r--include/JSystem/J3DGraphLoader/J3DJointFactory.h48
-rw-r--r--include/JSystem/J3DGraphLoader/J3DMaterialFactory.h6
-rw-r--r--include/JSystem/J3DGraphLoader/J3DMaterialFactory_v21.h6
-rw-r--r--include/JSystem/J3DGraphLoader/J3DModelLoader.h11
-rw-r--r--include/JSystem/J3DGraphLoader/J3DModelLoaderCalcSize.h6
-rw-r--r--include/JSystem/J3DGraphLoader/J3DShapeFactory.h78
8 files changed, 181 insertions, 0 deletions
diff --git a/include/JSystem/J3DGraphLoader/J3DAnmLoader.h b/include/JSystem/J3DGraphLoader/J3DAnmLoader.h
new file mode 100644
index 00000000..93786634
--- /dev/null
+++ b/include/JSystem/J3DGraphLoader/J3DAnmLoader.h
@@ -0,0 +1,17 @@
+#ifndef J3DANMLOADER_H
+#define J3DANMLOADER_H
+
+#include "dolphin/types.h"
+
+enum J3DAnmLoaderDataBaseFlag { J3DLOADER_UNK_FLAG0 };
+
+class J3DAnmBase;
+
+struct J3DAnmLoaderDataBase {
+ /* 80337B40 */ static void* load(void const*, J3DAnmLoaderDataBaseFlag);
+ /* 80338134 */ static void setResource(J3DAnmBase*, void const*);
+
+ static void* load(void const* param_0) { return load(param_0, J3DLOADER_UNK_FLAG0); }
+};
+
+#endif /* J3DANMLOADER_H */
diff --git a/include/JSystem/J3DGraphLoader/J3DClusterLoader.h b/include/JSystem/J3DGraphLoader/J3DClusterLoader.h
new file mode 100644
index 00000000..35a79ddb
--- /dev/null
+++ b/include/JSystem/J3DGraphLoader/J3DClusterLoader.h
@@ -0,0 +1,9 @@
+#ifndef J3DCLUSTERLOADER_H
+#define J3DCLUSTERLOADER_H
+
+
+struct J3DClusterLoaderDataBase {
+ /* 80334130 */ static void* load(void const*);
+};
+
+#endif /* J3DCLUSTERLOADER_H */
diff --git a/include/JSystem/J3DGraphLoader/J3DJointFactory.h b/include/JSystem/J3DGraphLoader/J3DJointFactory.h
new file mode 100644
index 00000000..2c7653b2
--- /dev/null
+++ b/include/JSystem/J3DGraphLoader/J3DJointFactory.h
@@ -0,0 +1,48 @@
+#ifndef J3DJOINTFACTORY_H
+#define J3DJOINTFACTORY_H
+
+#include "JSystem/J3DGraphBase/J3DTransform.h"
+#include "dolphin/types.h"
+
+class J3DJoint;
+struct ResNTAB;
+
+struct J3DJointInitData {
+ /* 0x00 */ u16 mKind;
+ /* 0x02 */ bool mScaleCompensate;
+ /* 0x04 */ J3DTransformInfo mTransformInfo;
+ /* 0x24 */ f32 mRadius;
+ /* 0x28 */ Vec mMin;
+ /* 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);
+
+ J3DJointInitData* mJointInitData;
+ u16* mIndexTable;
+
+ u16 getKind(int no) const { return mJointInitData[mIndexTable[no]].mKind; }
+ u8 getScaleCompensate(int no) const { return mJointInitData[mIndexTable[no]].mScaleCompensate; }
+ const J3DTransformInfo& getTransformInfo(int no) const {
+ return mJointInitData[mIndexTable[no]].mTransformInfo;
+ }
+ f32 getRadius(int no) const { return mJointInitData[mIndexTable[no]].mRadius; }
+ Vec& getMin(int no) const { return mJointInitData[mIndexTable[no]].mMin; }
+ Vec& getMax(int no) const { return mJointInitData[mIndexTable[no]].mMax; }
+};
+
+#endif /* J3DJOINTFACTORY_H */ \ No newline at end of file
diff --git a/include/JSystem/J3DGraphLoader/J3DMaterialFactory.h b/include/JSystem/J3DGraphLoader/J3DMaterialFactory.h
new file mode 100644
index 00000000..50785d4c
--- /dev/null
+++ b/include/JSystem/J3DGraphLoader/J3DMaterialFactory.h
@@ -0,0 +1,6 @@
+#ifndef J3DMATERIALFACTORY_H
+#define J3DMATERIALFACTORY_H
+
+#include "dolphin/types.h"
+
+#endif /* J3DMATERIALFACTORY_H */
diff --git a/include/JSystem/J3DGraphLoader/J3DMaterialFactory_v21.h b/include/JSystem/J3DGraphLoader/J3DMaterialFactory_v21.h
new file mode 100644
index 00000000..41e88bde
--- /dev/null
+++ b/include/JSystem/J3DGraphLoader/J3DMaterialFactory_v21.h
@@ -0,0 +1,6 @@
+#ifndef J3DMATERIALFACTORY_V21_H
+#define J3DMATERIALFACTORY_V21_H
+
+#include "dolphin/types.h"
+
+#endif /* J3DMATERIALFACTORY_V21_H */
diff --git a/include/JSystem/J3DGraphLoader/J3DModelLoader.h b/include/JSystem/J3DGraphLoader/J3DModelLoader.h
new file mode 100644
index 00000000..deff8ed9
--- /dev/null
+++ b/include/JSystem/J3DGraphLoader/J3DModelLoader.h
@@ -0,0 +1,11 @@
+#ifndef J3DMODELLOADER_H
+#define J3DMODELLOADER_H
+
+#include "dolphin/types.h"
+
+class J3DModelLoaderDataBase {
+public:
+ /* 803346BC */ static void* load(void const*, u32);
+};
+
+#endif /* J3DMODELLOADER_H */
diff --git a/include/JSystem/J3DGraphLoader/J3DModelLoaderCalcSize.h b/include/JSystem/J3DGraphLoader/J3DModelLoaderCalcSize.h
new file mode 100644
index 00000000..5b231aeb
--- /dev/null
+++ b/include/JSystem/J3DGraphLoader/J3DModelLoaderCalcSize.h
@@ -0,0 +1,6 @@
+#ifndef J3DMODELLOADERCALCSIZE_H
+#define J3DMODELLOADERCALCSIZE_H
+
+#include "dolphin/types.h"
+
+#endif /* J3DMODELLOADERCALCSIZE_H */
diff --git a/include/JSystem/J3DGraphLoader/J3DShapeFactory.h b/include/JSystem/J3DGraphLoader/J3DShapeFactory.h
new file mode 100644
index 00000000..63df9092
--- /dev/null
+++ b/include/JSystem/J3DGraphLoader/J3DShapeFactory.h
@@ -0,0 +1,78 @@
+#ifndef J3DSHAPEFACTORY_H
+#define J3DSHAPEFACTORY_H
+
+#include "dolphin/gx/GXAttr.h"
+#include "dolphin/mtx/vec.h"
+
+class J3DShape;
+class J3DShapeMtx;
+class J3DShapeDraw;
+struct ResNTAB;
+
+struct J3DShapeInitData {
+ /* 0x00 */ u8 mShapeMtxType;
+ /* 0x02 */ u16 mMtxGroupNum;
+ /* 0x04 */ u16 mVtxDescListIndex;
+ /* 0x06 */ u16 mMtxInitDataIndex;
+ /* 0x08 */ u16 mDrawInitDataIndex;
+ /* 0x0C */ f32 mRadius;
+ /* 0x10 */ Vec mMin;
+ /* 0x1C */ Vec mMax;
+};
+
+struct J3DShapeMtxInitData {
+ /* 0x00 */ u16 mUseMtxIndex;
+ /* 0x02 */ u16 mUseMtxCount;
+ /* 0x04 */ u32 mFirstUseMtxIndex;
+};
+
+struct J3DShapeDrawInitData {
+ /* 0x00 */ u32 mDisplayListSize;
+ /* 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*);
+ /* 803375BC */ J3DShapeMtx* newShapeMtx(u32, int, int) const;
+ /* 8033784C */ J3DShapeDraw* newShapeDraw(int, int) const;
+ /* 803378D8 */ void allocVcdVatCmdBuffer(u32);
+ /* 80337944 */ s32 calcSize(int, u32);
+ /* 803379D8 */ s32 calcSizeVcdVatCmdBuffer(u32);
+ /* 803379E8 */ s32 calcSizeShapeMtx(u32, int, int) const;
+
+ /* 0x00 */ J3DShapeInitData* mShapeInitData;
+ /* 0x04 */ u16* mIndexTable;
+ /* 0x08 */ GXVtxDescList* mVtxDescList;
+ /* 0x0C */ u16* mMtxTable;
+ /* 0x10 */ u8* mDisplayListData;
+ /* 0x14 */ J3DShapeMtxInitData* mMtxInitData;
+ /* 0x18 */ J3DShapeDrawInitData* mDrawInitData;
+ /* 0x1C */ u8* mVcdVatCmdBuffer;
+
+ u32 getMtxGroupNum(int no) const { return mShapeInitData[mIndexTable[no]].mMtxGroupNum; }
+ GXVtxDescList* getVtxDescList(int no) const { return (GXVtxDescList*)((u8*)mVtxDescList + mShapeInitData[mIndexTable[no]].mVtxDescListIndex); }
+ f32 getRadius(int no) const { return mShapeInitData[mIndexTable[no]].mRadius; }
+ Vec& getMin(int no) const { return mShapeInitData[mIndexTable[no]].mMin; }
+ Vec& getMax(int no) const { return mShapeInitData[mIndexTable[no]].mMax; }
+};
+
+
+#endif /* J3DSHAPEFACTORY_H */ \ No newline at end of file