diff --git a/configure.py b/configure.py index 5804d77ee..ab9b32333 100755 --- a/configure.py +++ b/configure.py @@ -1656,7 +1656,7 @@ config.libs = [ ActorRel(NonMatching, "d_a_obj_ekskz"), ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_obj_eskban", extra_cflags=['-pragma "nosyminline on"']), ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_obj_ferris", extra_cflags=['-pragma "nosyminline on"']), - ActorRel(NonMatching, "d_a_obj_figure", extra_cflags=['-pragma "nosyminline on"']), + ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_obj_figure", extra_cflags=['-pragma "nosyminline on"']), ActorRel(NonMatching, "d_a_obj_firewall"), ActorRel(NonMatching, "d_a_obj_flame"), ActorRel(NonMatching, "d_a_obj_ftree"), diff --git a/include/JSystem/J3DGraphAnimator/J3DAnimation.h b/include/JSystem/J3DGraphAnimator/J3DAnimation.h index 596ffc38e..4f1b6f6f1 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 46bea165a..467520324 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 58e9bac9f..e43e022ae 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 ec9c11230..3c174b196 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__); \ diff --git a/src/JSystem/JAudio/JAISeMgr.cpp b/src/JSystem/JAudio/JAISeMgr.cpp index 936edcaf7..ca7f941f4 100644 --- a/src/JSystem/JAudio/JAISeMgr.cpp +++ b/src/JSystem/JAudio/JAISeMgr.cpp @@ -106,7 +106,7 @@ JAInter::SeParameter::SeParameter() {} void JAInter::SeMgr::startSeSequence() { seHandle = NULL; JAIBasic::msBasic->startSoundActor(0x80000800, &seHandle, NULL, 1, 4); - JUT_ASSERT_MSG(149, JAISeMgr::seHandle, "SEシーケンスの再生に失敗しました。\n") + JUT_ASSERT_MSG(149, JAISeMgr::seHandle, "SEシーケンスの再生に失敗しました。\n"); } /* 80293508-80293530 .text processGFrameSe__Q27JAInter5SeMgrFv */ diff --git a/src/JSystem/JAudio/JAISoundTable.cpp b/src/JSystem/JAudio/JAISoundTable.cpp index 699627f8b..3d294bba7 100644 --- a/src/JSystem/JAudio/JAISoundTable.cpp +++ b/src/JSystem/JAudio/JAISoundTable.cpp @@ -42,7 +42,7 @@ SoundInfo* JAInter::SoundTable::getInfoPointer(u32 param_1) { switch (param_1 & JAISoundID_TypeMask) { case JAISoundID_Type_Se: _category = param_1 >> 12 & 0xff; - JUT_ASSERT_MSG(61, (_categorycalc(); #if VERSION > VERSION_DEMO J3DModel* model = pMorf->getModel(); diff --git a/src/d/actor/d_a_player_main.cpp b/src/d/actor/d_a_player_main.cpp index ae1671e85..3e06472f8 100644 --- a/src/d/actor/d_a_player_main.cpp +++ b/src/d/actor/d_a_player_main.cpp @@ -1671,7 +1671,6 @@ void daPy_lk_c::onBodyEffect() { /* 80107308-80108204 .text draw__9daPy_lk_cFv */ BOOL daPy_lk_c::draw() { - /* Nonmatching - retail-only regalloc (maybe the same issue as linkDraw in d_a_obj_figure.cpp?) */ if (mSightPacket.getDrawFlg()) { mSightPacket.setSight(); }