summaryrefslogtreecommitdiff
path: root/include/JSystem
diff options
context:
space:
mode:
authorLagoLunatic <LagoLunatic@users.noreply.github.com>2025-06-18 20:14:26 -0400
committerLagoLunatic <LagoLunatic@users.noreply.github.com>2025-06-18 20:14:26 -0400
commitede01ca07bb0b79f27369f82cda41e5cb13697a8 (patch)
treef571e952d80852011c36d84898c5a153b91994ff /include/JSystem
parent264ee5d6e1cacf0c3bae2dd1a83fe15052d35b94 (diff)
daPy_lk_c::draw and linkDraw matched on retail with (void)0 assert, d_a_figure OK
Diffstat (limited to 'include/JSystem')
-rw-r--r--include/JSystem/J3DGraphAnimator/J3DAnimation.h5
-rw-r--r--include/JSystem/J3DGraphAnimator/J3DSkinDeform.h6
-rw-r--r--include/JSystem/J3DGraphBase/J3DSys.h24
-rw-r--r--include/JSystem/JUtility/JUTAssert.h2
4 files changed, 27 insertions, 10 deletions
diff --git a/include/JSystem/J3DGraphAnimator/J3DAnimation.h b/include/JSystem/J3DGraphAnimator/J3DAnimation.h
index 596ffc38..4f1b6f6f 100644
--- a/include/JSystem/J3DGraphAnimator/J3DAnimation.h
+++ b/include/JSystem/J3DGraphAnimator/J3DAnimation.h
@@ -620,7 +620,10 @@ public:
u16 getUpdateMaterialNum() const { return mUpdateMaterialNum; }
bool isValidUpdateMaterialID(u16 id) const { return mUpdateMaterialID[id] != 0xFFFF; }
- u16 getUpdateMaterialID(u16 idx) const { return mUpdateMaterialID[idx]; }
+ u16 getUpdateMaterialID(u16 idx) const {
+ J3D_ASSERT(1578, idx < mUpdateMaterialNum, "Error : range over.");
+ return mUpdateMaterialID[idx];
+ }
JUTNameTab * getUpdateMaterialName() { return &mUpdateMaterialName; }
protected:
diff --git a/include/JSystem/J3DGraphAnimator/J3DSkinDeform.h b/include/JSystem/J3DGraphAnimator/J3DSkinDeform.h
index 46bea165..46752032 100644
--- a/include/JSystem/J3DGraphAnimator/J3DSkinDeform.h
+++ b/include/JSystem/J3DGraphAnimator/J3DSkinDeform.h
@@ -3,6 +3,7 @@
#include "JSystem/J3DGraphAnimator/J3DCluster.h"
#include "JSystem/J3DGraphBase/J3DTransform.h"
+#include "JSystem/JUtility/JUTAssert.h"
#include "dolphin/types.h"
#include "global.h"
@@ -21,7 +22,10 @@ public:
u16 getClusterNum() const { return mClusterNum; }
u16 getClusterKeyNum() const { return mClusterKeyNum; }
- J3DCluster* getClusterPointer(u16 i) { return &mClusterPointer[i]; }
+ J3DCluster* getClusterPointer(u16 index) {
+ J3D_ASSERT(186, (index < mClusterNum),"Error : range over.");
+ return &mClusterPointer[index];
+ }
J3DClusterKey* getClusterKeyPointer(u16 i) { return &mClusterKeyPointer[i]; }
f32* getVtxPos() { return mVtxPos; }
f32* getVtxNrm() { return mVtxNrm; }
diff --git a/include/JSystem/J3DGraphBase/J3DSys.h b/include/JSystem/J3DGraphBase/J3DSys.h
index 58e9bac9..e43e022a 100644
--- a/include/JSystem/J3DGraphBase/J3DSys.h
+++ b/include/JSystem/J3DGraphBase/J3DSys.h
@@ -1,6 +1,7 @@
#ifndef J3DSYS_H
#define J3DSYS_H
+#include "JSystem/JUtility/JUTAssert.h"
#include "dolphin/gx/GX.h"
#include "dolphin/types.h"
@@ -53,13 +54,13 @@ public:
void setDrawModeXlu() { mDrawMode = XLU; }
- void* getVtxPos() const { return mVtxPos; }
+ void* getVtxPos() { return mVtxPos; }
void setVtxPos(void* pVtxPos) { mVtxPos = pVtxPos; }
- void* getVtxNrm() const { return mVtxNrm; }
+ void* getVtxNrm() { return mVtxNrm; }
void setVtxNrm(void* pVtxNrm) { mVtxNrm = pVtxNrm; }
- void* getVtxCol() const { return mVtxCol; }
+ void* getVtxCol() { return mVtxCol; }
void setVtxCol(GXColor* pVtxCol) { mVtxCol = pVtxCol; }
void setModel(J3DModel* pModel) { mModel = pModel; }
@@ -69,7 +70,7 @@ public:
void setMaterialMode(u32 mode) { mMaterialMode = mode; }
void setCurrentMtxCalc(J3DMtxCalc * pCalc) { mCurrentMtxCalc = pCalc; }
- J3DMtxCalc * getCurrentMtxCalc() const { return mCurrentMtxCalc; }
+ J3DMtxCalc * getCurrentMtxCalc() { return mCurrentMtxCalc; }
void setTexture(J3DTexture* pTex) { mTexture = pTex; }
J3DTexture* getTexture() { return mTexture; }
@@ -92,14 +93,21 @@ public:
// Type 0: Opa Buffer
// Type 1: Xlu Buffer
- void setDrawBuffer(J3DDrawBuffer* buffer, int type) { mDrawBuffer[type] = buffer; }
+ void setDrawBuffer(J3DDrawBuffer* buffer, int type) {
+ J3D_ASSERT(114, type >= 0 && type < 2, "Error : range over.");
+ J3D_ASSERT(115, buffer, "Error : null pointer.");
+ mDrawBuffer[type] = buffer;
+ }
// Type 0: Opa Buffer
// Type 1: Xlu Buffer
- J3DDrawBuffer* getDrawBuffer(int type) { return mDrawBuffer[type]; }
+ J3DDrawBuffer* getDrawBuffer(int type) {
+ J3D_ASSERT(121, type >= 0 && type < 2, "Error : range over.");
+ return mDrawBuffer[type];
+ }
- Mtx& getModelDrawMtx(u16 no) const { return mModelDrawMtx[no]; }
- J3DShapePacket* getShapePacket() const { return mShapePacket; }
+ Mtx& getModelDrawMtx(u16 no) { return mModelDrawMtx[no]; }
+ J3DShapePacket* getShapePacket() { return mShapePacket; }
J3DModel* getModel() { return mModel; }
Vec* getNBTScale() { return mNBTScale; }
diff --git a/include/JSystem/JUtility/JUTAssert.h b/include/JSystem/JUtility/JUTAssert.h
index ec9c1123..3c174b19 100644
--- a/include/JSystem/JUtility/JUTAssert.h
+++ b/include/JSystem/JUtility/JUTAssert.h
@@ -18,6 +18,8 @@
} \
}
+#define J3D_ASSERT(LINE, COND, MSG) (void)0
+
#define JUT_WARN(LINE, ...) \
JUTAssertion::setWarningMessage_f(JUTAssertion::getSDevice(), __FILE__, LINE, __VA_ARGS__); \