diff options
| author | LagoLunatic <LagoLunatic@users.noreply.github.com> | 2025-06-20 02:41:43 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-19 23:41:43 -0700 |
| commit | ac069664149342aff58ed84cf51c62b3eb8399da (patch) | |
| tree | eab73c3959a6f052a388fe96fc46b42d48a16508 /src | |
| parent | 25d13c76e4080c7b2fabf00b7836ba13de7e9dc0 (diff) | |
Add more J3D_ASSERTs (#2491)
* Fix debug build
* Add more J3D_ASSERTs
* Move J3DShapeMtx to correct header for assert
* Add VSCode task for ninja changes_all
Diffstat (limited to 'src')
| -rw-r--r-- | src/JSystem/J3DGraphAnimator/J3DAnimation.cpp | 10 | ||||
| -rw-r--r-- | src/JSystem/J3DGraphAnimator/J3DCluster.cpp | 6 | ||||
| -rw-r--r-- | src/JSystem/J3DGraphAnimator/J3DMaterialAttach.cpp | 34 | ||||
| -rw-r--r-- | src/JSystem/J3DGraphAnimator/J3DModel.cpp | 1 | ||||
| -rw-r--r-- | src/JSystem/J3DGraphBase/J3DPacket.cpp | 1 | ||||
| -rw-r--r-- | src/JSystem/J3DGraphBase/J3DShape.cpp | 46 | ||||
| -rw-r--r-- | src/JSystem/J3DGraphLoader/J3DShapeFactory.cpp | 1 | ||||
| -rw-r--r-- | src/d/actor/d_a_npc.cpp | 82 | ||||
| -rw-r--r-- | src/d/d_bg_parts.cpp | 11 | ||||
| -rw-r--r-- | src/d/d_file_select.cpp | 27 | ||||
| -rw-r--r-- | src/d/d_menu_collect.cpp | 1 |
11 files changed, 123 insertions, 97 deletions
diff --git a/src/JSystem/J3DGraphAnimator/J3DAnimation.cpp b/src/JSystem/J3DGraphAnimator/J3DAnimation.cpp index ce963c03b5..78f0cd70ab 100644 --- a/src/JSystem/J3DGraphAnimator/J3DAnimation.cpp +++ b/src/JSystem/J3DGraphAnimator/J3DAnimation.cpp @@ -1120,6 +1120,7 @@ void J3DAnmTexPattern::getTexNo(u16 i_index, u16* o_texNo) const { /* 8032B004-8032B09C 325944 0098+00 1/1 1/1 0/0 .text * searchUpdateMaterialID__16J3DAnmTexPatternFP16J3DMaterialTable */ void J3DAnmTexPattern::searchUpdateMaterialID(J3DMaterialTable* i_materialTable) { + J3D_ASSERT(1790, i_materialTable, "Error : null pointer."); for (u16 i = 0; i < mUpdateMaterialNum; i++) { s32 index = i_materialTable->getMaterialName()->getIndex(mUpdateMaterialName.getName(i)); if (index != -1) { @@ -1133,13 +1134,15 @@ void J3DAnmTexPattern::searchUpdateMaterialID(J3DMaterialTable* i_materialTable) /* 8032B09C-8032B0C0 3259DC 0024+00 0/0 4/4 1/1 .text * searchUpdateMaterialID__16J3DAnmTexPatternFP12J3DModelData */ void J3DAnmTexPattern::searchUpdateMaterialID(J3DModelData* i_modelData) { + J3D_ASSERT(1813, i_modelData, "Error : null pointer."); searchUpdateMaterialID(&i_modelData->getMaterialTable()); } /* 8032B0C0-8032B1D4 325A00 0114+00 1/1 1/1 0/0 .text * searchUpdateMaterialID__19J3DAnmTextureSRTKeyFP16J3DMaterialTable */ void J3DAnmTextureSRTKey::searchUpdateMaterialID(J3DMaterialTable* i_materialTable) { - for (u16 i = 0; i < u16(mTrackNum / 3); i++) { + J3D_ASSERT(1832, i_materialTable, "Error : null pointer."); + for (u16 i = 0; i < getUpdateMaterialNum(); i++) { s32 index = i_materialTable->getMaterialName()->getIndex(mUpdateMaterialName.getName(i)); if (index != -1) { mUpdateMaterialID[i] = index; @@ -1147,7 +1150,7 @@ void J3DAnmTextureSRTKey::searchUpdateMaterialID(J3DMaterialTable* i_materialTab mUpdateMaterialID[i] = -1; } } - for (u16 i = 0; i < u16(field_0x4a / 3); i++) { + for (u16 i = 0; i < getPostUpdateMaterialNum(); i++) { s32 index = i_materialTable->getMaterialName()->getIndex(mPostUpdateMaterialName.getName(i)); if (index != -1) { mPostUpdateMaterialID[i] = index; @@ -1160,6 +1163,7 @@ void J3DAnmTextureSRTKey::searchUpdateMaterialID(J3DMaterialTable* i_materialTab /* 8032B1D4-8032B1F8 325B14 0024+00 0/0 8/8 6/6 .text * searchUpdateMaterialID__19J3DAnmTextureSRTKeyFP12J3DModelData */ void J3DAnmTextureSRTKey::searchUpdateMaterialID(J3DModelData* i_modelData) { + J3D_ASSERT(1871, i_modelData, "Error : null pointer."); searchUpdateMaterialID(&i_modelData->getMaterialTable()); } @@ -1324,6 +1328,7 @@ void J3DAnmTevRegKey::getTevKonstReg(u16 i_index, GXColor* o_color) const { /* 8032B780-8032B87C 3260C0 00FC+00 1/1 1/1 0/0 .text * searchUpdateMaterialID__15J3DAnmTevRegKeyFP16J3DMaterialTable */ void J3DAnmTevRegKey::searchUpdateMaterialID(J3DMaterialTable* i_materialTable) { + J3D_ASSERT(2083, i_materialTable, "Error : null pointer."); for (u16 i = 0; i < mCRegUpdateMaterialNum; i++) { s32 index = i_materialTable->getMaterialName()->getIndex(mCRegUpdateMaterialName.getName(i)); if (index != -1) { @@ -1345,5 +1350,6 @@ void J3DAnmTevRegKey::searchUpdateMaterialID(J3DMaterialTable* i_materialTable) /* 8032B87C-8032B8A0 3261BC 0024+00 0/0 9/9 4/4 .text * searchUpdateMaterialID__15J3DAnmTevRegKeyFP12J3DModelData */ void J3DAnmTevRegKey::searchUpdateMaterialID(J3DModelData* i_modelData) { + J3D_ASSERT(2119, i_modelData, "Error : null pointer."); searchUpdateMaterialID(&i_modelData->getMaterialTable()); } diff --git a/src/JSystem/J3DGraphAnimator/J3DCluster.cpp b/src/JSystem/J3DGraphAnimator/J3DCluster.cpp index 411457599c..b4e8f6780b 100644 --- a/src/JSystem/J3DGraphAnimator/J3DCluster.cpp +++ b/src/JSystem/J3DGraphAnimator/J3DCluster.cpp @@ -37,7 +37,7 @@ void J3DDeformData::offAllFlag(u32 i_flag) { /* 8032E274-8032E298 328BB4 0024+00 0/0 1/1 0/0 .text deform__13J3DDeformDataFP8J3DModel */ void J3DDeformData::deform(J3DModel* model) { - J3D_ASSERT(110, model,"Error : null pointer"); + J3D_ASSERT(110, model, "Error : null pointer"); deform(model->getVertexBuffer()); } @@ -45,7 +45,7 @@ void J3DDeformData::deform(J3DModel* model) { /* 8032E298-8032E364 328BD8 00CC+00 1/1 0/0 0/0 .text deform__13J3DDeformDataFP15J3DVertexBuffer */ void J3DDeformData::deform(J3DVertexBuffer* buffer) { - J3D_ASSERT(141, buffer,"Error : null pointer"); + J3D_ASSERT(141, buffer, "Error : null pointer"); buffer->swapVtxPosArrayPointer(); buffer->swapVtxNrmArrayPointer(); @@ -83,7 +83,7 @@ J3DDeformer::J3DDeformer(J3DDeformData* data) { /* 8032E3BC-8032E4A4 328CFC 00E8+00 1/1 0/0 0/0 .text deform__11J3DDeformerFP15J3DVertexBufferUs */ void J3DDeformer::deform(J3DVertexBuffer* buffer, u16 param_1) { - J3D_ASSERT(222, buffer,"Error : null pointer"); + J3D_ASSERT(222, buffer, "Error : null pointer"); u16 var_r31 = 0; if (mAnmCluster != NULL) { diff --git a/src/JSystem/J3DGraphAnimator/J3DMaterialAttach.cpp b/src/JSystem/J3DGraphAnimator/J3DMaterialAttach.cpp index 4598abbc97..4bac6a28d4 100644 --- a/src/JSystem/J3DGraphAnimator/J3DMaterialAttach.cpp +++ b/src/JSystem/J3DGraphAnimator/J3DMaterialAttach.cpp @@ -215,26 +215,23 @@ int J3DMaterialTable::entryTexNoAnimator(J3DAnmTexPattern* param_1) { /* 8032FCC4-8032FE70 32A604 01AC+00 0/0 14/14 6/6 .text * entryTexMtxAnimator__16J3DMaterialTableFP19J3DAnmTextureSRTKey */ -// NONMATCHING regalloc -int J3DMaterialTable::entryTexMtxAnimator(J3DAnmTextureSRTKey* param_1) { - JUT_ASSERT_MSG(532, param_1 != NULL, "Error : null pointer.") +int J3DMaterialTable::entryTexMtxAnimator(J3DAnmTextureSRTKey* btk) { + JUT_ASSERT_MSG(532, btk != NULL, "Error : null pointer.") int rv = 0; - u16 materialNum = param_1->getUpdateMaterialNum(); - rv = createTexMtxForAnimator(param_1); + u16 materialNum = btk->getUpdateMaterialNum(); + rv = createTexMtxForAnimator(btk); if (rv != 0) { return rv; } if (isLocked()) { return 2; } - for (u16 i = 0; i < materialNum; i++) { - if (param_1->isValidUpdateMaterialID(i)) { - u16 updateMaterialId = param_1->getUpdateMaterialID(i); - // Maybe helps? Makes material r26 instead of r30 - //J3DMaterial* material = (J3DMaterial*)getMaterialNodePointer((u16)updateMaterialId); + for (u16 no = 0; no < materialNum; no++) { + if (btk->isValidUpdateMaterialID(no)) { + u16 updateMaterialId = btk->getUpdateMaterialID(no); J3DMaterial* material = getMaterialNodePointer((u16)updateMaterialId); J3DMaterialAnm* materialAnm = material->getMaterialAnm(); - u8 texMtxID = param_1->getUpdateTexMtxID(i); + u8 texMtxID = btk->getUpdateTexMtxID(no); if (materialAnm == 0) { rv = 1; } else { @@ -242,15 +239,12 @@ int J3DMaterialTable::entryTexMtxAnimator(J3DAnmTextureSRTKey* param_1) { if (material->getTexCoord(texMtxID) != NULL) { material->getTexCoord(texMtxID)->setTexGenMtx((u8)texMtxID * 3 + 30); } - J3DTexMtxInfo& iVar3 = material->getTexMtx(texMtxID)->getTexMtxInfo(); - iVar3.mInfo = (iVar3.mInfo & 0x3f) | (param_1->getTexMtxCalcType() << 7); - Vec* vec = param_1->getSRTCenter(i); - iVar3.mCenter.x = vec->x; - vec = param_1->getSRTCenter(i); - iVar3.mCenter.y = vec->y; - vec = param_1->getSRTCenter(i); - iVar3.mCenter.z = vec->z; - J3DTexMtxAnm texMtxAnm(i, param_1); + J3DTexMtxInfo& tmtxinfo = material->getTexMtx(texMtxID)->getTexMtxInfo(); + tmtxinfo.mInfo = (tmtxinfo.mInfo & 0x3f) | (btk->getTexMtxCalcType() << 7); + tmtxinfo.mCenter.x = btk->getSRTCenter(no)->x; + tmtxinfo.mCenter.y = btk->getSRTCenter(no)->y; + tmtxinfo.mCenter.z = btk->getSRTCenter(no)->z; + J3DTexMtxAnm texMtxAnm(no, btk); materialAnm->setTexMtxAnm(texMtxID, &texMtxAnm); } } diff --git a/src/JSystem/J3DGraphAnimator/J3DModel.cpp b/src/JSystem/J3DGraphAnimator/J3DModel.cpp index b6ebbc29c0..7632bfe58a 100644 --- a/src/JSystem/J3DGraphAnimator/J3DModel.cpp +++ b/src/JSystem/J3DGraphAnimator/J3DModel.cpp @@ -6,6 +6,7 @@ #include "JSystem/J3DGraphAnimator/J3DModel.h" #include "JSystem/J3DGraphAnimator/J3DMaterialAnm.h" #include "JSystem/J3DGraphBase/J3DMaterial.h" +#include "JSystem/J3DGraphBase/J3DShapeMtx.h" #include "dolphin/os.h" /* 80327100-80327184 321A40 0084+00 0/0 3/3 0/0 .text initialize__8J3DModelFv */ diff --git a/src/JSystem/J3DGraphBase/J3DPacket.cpp b/src/JSystem/J3DGraphBase/J3DPacket.cpp index 424dbda40a..b612d8ed64 100644 --- a/src/JSystem/J3DGraphBase/J3DPacket.cpp +++ b/src/JSystem/J3DGraphBase/J3DPacket.cpp @@ -2,6 +2,7 @@ #include "JSystem/J3DGraphAnimator/J3DModel.h" #include "JSystem/J3DGraphBase/J3DDrawBuffer.h" #include "JSystem/J3DGraphBase/J3DMaterial.h" +#include "JSystem/J3DGraphBase/J3DShapeMtx.h" #include "JSystem/JKernel/JKRHeap.h" #include <dolphin/os.h> #include <dolphin/os.h> diff --git a/src/JSystem/J3DGraphBase/J3DShape.cpp b/src/JSystem/J3DGraphBase/J3DShape.cpp index c3351a6824..dcccb4449d 100644 --- a/src/JSystem/J3DGraphBase/J3DShape.cpp +++ b/src/JSystem/J3DGraphBase/J3DShape.cpp @@ -47,7 +47,7 @@ void J3DShape::addTexMtxIndexInDL(GXAttr attr, u32 valueBase) { s32 stride = 0; bool found = false; - for (GXVtxDescList* vtxDesc = mVtxDesc; vtxDesc->attr != GX_VA_NULL; vtxDesc++) { + for (GXVtxDescList* vtxDesc = getVtxDesc(); vtxDesc->attr != GX_VA_NULL; vtxDesc++) { if (vtxDesc->attr == GX_VA_PNMTXIDX) pnmtxidxOffs = stride; @@ -105,15 +105,15 @@ void J3DShape::addTexMtxIndexInVcd(GXAttr attr) { /* 80314DA8-80314E28 30F6E8 0080+00 0/0 1/1 0/0 .text * calcNBTScale__8J3DShapeFRC3VecPA3_A3_fPA3_A3_f */ void J3DShape::calcNBTScale(Vec const& param_0, f32 (*param_1)[3][3], f32 (*param_2)[3][3]) { - for (u16 i = 0; i < getMtxGroupNum(); i++) - getShapeMtx(i)->calcNBTScale(param_0, param_1, param_2); + for (u16 i = 0; i < mMtxGroupNum; i++) + mShapeMtx[i]->calcNBTScale(param_0, param_1, param_2); } /* 80314E28-80314E98 30F768 0070+00 0/0 1/1 0/0 .text countBumpMtxNum__8J3DShapeCFv */ u32 J3DShape::countBumpMtxNum() const { u32 num = 0; - for (u16 i = 0; i < getMtxGroupNum(); i++) - num += getShapeMtx(i)->getUseMtxNum(); + for (u16 i = 0; i < mMtxGroupNum; i++) + num += mShapeMtx[i]->getUseMtxNum(); return num; } @@ -141,7 +141,7 @@ void J3DShape::loadVtxArray() const { /* 80314F5C-80314F98 30F89C 003C+00 0/0 1/1 0/0 .text isSameVcdVatCmd__8J3DShapeFP8J3DShape */ bool J3DShape::isSameVcdVatCmd(J3DShape* other) { - u8* a = other->mVcdVatCmd; + u8* a = (u8*)other->getVcdVatCmd(); u8* b = mVcdVatCmd; for (u32 i = 0; i < kVcdVatDLSize; i++) if (a[i] != b[i]) @@ -274,7 +274,7 @@ static u8 data_804515D4[4]; /* 80315398-8031544C 30FCD8 00B4+00 1/1 0/0 0/0 .text setArrayAndBindPipeline__8J3DShapeCFv */ void J3DShape::setArrayAndBindPipeline() const { - J3DShapeMtx::setCurrentPipeline(getPipeline()); + J3DShapeMtx::setCurrentPipeline((mFlags & 0x1C) >> 2); loadVtxArray(); j3dSys.setModelDrawMtx(mDrawMtx[*mCurrentViewNo]); j3dSys.setModelNrmMtx(mNrmMtx[*mCurrentViewNo]); @@ -302,24 +302,24 @@ void J3DShape::drawFast() const { if (J3DShapeMtx::getLODFlag() != 0) J3DShapeMtx::resetMtxLoadCache(); - for (u16 n = getMtxGroupNum(), i = 0; i < n; i++) { - if (getShapeMtx(i) != NULL) - getShapeMtx(i)->load(); - if (getShapeDraw(i) != NULL) - getShapeDraw(i)->draw(); + for (u16 n = mMtxGroupNum, i = 0; i < n; i++) { + if (mShapeMtx[i] != NULL) + mShapeMtx[i]->load(); + if (mShapeDraw[i] != NULL) + mShapeDraw[i]->draw(); } } else { J3DFifoLoadPosMtxImm(*j3dSys.getShapePacket()->getBaseMtxPtr(), GX_PNMTX0); J3DFifoLoadNrmMtxImm(*j3dSys.getShapePacket()->getBaseMtxPtr(), GX_PNMTX0); - for (u16 n = getMtxGroupNum(), i = 0; i < n; i++) - if (getShapeDraw(i) != NULL) - getShapeDraw(i)->draw(); + for (u16 n = mMtxGroupNum, i = 0; i < n; i++) + if (mShapeDraw[i] != NULL) + mShapeDraw[i]->draw(); } } /* 803155E0-80315628 30FF20 0048+00 1/0 0/0 0/0 .text draw__8J3DShapeCFv */ void J3DShape::draw() const { - sOldVcdVatCmd = NULL; + resetVcdVatCache(); loadPreDrawSetting(); drawFast(); } @@ -328,11 +328,11 @@ void J3DShape::draw() const { void J3DShape::simpleDraw() const { resetVcdVatCache(); loadPreDrawSetting(); - J3DShapeMtx::setCurrentPipeline(getPipeline()); + J3DShapeMtx::setCurrentPipeline((mFlags & 0x1C) >> 2); loadVtxArray(); - for (u16 n = getMtxGroupNum(), i = 0; i < n; i++) { - if (getShapeDraw(i) != NULL) { - getShapeDraw(i)->draw(); + for (u16 n = mMtxGroupNum, i = 0; i < n; i++) { + if (mShapeDraw[i] != NULL) { + mShapeDraw[i]->draw(); } } } @@ -348,7 +348,7 @@ void J3DShape::simpleDrawCache() const { mCurrentMtx.load(); loadVtxArray(); - for (u16 n = getMtxGroupNum(), i = 0; i < n; i++) - if (getShapeDraw(i) != NULL) - getShapeDraw(i)->draw(); + for (u16 n = mMtxGroupNum, i = 0; i < n; i++) + if (mShapeDraw[i] != NULL) + mShapeDraw[i]->draw(); } diff --git a/src/JSystem/J3DGraphLoader/J3DShapeFactory.cpp b/src/JSystem/J3DGraphLoader/J3DShapeFactory.cpp index e1fd636605..08dbd44df4 100644 --- a/src/JSystem/J3DGraphLoader/J3DShapeFactory.cpp +++ b/src/JSystem/J3DGraphLoader/J3DShapeFactory.cpp @@ -5,6 +5,7 @@ #include "JSystem/J3DGraphLoader/J3DShapeFactory.h" #include "JSystem/J3DGraphBase/J3DShape.h" +#include "JSystem/J3DGraphBase/J3DShapeMtx.h" #include "JSystem/JKernel/JKRHeap.h" #include "JSystem/JSupport/JSupport.h" #include "dolphin/os.h" diff --git a/src/d/actor/d_a_npc.cpp b/src/d/actor/d_a_npc.cpp index 66f853cacc..78136fb9b8 100644 --- a/src/d/actor/d_a_npc.cpp +++ b/src/d/actor/d_a_npc.cpp @@ -10,127 +10,127 @@ #ifdef DEBUG void daNpcT_cmnListenPropertyEvent(char* param_0, int* param_1, daNpcT_HIOParam* param_2) { - sprintf(¶m_0[*param_1], "%.3ff,\t// 注目オフセット\n", param_2->unk0); + sprintf(¶m_0[*param_1], "%.3ff,\t// 注目オフセット\n", param_2->attention_offset); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%.3ff,\t// 重力\n", param_2->unk4); + sprintf(¶m_0[*param_1], "%.3ff,\t// 重力\n", param_2->gravity); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%.3ff,\t// スケ−ル\n", param_2->unk8); + sprintf(¶m_0[*param_1], "%.3ff,\t// スケ−ル\n", param_2->scale); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%.3ff,\t// リアル影サイズ\n", param_2->unkC); + sprintf(¶m_0[*param_1], "%.3ff,\t// リアル影サイズ\n", param_2->real_shadow_size); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%.3ff,\t// 体重\n", param_2->unk10); + sprintf(¶m_0[*param_1], "%.3ff,\t// 体重\n", param_2->weight); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%.3ff,\t// 高さ\n", param_2->unk14); + sprintf(¶m_0[*param_1], "%.3ff,\t// 高さ\n", param_2->height); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%.3ff,\t// ひざ丈\n", param_2->unk18); + sprintf(¶m_0[*param_1], "%.3ff,\t// ひざ丈\n", param_2->knee_length); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%.3ff,\t// 幅\n", param_2->unk1C); + sprintf(¶m_0[*param_1], "%.3ff,\t// 幅\n", param_2->width); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%.3ff,\t// 腰のX角上限\n", param_2->unk20); + sprintf(¶m_0[*param_1], "%.3ff,\t// 腰のX角上限\n", param_2->body_angleX_max); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%.3ff,\t// 腰のX角下限\n", param_2->unk24); + sprintf(¶m_0[*param_1], "%.3ff,\t// 腰のX角下限\n", param_2->body_angleX_min); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%.3ff,\t// 腰のY角上限\n", param_2->unk28); + sprintf(¶m_0[*param_1], "%.3ff,\t// 腰のY角上限\n", param_2->body_angleY_max); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%.3ff,\t// 腰のY角下限\n", param_2->unk2C); + sprintf(¶m_0[*param_1], "%.3ff,\t// 腰のY角下限\n", param_2->body_angleY_min); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%.3ff,\t// 頭のX角上限\n", param_2->unk30); + sprintf(¶m_0[*param_1], "%.3ff,\t// 頭のX角上限\n", param_2->head_angleX_max); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%.3ff,\t// 頭のX角下限\n", param_2->unk34); + sprintf(¶m_0[*param_1], "%.3ff,\t// 頭のX角下限\n", param_2->head_angleX_min); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%.3ff,\t// 頭のY角上限\n", param_2->unk38); + sprintf(¶m_0[*param_1], "%.3ff,\t// 頭のY角上限\n", param_2->head_angleY_max); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%.3ff,\t// 頭のY角下限\n", param_2->unk3C); + sprintf(¶m_0[*param_1], "%.3ff,\t// 頭のY角下限\n", param_2->head_angleY_min); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%.3ff,\t// 首の移動割合\n", param_2->unk40); + sprintf(¶m_0[*param_1], "%.3ff,\t// 首の移動割合\n", param_2->neck_rotation_ratio); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%.3ff,\t// 補間フレ−ム\n", param_2->unk44); + sprintf(¶m_0[*param_1], "%.3ff,\t// 補間フレ−ム\n", param_2->morf_frame); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%d, \t// 会話距離\n", param_2->unk48); + sprintf(¶m_0[*param_1], "%d, \t// 会話距離\n", param_2->talk_distance); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%d, \t// 会話角度\n", param_2->unk4A); + sprintf(¶m_0[*param_1], "%d, \t// 会話角度\n", param_2->talk_angle); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%d, \t// 注目距離\n", param_2->unk4C); + sprintf(¶m_0[*param_1], "%d, \t// 注目距離\n", param_2->attention_distance); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%d, \t// 注目角度\n", param_2->unk4E); + sprintf(¶m_0[*param_1], "%d, \t// 注目角度\n", param_2->attention_angle); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%.3ff,\t// 視界\n", param_2->unk50); + sprintf(¶m_0[*param_1], "%.3ff,\t// 視界\n", param_2->fov); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%.3ff,\t// サ−チ距離\n", param_2->unk54); + sprintf(¶m_0[*param_1], "%.3ff,\t// サ−チ距離\n", param_2->search_distance); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%.3ff,\t// サ−チ高さ\n", param_2->unk58); + sprintf(¶m_0[*param_1], "%.3ff,\t// サ−チ高さ\n", param_2->search_height); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%.3ff,\t// サ−チ低さ\n", param_2->unk5C); + sprintf(¶m_0[*param_1], "%.3ff,\t// サ−チ低さ\n", param_2->search_depth); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%d, \t// ?\n", param_2->unk60); + sprintf(¶m_0[*param_1], "%d, \t// ?\n", param_2->attention_time); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%d, \t// ?\n", param_2->unk62); + sprintf(¶m_0[*param_1], "%d, \t// ?\n", param_2->damage_time); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%d, \t// 表情\n", param_2->unk64); + sprintf(¶m_0[*param_1], "%d, \t// 表情\n", param_2->face_expression); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%d, \t// 動作\n", param_2->unk66); + sprintf(¶m_0[*param_1], "%d, \t// 動作\n", param_2->motion); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%d, \t// 注視モ−ド\n", param_2->unk68); + sprintf(¶m_0[*param_1], "%d, \t// 注視モ−ド\n", param_2->look_mode); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%d, \t// デバグモ−ドON\n", param_2->unk6A); + sprintf(¶m_0[*param_1], "%d, \t// デバグモ−ドON\n", param_2->debug_mode_ON); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%d, \t// デバグ情報ON\n", param_2->unk6B); + sprintf(¶m_0[*param_1], "%d, \t// デバグ情報ON\n", param_2->debug_info_ON); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%.3ff,\t// 表情補間フレ−ム\n", param_2->unk6C); + sprintf(¶m_0[*param_1], "%.3ff,\t// 表情補間フレ−ム\n", param_2->expression_morf_frame); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%.3ff,\t// 箱最小x\n", param_2->unk70); + sprintf(¶m_0[*param_1], "%.3ff,\t// 箱最小x\n", param_2->box_min_x); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%.3ff,\t// 箱最小y\n", param_2->unk74); + sprintf(¶m_0[*param_1], "%.3ff,\t// 箱最小y\n", param_2->box_min_y); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%.3ff,\t// 箱最小z\n", param_2->unk78); + sprintf(¶m_0[*param_1], "%.3ff,\t// 箱最小z\n", param_2->box_min_z); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%.3ff,\t// 箱最大x\n", param_2->unk7C); + sprintf(¶m_0[*param_1], "%.3ff,\t// 箱最大x\n", param_2->box_max_x); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%.3ff,\t// 箱最大y\n", param_2->unk80); + sprintf(¶m_0[*param_1], "%.3ff,\t// 箱最大y\n", param_2->box_max_y); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%.3ff,\t// 箱最大z\n", param_2->unk84); + sprintf(¶m_0[*param_1], "%.3ff,\t// 箱最大z\n", param_2->box_max_z); *param_1 = strlen(param_0); - sprintf(¶m_0[*param_1], "%.3ff,\t// 箱オフセット\n", param_2->unk88); + sprintf(¶m_0[*param_1], "%.3ff,\t// 箱オフセット\n", param_2->box_offset); *param_1 = strlen(param_0); } #endif diff --git a/src/d/d_bg_parts.cpp b/src/d/d_bg_parts.cpp new file mode 100644 index 0000000000..7fdf9dc65a --- /dev/null +++ b/src/d/d_bg_parts.cpp @@ -0,0 +1,11 @@ + +#include "JSystem/J3DGraphAnimator/J3DAnimation.h" + +static void dummy() { + ((J3DAnmTextureSRTKey*)0)->getUpdateMaterialID(0); + ((J3DAnmTextureSRTKey*)0)->getUpdateMaterialNum(); + ((J3DAnmTevRegKey*)0)->getKRegUpdateMaterialID(0); + ((J3DAnmTevRegKey*)0)->getKRegUpdateMaterialNum(); + ((J3DAnmTevRegKey*)0)->getCRegUpdateMaterialID(0); + ((J3DAnmTevRegKey*)0)->getCRegUpdateMaterialNum(); +} diff --git a/src/d/d_file_select.cpp b/src/d/d_file_select.cpp index c14e472562..217ed58057 100644 --- a/src/d/d_file_select.cpp +++ b/src/d/d_file_select.cpp @@ -4137,29 +4137,42 @@ void dFile_select3D_c::draw() { } /* 8019065C-8019095C 18AF9C 0300+00 2/2 0/0 0/0 .text setJ3D__16dFile_select3D_cFPCcPCcPCc */ -// NONMATCHING regswap +// NONMATCHING extra mr void dFile_select3D_c::setJ3D(char const* param_0, char const* param_1, char const* param_2) { JKRArchive* archive = dComIfGp_getCollectResArchive(); - J3DModelData* modelData = J3DModelLoaderDataBase::load( - archive->getResource('BMD ', param_0), 0x51020010); + J3DAnmTransform* pbck; + J3DAnmTevRegKey* pbrk; + + void* res = archive->getResource('BMD ', param_0); + J3DModelData* modelData = J3DModelLoaderDataBase::load(res, 0x51020010); + JUT_ASSERT(8823, modelData != 0); + for (u16 i = 0; i < modelData->getMaterialNum(); i++) { J3DMaterialAnm* material = new J3DMaterialAnm(); modelData->getMaterialNodePointer(i)->change(); modelData->getMaterialNodePointer(i)->setMaterialAnm(material); } + mpModel = new J3DModel(modelData, 0, 1); + JUT_ASSERT(8836, mpModel != 0); + if (param_1) { - J3DAnmTransform* pbck = - (J3DAnmTransform*)J3DAnmLoaderDataBase::load(archive->getResource('BCK ', param_1)); + void* res = archive->getResource('BCK ', param_1); + pbck = (J3DAnmTransform*)J3DAnmLoaderDataBase::load(res); + JUT_ASSERT(8846, pbck != 0); + mBckAnm = new mDoExt_bckAnm(); if (mBckAnm == NULL || !mBckAnm->init(pbck, 1, 2, 1.0f, 0, -1, false)) { return; } } + if (param_2) { - J3DAnmTevRegKey* pbrk = - (J3DAnmTevRegKey*)J3DAnmLoaderDataBase::load(archive->getResource('BRK ', param_2)); + void* res = archive->getResource('BRK ', param_2); + pbrk = (J3DAnmTevRegKey*)J3DAnmLoaderDataBase::load(res); + JUT_ASSERT(8859, pbrk != 0); pbrk->searchUpdateMaterialID(modelData); + mBrkAnm = new mDoExt_brkAnm(); if (mBrkAnm == NULL || !mBrkAnm->init(modelData, pbrk, -1, 2, 1.0f, 0, -1)) { return; diff --git a/src/d/d_menu_collect.cpp b/src/d/d_menu_collect.cpp index 8894daa67a..8ac2a978d3 100644 --- a/src/d/d_menu_collect.cpp +++ b/src/d/d_menu_collect.cpp @@ -2340,7 +2340,6 @@ void dMenu_Collect3D_c::draw() { } /* 801B6A30-801B6D30 1B1370 0300+00 2/2 0/0 0/0 .text setJ3D__17dMenu_Collect3D_cFPCcPCcPCc */ -// NONMATCHING regalloc void dMenu_Collect3D_c::setJ3D(const char* param_0, const char* param_1, const char* param_2) { JKRArchive* resArchive = dComIfGp_getCollectResArchive(); J3DModelData* modelData = J3DModelLoaderDataBase::load( |
