summaryrefslogtreecommitdiff
path: root/src/JSystem/J3DGraphAnimator/J3DMaterialAttach.cpp
diff options
context:
space:
mode:
authorLagoLunatic <LagoLunatic@users.noreply.github.com>2025-06-20 02:41:43 -0400
committerGitHub <noreply@github.com>2025-06-19 23:41:43 -0700
commitac069664149342aff58ed84cf51c62b3eb8399da (patch)
treeeab73c3959a6f052a388fe96fc46b42d48a16508 /src/JSystem/J3DGraphAnimator/J3DMaterialAttach.cpp
parent25d13c76e4080c7b2fabf00b7836ba13de7e9dc0 (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/JSystem/J3DGraphAnimator/J3DMaterialAttach.cpp')
-rw-r--r--src/JSystem/J3DGraphAnimator/J3DMaterialAttach.cpp34
1 files changed, 14 insertions, 20 deletions
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);
}
}