From d9c2ffe6190d6342bf00328b30bdaa67c30ffee3 Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Tue, 26 Aug 2025 17:43:02 -0400 Subject: [PATCH] J3DModel inlines --- include/JSystem/J3DGraphAnimator/J3DModelData.h | 6 ++---- src/JSystem/J3DGraphAnimator/J3DModel.cpp | 4 ++-- src/d/actor/d_a_bb.cpp | 4 ++-- src/d/actor/d_a_boko.cpp | 2 +- src/d/actor/d_a_obj_ikada.cpp | 2 +- src/d/actor/d_a_ship.cpp | 12 ++++++------ src/d/actor/d_a_shop_item.cpp | 2 +- 7 files changed, 15 insertions(+), 17 deletions(-) diff --git a/include/JSystem/J3DGraphAnimator/J3DModelData.h b/include/JSystem/J3DGraphAnimator/J3DModelData.h index 24f3e30cb..39d8efdce 100644 --- a/include/JSystem/J3DGraphAnimator/J3DModelData.h +++ b/include/JSystem/J3DGraphAnimator/J3DModelData.h @@ -71,8 +71,10 @@ public: u32 getModelDataType() const { return mJointTree.getModelDataType(); } const J3DModelHierarchy* getHierarchy() const { return mJointTree.getHierarchy(); } void setHierarchy(J3DModelHierarchy* hierarchy) { mJointTree.setHierarchy(hierarchy); } + J3DMtxCalc* getBasicMtxCalc() { return mJointTree.getBasicMtxCalc(); } void setBasicMtxCalc(J3DMtxCalc* calc) { mJointTree.setBasicMtxCalc(calc); } void setModelDataType(u32 type) { mJointTree.setModelDataType(type); } + J3DJoint* getRootNode() { return mJointTree.getRootNode(); } GXColor* getVtxColorArray(u8 idx) const { return mVertexData.getVtxColorArray(idx); } bool checkFlag(u32 flag) const { return (mFlags & flag) ? true : false; } u32 getFlag() const { return mFlags; } @@ -109,10 +111,6 @@ public: } const void* getBinary() { return mBinary; } - // TODO - void getBasicMtxCalc() {} - void getRootNode() {} - private: friend class J3DModelLoader; diff --git a/src/JSystem/J3DGraphAnimator/J3DModel.cpp b/src/JSystem/J3DGraphAnimator/J3DModel.cpp index 278835d51..7e8459941 100644 --- a/src/JSystem/J3DGraphAnimator/J3DModel.cpp +++ b/src/JSystem/J3DGraphAnimator/J3DModel.cpp @@ -484,14 +484,14 @@ s32 J3DModel::setSkinDeform(J3DSkinDeform* pSkinDeform, u32 flags) { /* 802EE5D8-802EE67C .text calcAnmMtx__8J3DModelFv */ void J3DModel::calcAnmMtx() { j3dSys.setModel(this); - j3dSys.setCurrentMtxCalc(getModelData()->getJointTree().getBasicMtxCalc()); + j3dSys.setCurrentMtxCalc(getModelData()->getBasicMtxCalc()); if (checkFlag(J3DMdlFlag_Unk00002)) j3dSys.getCurrentMtxCalc()->init(j3dDefaultScale, j3dDefaultMtx); else j3dSys.getCurrentMtxCalc()->init(mBaseScale, mBaseTransformMtx); - getModelData()->getJointTree().getBasicMtxCalc()->recursiveCalc(getModelData()->getJointTree().getRootNode()); + getModelData()->getBasicMtxCalc()->recursiveCalc(getModelData()->getRootNode()); } /* 802EE67C-802EE874 .text calcWeightEnvelopeMtx__8J3DModelFv */ diff --git a/src/d/actor/d_a_bb.cpp b/src/d/actor/d_a_bb.cpp index d1459a032..e424a2e46 100644 --- a/src/d/actor/d_a_bb.cpp +++ b/src/d/actor/d_a_bb.cpp @@ -612,7 +612,7 @@ static BOOL daBb_Draw(bb_class* i_this) { i_this->mpMorf->entryDL(); J3DModelData* modelData = model->getModelData(); - modelData->getMaterialTable().removeTexNoAnimator(i_this->mBtpAnm.getBtpAnm()); + i_this->mBtpAnm.remove(modelData); daBb_shadowDraw(i_this); tail_draw(i_this); #if VERSION == VERSION_DEMO @@ -2715,7 +2715,7 @@ static cPhs_State daBb_Create(fopAc_ac_c* a_this) { for (u16 i = 0; i < model->getModelData()->getJointNum(); i++) { if (callback_check_index[i] >= 0) { - model->getModelData()->getJointTree().getJointNodePointer(i)->setCallBack(nodeCallBack); + model->getModelData()->getJointNodePointer(i)->setCallBack(nodeCallBack); } } diff --git a/src/d/actor/d_a_boko.cpp b/src/d/actor/d_a_boko.cpp index 5b36a62ae..a5ded0948 100644 --- a/src/d/actor/d_a_boko.cpp +++ b/src/d/actor/d_a_boko.cpp @@ -988,7 +988,7 @@ cPhs_State daBoko_c::create() { mStts.Init(10, 0xff, this); if (type == Type_BOKO_STICK_e) { - mpModel->getModelData()->getJointTree().getJointNodePointer(2)->getMesh()->getShape()->hide(); + mpModel->getModelData()->getJointNodePointer(2)->getMesh()->getShape()->hide(); } mSph.Set(sph_src); mSph.SetStts(&mStts); diff --git a/src/d/actor/d_a_obj_ikada.cpp b/src/d/actor/d_a_obj_ikada.cpp index a350bccaf..dee6c9b0a 100644 --- a/src/d/actor/d_a_obj_ikada.cpp +++ b/src/d/actor/d_a_obj_ikada.cpp @@ -1467,7 +1467,7 @@ BOOL daObj_Ikada_c::_createHeap() { case 1: case 2: case 3: - modelData->getJointTree().getJointNodePointer(i)->setCallBack(nodeControl_CB); + modelData->getJointNodePointer(i)->setCallBack(nodeControl_CB); break; } } diff --git a/src/d/actor/d_a_ship.cpp b/src/d/actor/d_a_ship.cpp index c88f5bd4a..e2ee7fe44 100644 --- a/src/d/actor/d_a_ship.cpp +++ b/src/d/actor/d_a_ship.cpp @@ -4596,7 +4596,7 @@ cPhs_State daShip_c::create() { for (u16 jno = 0; jno < pModelData->getJointNum(); jno++) { if ((jno == 10) || (jno == 5) || (jno == 7) || (jno == 6)) { - pModelData->getJointTree().getJointNodePointer(jno)->setCallBack(daShip_bodyJointCallBack); + pModelData->getJointNodePointer(jno)->setCallBack(daShip_bodyJointCallBack); } } @@ -4621,7 +4621,7 @@ cPhs_State daShip_c::create() { for (u16 jno = 0; jno < pModelData->getJointNum(); jno++) { if (jno == 8 || jno == 10) { - pModelData->getJointTree().getJointNodePointer(jno)->setCallBack(daShip_headJointCallBack0); + pModelData->getJointNodePointer(jno)->setCallBack(daShip_headJointCallBack0); } else if ( !(jno != 2 && jno != 3 && jno != 4 && jno != 5 && jno != 6) || (jno == 7) @@ -4629,7 +4629,7 @@ cPhs_State daShip_c::create() { // jno == 2 || jno == 3 || jno == 4 || jno == 5 || jno == 6 || jno == 7 // But the compiler optimizes that differently ) { - pModelData->getJointTree().getJointNodePointer(jno)->setCallBack(daShip_headJointCallBack1); + pModelData->getJointNodePointer(jno)->setCallBack(daShip_headJointCallBack1); } } @@ -4637,11 +4637,11 @@ cPhs_State daShip_c::create() { pModelData = mpCannonModel->getModelData(); - pModelData->getJointTree().getJointNodePointer(1)->setCallBack(daShip_cannonJointCallBack); - pModelData->getJointTree().getJointNodePointer(2)->setCallBack(daShip_cannonJointCallBack); + pModelData->getJointNodePointer(1)->setCallBack(daShip_cannonJointCallBack); + pModelData->getJointNodePointer(2)->setCallBack(daShip_cannonJointCallBack); mpSalvageArmModel->setUserArea(reinterpret_cast(this)); - mpSalvageArmModel->getModelData()->getJointTree().getJointNodePointer(1)->setCallBack(daShip_craneJointCallBack); + mpSalvageArmModel->getModelData()->getJointNodePointer(1)->setCallBack(daShip_craneJointCallBack); m034B = fopAcM_GetParam(this); mPart = PART_WAIT_e; diff --git a/src/d/actor/d_a_shop_item.cpp b/src/d/actor/d_a_shop_item.cpp index 5145e6eb1..d19a04e76 100644 --- a/src/d/actor/d_a_shop_item.cpp +++ b/src/d/actor/d_a_shop_item.cpp @@ -159,7 +159,7 @@ bool daShopItem_c::_draw() { if(!chkDraw()) return true; if(m_itemNo == WATER_STATUE || m_itemNo == POSTMAN_STATUE) { - mpModel->getModelData()->getJointTree().getJointNodePointer(0)->setMtxCalc(0); + mpModel->getModelData()->getJointNodePointer(0)->setMtxCalc(0); } DrawBase();