summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorhatal175 <hatal175@users.noreply.github.com>2025-04-16 00:09:31 +0300
committerGitHub <noreply@github.com>2025-04-15 14:09:31 -0700
commitb5e932c493742411fdcef695be5879b729d115c8 (patch)
tree0a6c2e25be2ded3e5b539d0be4834b19c12a43b1 /include
parent59ff71c355015c7ed2ffadf96371db67c1b1d0b5 (diff)
A Little j3d work (#2396)
Diffstat (limited to 'include')
-rw-r--r--include/JSystem/J3DGraphAnimator/J3DAnimation.h2
-rw-r--r--include/JSystem/J3DGraphAnimator/J3DCluster.h6
-rw-r--r--include/JSystem/J3DGraphAnimator/J3DJointTree.h2
-rw-r--r--include/JSystem/J3DGraphAnimator/J3DModel.h2
-rw-r--r--include/JSystem/J3DGraphAnimator/J3DModelData.h2
-rw-r--r--include/JSystem/J3DGraphAnimator/J3DMtxBuffer.h2
-rw-r--r--include/JSystem/J3DGraphBase/J3DVertex.h2
-rw-r--r--include/JSystem/JUtility/JUTAssert.h3
8 files changed, 14 insertions, 7 deletions
diff --git a/include/JSystem/J3DGraphAnimator/J3DAnimation.h b/include/JSystem/J3DGraphAnimator/J3DAnimation.h
index 88e0480bad..ca556f1546 100644
--- a/include/JSystem/J3DGraphAnimator/J3DAnimation.h
+++ b/include/JSystem/J3DGraphAnimator/J3DAnimation.h
@@ -722,7 +722,7 @@ public:
u16 getUpdateMaterialNum() const { return mUpdateMaterialNum; }
bool isValidUpdateMaterialID(u16 id) const { return mUpdateMaterialID[id] != 0xFFFF; }
u16 getUpdateMaterialID(u16 idx) const {
- JUT_ASSERT_MSG(1578, 0 <= mUpdateMaterialNum - idx, "Error : range over.")
+ J3D_ASSERT(1578, idx < mUpdateMaterialNum, "Error : range over.")
return mUpdateMaterialID[idx];
}
diff --git a/include/JSystem/J3DGraphAnimator/J3DCluster.h b/include/JSystem/J3DGraphAnimator/J3DCluster.h
index ea9fbe2b7b..c575e890f9 100644
--- a/include/JSystem/J3DGraphAnimator/J3DCluster.h
+++ b/include/JSystem/J3DGraphAnimator/J3DCluster.h
@@ -1,6 +1,7 @@
#ifndef J3DCLUSTER_H
#define J3DCLUSTER_H
+#include "JSystem/JUtility/JUTAssert.h"
#include "dolphin/types.h"
class J3DDeformer;
@@ -79,7 +80,10 @@ public:
/* 8032E274 */ void deform(J3DModel*);
/* 8032E364 */ void setAnm(J3DAnmCluster*);
- J3DCluster* getClusterPointer(u16 index) { return &mClusterPointer[index]; }
+ J3DCluster* getClusterPointer(u16 index) {
+ J3D_ASSERT(186, (index < mClusterNum),"Error : range over.");
+ return &mClusterPointer[index];
+ }
u16 getClusterNum() const { return mClusterNum; }
u16 getClusterKeyNum() const { return mClusterKeyNum; }
J3DClusterKey* getClusterKeyPointer(u16 i) { return &mClusterKeyPointer[i]; }
diff --git a/include/JSystem/J3DGraphAnimator/J3DJointTree.h b/include/JSystem/J3DGraphAnimator/J3DJointTree.h
index c1558e5a91..3b9bb85539 100644
--- a/include/JSystem/J3DGraphAnimator/J3DJointTree.h
+++ b/include/JSystem/J3DGraphAnimator/J3DJointTree.h
@@ -65,7 +65,7 @@ public:
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]; }
+ Mtx& getInvJointMtx(int idx) { return mInvJointMtx[idx]; }
u32 getModelDataType() const { return mModelDataType; }
void setModelDataType(u32 type) { mModelDataType = type; }
bool checkFlag(u32 flag) { return mFlags & flag; }
diff --git a/include/JSystem/J3DGraphAnimator/J3DModel.h b/include/JSystem/J3DGraphAnimator/J3DModel.h
index 5bbd7dc352..eca87c8127 100644
--- a/include/JSystem/J3DGraphAnimator/J3DModel.h
+++ b/include/JSystem/J3DGraphAnimator/J3DModel.h
@@ -86,7 +86,7 @@ public:
Mtx& getBaseTRMtx() { return mBaseTransformMtx; }
void setBaseTRMtx(Mtx m) { MTXCopy(m, mBaseTransformMtx); }
u32 getMtxCalcMode() const { return mFlags & 0x03; }
- J3DVertexBuffer* getVertexBuffer() const { return (J3DVertexBuffer*)&mVertexBuffer; }
+ J3DVertexBuffer* getVertexBuffer() { return (J3DVertexBuffer*)&mVertexBuffer; }
J3DMatPacket* getMatPacket(u16 idx) const { return &mMatPacket[idx]; }
J3DShapePacket* getShapePacket(u16 idx) const { return &mShapePacket[idx]; }
J3DMtxBuffer* getMtxBuffer() const { return mMtxBuffer; }
diff --git a/include/JSystem/J3DGraphAnimator/J3DModelData.h b/include/JSystem/J3DGraphAnimator/J3DModelData.h
index 629a82e12d..fd613ce616 100644
--- a/include/JSystem/J3DGraphAnimator/J3DModelData.h
+++ b/include/JSystem/J3DGraphAnimator/J3DModelData.h
@@ -52,7 +52,7 @@ public:
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); }
+ Mtx& getInvJointMtx(int idx) { return mJointTree.getInvJointMtx(idx); }
J3DTexture* getTexture() const { return mMaterialTable.getTexture(); }
JUTNameTab* getTextureName() const { return mMaterialTable.getTextureName(); }
u16 getWEvlpMtxNum() const { return mJointTree.getWEvlpMtxNum(); }
diff --git a/include/JSystem/J3DGraphAnimator/J3DMtxBuffer.h b/include/JSystem/J3DGraphAnimator/J3DMtxBuffer.h
index abf85d35c8..5f9d4da047 100644
--- a/include/JSystem/J3DGraphAnimator/J3DMtxBuffer.h
+++ b/include/JSystem/J3DGraphAnimator/J3DMtxBuffer.h
@@ -15,7 +15,7 @@ public:
/* 80326214 */ void initialize();
/* 80326258 */ s32 create(J3DModelData*, u32);
- /* 80326364 */ s32 createAnmMtx(J3DModelData*);
+ /* 80326364 */ J3DError createAnmMtx(J3DModelData*);
/* 803263F0 */ s32 createWeightEnvelopeMtx(J3DModelData*);
/* 8032648C */ s32 setNoUseDrawMtx();
/* 803264B8 */ s32 createDoubleDrawMtx(J3DModelData*, u32);
diff --git a/include/JSystem/J3DGraphBase/J3DVertex.h b/include/JSystem/J3DGraphBase/J3DVertex.h
index ccc247c0dd..c6def61e96 100644
--- a/include/JSystem/J3DGraphBase/J3DVertex.h
+++ b/include/JSystem/J3DGraphBase/J3DVertex.h
@@ -102,7 +102,7 @@ public:
void* getTransformedVtxPos(int idx) { return mTransformedVtxPosArray[idx]; }
void* getTransformedVtxNrm(int idx) { return mTransformedVtxNrmArray[idx]; }
- J3DVertexData* getVertexData() { return mVtxData; }
+ J3DVertexData* getVertexData() const { return mVtxData; }
void swapTransformedVtxPos() {
void* tmp = mTransformedVtxPosArray[0];
diff --git a/include/JSystem/JUtility/JUTAssert.h b/include/JSystem/JUtility/JUTAssert.h
index 71a764b3c8..5d469fb3a0 100644
--- a/include/JSystem/JUtility/JUTAssert.h
+++ b/include/JSystem/JUtility/JUTAssert.h
@@ -13,6 +13,8 @@
#define JUT_ASSERT_MSG_F(LINE, COND, MSG, ...) \
(COND) ? (void)0 : (JUTAssertion::showAssert_f(JUTAssertion::getSDevice(), __FILE__, LINE, MSG, __VA_ARGS__), OSPanic(__FILE__, LINE, "Halt"));
+#define J3D_ASSERT(LINE, COND, MSG) JUT_ASSERT_MSG(LINE, (COND) != 0, MSG)
+
#define JUT_PANIC(LINE, TEXT) \
JUTAssertion::showAssert(JUTAssertion::getSDevice(), __FILE__, LINE, TEXT); \
OSPanic(__FILE__, LINE, "Halt");
@@ -33,6 +35,7 @@
#define JUT_ASSERT(...) (void)0;
#define JUT_ASSERT_MSG(...) (void)0;
#define JUT_ASSERT_MSG_F(...) (void)0;
+#define J3D_ASSERT(...) (void)0;
#define JUT_PANIC(...)
#define JUT_WARN(...)
#define JUT_WARN_DEVICE(...)