mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-08 12:16:17 -04:00
some J3D/misc cleanup (#2628)
* some j3d cleanup * begin using uintptr_t * j3dgraphbase cleanup * j3dgraphanimator cleanup
This commit is contained in:
@@ -1,14 +1,8 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: J3DShapeMtx
|
||||
//
|
||||
|
||||
#include "JSystem/J3DGraphBase/J3DShapeMtx.h"
|
||||
#include "JSystem/J3DGraphAnimator/J3DModel.h"
|
||||
#include "JSystem/J3DGraphBase/J3DGD.h"
|
||||
#include "JSystem/J3DGraphBase/J3DFifo.h"
|
||||
#include "JSystem/J3DGraphBase/J3DMatBlock.h"
|
||||
#include "JSystem/J3DGraphBase/J3DTexture.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
/* 80434C80-80434C98 0619A0 0014+04 2/2 0/0 0/0 .bss sMtxLoadCache__11J3DShapeMtx */
|
||||
u16 J3DShapeMtx::sMtxLoadCache[10];
|
||||
@@ -16,24 +10,23 @@ u16 J3DShapeMtx::sMtxLoadCache[10];
|
||||
/* 803130A8-803130E4 30D9E8 003C+00 0/0 1/1 0/0 .text resetMtxLoadCache__11J3DShapeMtxFv
|
||||
*/
|
||||
void J3DShapeMtx::resetMtxLoadCache() {
|
||||
sMtxLoadCache[0] =
|
||||
sMtxLoadCache[1] =
|
||||
sMtxLoadCache[2] =
|
||||
sMtxLoadCache[3] =
|
||||
sMtxLoadCache[4] =
|
||||
sMtxLoadCache[5] =
|
||||
sMtxLoadCache[6] =
|
||||
sMtxLoadCache[7] =
|
||||
sMtxLoadCache[8] =
|
||||
sMtxLoadCache[9] = 0xFFFF;
|
||||
sMtxLoadCache[8] = 0xFFFF;
|
||||
sMtxLoadCache[7] = 0xFFFF;
|
||||
sMtxLoadCache[6] = 0xFFFF;
|
||||
sMtxLoadCache[5] = 0xFFFF;
|
||||
sMtxLoadCache[4] = 0xFFFF;
|
||||
sMtxLoadCache[3] = 0xFFFF;
|
||||
sMtxLoadCache[2] = 0xFFFF;
|
||||
sMtxLoadCache[1] = 0xFFFF;
|
||||
sMtxLoadCache[0] = 0xFFFF;
|
||||
}
|
||||
|
||||
/* 803130E4-80313128 30DA24 0044+00 1/0 0/0 0/0 .text loadMtxIndx_PNGP__11J3DShapeMtxCFiUs */
|
||||
void J3DShapeMtx::loadMtxIndx_PNGP(int slot, u16 indx) const {
|
||||
// inlined J3DFifoLoadPosMtxIndx
|
||||
// J3DFifoLoadPosMtxIndx(indx, slot * 3); // matches debug, but not retail
|
||||
J3DFifoLoadIndx(GX_LOAD_INDX_A, indx, 0xB000 | ((u16)(slot * 0x0C)));
|
||||
// inlined J3DFifoLoadNrmMtxIndx3x3
|
||||
J3DFifoLoadIndx(GX_LOAD_INDX_B, indx, 0x8000 | ((u16)((slot * 0x09) + 0x400)));
|
||||
J3DFifoLoadNrmMtxIndx3x3(indx, slot * 3);
|
||||
}
|
||||
|
||||
/* 80313128-80313188 30DA68 0060+00 1/0 0/0 0/0 .text loadMtxIndx_PCPU__11J3DShapeMtxCFiUs */
|
||||
@@ -56,27 +49,27 @@ void J3DShapeMtx::loadMtxIndx_PNCPU(int slot, u16 indx) const {
|
||||
|
||||
/* 803CD9C0-803CD9F0 02AAE0 0030+00 2/3 0/0 0/0 .data sMtxLoadPipeline__11J3DShapeMtx */
|
||||
J3DShapeMtx_LoadFunc J3DShapeMtx::sMtxLoadPipeline[4] = {
|
||||
&loadMtxIndx_PNGP,
|
||||
&loadMtxIndx_PCPU,
|
||||
&loadMtxIndx_NCPU,
|
||||
&loadMtxIndx_PNCPU,
|
||||
&J3DShapeMtx::loadMtxIndx_PNGP,
|
||||
&J3DShapeMtx::loadMtxIndx_PCPU,
|
||||
&J3DShapeMtx::loadMtxIndx_NCPU,
|
||||
&J3DShapeMtx::loadMtxIndx_PNCPU,
|
||||
};
|
||||
|
||||
/* 803CDA20-803CDA50 02AB40 0030+00 2/3 0/0 0/0 .data sMtxLoadPipeline__21J3DShapeMtxConcatView */
|
||||
J3DShapeMtxConcatView_LoadFunc J3DShapeMtxConcatView::sMtxLoadPipeline[4] = {
|
||||
&loadMtxConcatView_PNGP,
|
||||
&loadMtxConcatView_PCPU,
|
||||
&loadMtxConcatView_NCPU,
|
||||
&loadMtxConcatView_PNCPU,
|
||||
&J3DShapeMtxConcatView::loadMtxConcatView_PNGP,
|
||||
&J3DShapeMtxConcatView::loadMtxConcatView_PCPU,
|
||||
&J3DShapeMtxConcatView::loadMtxConcatView_NCPU,
|
||||
&J3DShapeMtxConcatView::loadMtxConcatView_PNCPU,
|
||||
};
|
||||
|
||||
/* 803CDA80-803CDAB0 02ABA0 0030+00 1/2 0/0 0/0 .data sMtxLoadLODPipeline__21J3DShapeMtxConcatView
|
||||
*/
|
||||
J3DShapeMtxConcatView_LoadFunc J3DShapeMtxConcatView::sMtxLoadLODPipeline[4] = {
|
||||
&loadMtxConcatView_PNGP_LOD,
|
||||
&loadMtxConcatView_PCPU,
|
||||
&loadMtxConcatView_NCPU,
|
||||
&loadMtxConcatView_PNCPU,
|
||||
&J3DShapeMtxConcatView::loadMtxConcatView_PNGP_LOD,
|
||||
&J3DShapeMtxConcatView::loadMtxConcatView_PCPU,
|
||||
&J3DShapeMtxConcatView::loadMtxConcatView_NCPU,
|
||||
&J3DShapeMtxConcatView::loadMtxConcatView_PNCPU,
|
||||
};
|
||||
|
||||
/* 804515A8-804515AC 000AA8 0004+00 4/4 2/2 0/0 .sbss sCurrentPipeline__11J3DShapeMtx */
|
||||
@@ -86,13 +79,11 @@ u32 J3DShapeMtx::sCurrentPipeline;
|
||||
u8* J3DShapeMtx::sCurrentScaleFlag;
|
||||
|
||||
// This below is technically part of J3DScaleFlag.
|
||||
|
||||
/* 804515B0-804515B4 -00001 0004+00 5/5 3/3 0/0 .sbss None */
|
||||
/* 804515B0 0001+00 data_804515B0 None */
|
||||
bool J3DShapeMtx::sNBTFlag;
|
||||
|
||||
/* 804515B1 0003+00 data_804515B1 None */
|
||||
extern u8 struct_804515B0; // temporary
|
||||
u8 J3DShapeMtx::sNBTFlag;
|
||||
u8 J3DShapeMtx::sLODFlag;
|
||||
bool J3DShapeMtx::sLODFlag;
|
||||
|
||||
/* 804515B4-804515B8 000AB4 0004+00 4/4 1/1 0/0 .sbss sTexMtxLoadType__11J3DShapeMtx */
|
||||
u32 J3DShapeMtx::sTexMtxLoadType;
|
||||
@@ -115,6 +106,7 @@ void J3DDifferedTexMtx::loadExecute(f32 const (*param_0)[4]) {
|
||||
{0.0f, -0.5f, 0.5f, 0.0f},
|
||||
{0.0f, 0.0f, 1.0f, 0.0f},
|
||||
};
|
||||
|
||||
static Mtx qMtx2 = {
|
||||
{0.5f, 0.0f, 0.0f, 0.5f},
|
||||
{0.0f, -0.5f, 0.0f, 0.5f},
|
||||
@@ -126,10 +118,10 @@ void J3DDifferedTexMtx::loadExecute(f32 const (*param_0)[4]) {
|
||||
Mtx44 sp_a8, sp_68;
|
||||
|
||||
J3DTexGenBlock* tex_gen_block = sTexGenBlock; // sp_60
|
||||
JUT_ASSERT_MSG(0xc3, tex_gen_block != NULL, "Error : null pointer");
|
||||
J3D_ASSERT_NULLPTR(195, tex_gen_block != NULL);
|
||||
|
||||
J3DTexMtxObj* tex_mtx_obj = sTexMtxObj; // sp_5c
|
||||
JUT_ASSERT_MSG(0xc6, tex_mtx_obj != NULL, "Error : null pointer");
|
||||
J3D_ASSERT_NULLPTR(198, tex_mtx_obj != NULL);
|
||||
|
||||
J3DTexMtxInfo* tex_mtx_info_1; // sp_58
|
||||
int tex_gen_type; // sp_54
|
||||
@@ -142,8 +134,9 @@ void J3DDifferedTexMtx::loadExecute(f32 const (*param_0)[4]) {
|
||||
tex_gen_type = tex_gen_block->getTexCoord(i)->getTexGenType();
|
||||
if (tex_gen_type == 1 || tex_gen_type == 0) {
|
||||
tex_mtx_2 = tex_gen_block->getTexMtx(i);
|
||||
JUT_ASSERT_MSG(0xd7, tex_mtx_2 != NULL, "Error : null pointer");
|
||||
J3D_ASSERT_NULLPTR(215, tex_mtx_2 != NULL);
|
||||
tex_mtx_info_1 = &tex_mtx_2->getTexMtxInfo();
|
||||
|
||||
u32 sp_4c = tex_mtx_info_1->mInfo & 0x3f;
|
||||
switch (sp_4c) {
|
||||
case 3:
|
||||
@@ -187,6 +180,7 @@ void J3DDifferedTexMtx::loadExecute(f32 const (*param_0)[4]) {
|
||||
} else if (sp_3c == 1) {
|
||||
J3DGetTextureMtxMaya(tex_mtx_info_2->mSRT, sp_68);
|
||||
}
|
||||
|
||||
MTXConcat(sp_68, qMtx, sp_68);
|
||||
J3DMtxProjConcat(sp_68, tex_mtx_obj->getEffectMtx(i), sp_e8);
|
||||
MTXInverse(j3dSys.getViewMtx(), sp_a8);
|
||||
@@ -203,6 +197,7 @@ void J3DDifferedTexMtx::loadExecute(f32 const (*param_0)[4]) {
|
||||
} else if (sp_34 == 1) {
|
||||
J3DGetTextureMtxMaya(tex_mtx_info_2->mSRT, sp_68);
|
||||
}
|
||||
|
||||
MTXConcat(sp_68, qMtx2, sp_68);
|
||||
J3DMtxProjConcat(sp_68, tex_mtx_obj->getEffectMtx(i), sp_e8);
|
||||
MTXInverse(j3dSys.getViewMtx(), sp_a8);
|
||||
@@ -225,8 +220,9 @@ void J3DDifferedTexMtx::loadExecute(f32 const (*param_0)[4]) {
|
||||
int tex_gen_type = tex_gen_block->getTexCoord(i)->getTexGenType();
|
||||
if (tex_gen_type == 1 || tex_gen_type == 0) {
|
||||
J3DTexMtx* tex_mtx = tex_gen_block->getTexMtx(i); // sp_2c
|
||||
JUT_ASSERT_MSG(0x145, tex_mtx != NULL, "Error : null pointer");
|
||||
J3D_ASSERT_NULLPTR(325, tex_mtx != NULL);
|
||||
tex_mtx_info_1 = &tex_mtx->getTexMtxInfo();
|
||||
|
||||
u32 tex_gen_src = tex_mtx_info_1->mInfo & 0x3f; // sp_28
|
||||
switch (tex_gen_src) {
|
||||
case 3:
|
||||
@@ -254,6 +250,7 @@ void J3DDifferedTexMtx::loadExecute(f32 const (*param_0)[4]) {
|
||||
} else if (sp_24 == 1) {
|
||||
J3DGetTextureMtxMayaOld(tex_mtx_info_2->mSRT, sp_68);
|
||||
}
|
||||
|
||||
J3DMtxProjConcat(sp_68, tex_mtx_obj->getEffectMtx(i), sp_e8);
|
||||
MTXInverse(j3dSys.getViewMtx(), sp_a8);
|
||||
MTXConcat(sp_e8, sp_a8, sp_e8);
|
||||
@@ -270,6 +267,7 @@ void J3DDifferedTexMtx::loadExecute(f32 const (*param_0)[4]) {
|
||||
} else if (sp_18 == 1) {
|
||||
J3DGetTextureMtxMaya(tex_mtx_info_2->mSRT, sp_68);
|
||||
}
|
||||
|
||||
MTXConcat(sp_68, qMtx, sp_68);
|
||||
J3DMtxProjConcat(sp_68, tex_mtx_obj->getEffectMtx(i), sp_e8);
|
||||
MTXInverse(j3dSys.getViewMtx(), sp_a8);
|
||||
@@ -287,6 +285,7 @@ void J3DDifferedTexMtx::loadExecute(f32 const (*param_0)[4]) {
|
||||
} else if (sp_10 == 1) {
|
||||
J3DGetTextureMtxMaya(tex_mtx_info_2->mSRT, sp_68);
|
||||
}
|
||||
|
||||
MTXConcat(sp_68, qMtx2, sp_68);
|
||||
J3DMtxProjConcat(sp_68, tex_mtx_obj->getEffectMtx(i), sp_e8);
|
||||
MTXInverse(j3dSys.getViewMtx(), sp_a8);
|
||||
@@ -305,8 +304,7 @@ void J3DDifferedTexMtx::loadExecute(f32 const (*param_0)[4]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
GXLoadTexMtxImm(*mtx, i * 3 + 30,
|
||||
(GXTexMtxType)tex_mtx_info_1->mProjection);
|
||||
GXLoadTexMtxImm(*mtx, i * 3 + 30, (GXTexMtxType)tex_mtx_info_1->mProjection);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -340,6 +338,7 @@ void J3DShapeMtxConcatView::loadMtxConcatView_NCPU(int slot, u16 drw) const {
|
||||
J3DDifferedTexMtx::load(m);
|
||||
J3DFifoLoadPosMtxImm(m, slot * 3);
|
||||
J3DFifoLoadNrmMtxImm(*j3dSys.getShapePacket()->getBaseMtxPtr(), slot * 3);
|
||||
|
||||
if (J3DShapeMtx::sTexMtxLoadType == 0x2000)
|
||||
J3DFifoLoadNrmMtxToTexMtx(*j3dSys.getShapePacket()->getBaseMtxPtr(), slot * 3 + GX_TEXMTX0);
|
||||
}
|
||||
@@ -347,13 +346,15 @@ void J3DShapeMtxConcatView::loadMtxConcatView_NCPU(int slot, u16 drw) const {
|
||||
/* 80313A14-80313AC8 30E354 00B4+00 2/0 0/0 0/0 .text
|
||||
* loadMtxConcatView_PNCPU__21J3DShapeMtxConcatViewCFiUs */
|
||||
void J3DShapeMtxConcatView::loadMtxConcatView_PNCPU(int slot, u16 drw) const {
|
||||
Mtx m;
|
||||
if (J3DDifferedTexMtx::sTexGenBlock != NULL) {
|
||||
Mtx m;
|
||||
MTXConcat(*j3dSys.getShapePacket()->getBaseMtxPtr(), j3dSys.getModelDrawMtx(drw), m);
|
||||
J3DDifferedTexMtx::loadExecute(m);
|
||||
}
|
||||
|
||||
J3DFifoLoadPosMtxImm(*j3dSys.getShapePacket()->getBaseMtxPtr(), slot * 3);
|
||||
J3DFifoLoadNrmMtxImm(*j3dSys.getShapePacket()->getBaseMtxPtr(), slot * 3);
|
||||
|
||||
if (J3DShapeMtx::sTexMtxLoadType == 0x2000)
|
||||
J3DFifoLoadNrmMtxToTexMtx(*j3dSys.getShapePacket()->getBaseMtxPtr(), slot * 3 + GX_TEXMTX0);
|
||||
}
|
||||
@@ -363,7 +364,7 @@ void J3DShapeMtxConcatView::loadMtxConcatView_PNCPU(int slot, u16 drw) const {
|
||||
void J3DShapeMtxConcatView::loadMtxConcatView_PNGP_LOD(int slot, u16 drw) const {
|
||||
Mtx m;
|
||||
MTXConcat(*j3dSys.getShapePacket()->getBaseMtxPtr(), j3dSys.getModelDrawMtx(drw), m);
|
||||
MTXConcat(m, j3dSys.mModel->getModelData()->getInvJointMtx(drw), m);
|
||||
MTXConcat(m, j3dSys.getModel()->getModelData()->getInvJointMtx(drw), m);
|
||||
J3DDifferedTexMtx::load(m);
|
||||
J3DFifoLoadPosMtxImm(m, slot * 3);
|
||||
loadNrmMtx(slot, drw, m);
|
||||
@@ -385,10 +386,11 @@ void J3DShapeMtx::calcNBTScale(Vec const& param_0, Mtx33* param_1, Mtx33* param_
|
||||
/* 80313C54-80313D28 30E594 00D4+00 1/0 0/0 0/0 .text load__21J3DShapeMtxConcatViewCFv */
|
||||
void J3DShapeMtxConcatView::load() const {
|
||||
sMtxPtrTbl[0] = j3dSys.getModel()->getMtxBuffer()->getUserAnmMtx(0);
|
||||
sMtxPtrTbl[1] = j3dSys.getModel()->getMtxBuffer()->getWeightAnmMtx(0);
|
||||
sMtxPtrTbl[1] = j3dSys.getModel()->getWeightAnmMtx(0);
|
||||
J3DShapeMtxConcatView_LoadFunc func = sMtxLoadPipeline[sCurrentPipeline];
|
||||
u32 draw_mtx_flag = j3dSys.getModel()->getModelData()->getDrawMtxFlag(mUseMtxIndex);
|
||||
j3dSys.setModelDrawMtx((Mtx*)sMtxPtrTbl[draw_mtx_flag]);
|
||||
|
||||
j3dSys.setModelDrawMtx((Mtx*)sMtxPtrTbl[j3dSys.getModel()->getModelData()->getDrawMtxFlag(mUseMtxIndex)]);
|
||||
|
||||
u16 draw_mtx_index = j3dSys.getModel()->getModelData()->getDrawMtxIndex(mUseMtxIndex);
|
||||
(this->*func)(0, draw_mtx_index);
|
||||
}
|
||||
@@ -400,6 +402,7 @@ void J3DShapeMtxConcatView::loadNrmMtx(int param_0, u16 param_1, MtxP param_2) c
|
||||
if (sTexMtxLoadType == 0x2000) {
|
||||
J3DFifoLoadNrmMtxToTexMtx(param_2, 0x1e);
|
||||
}
|
||||
|
||||
if (!sNBTFlag) {
|
||||
J3DFifoLoadNrmMtxImm(param_2, 0);
|
||||
} else {
|
||||
@@ -415,6 +418,7 @@ void J3DShapeMtxConcatView::loadNrmMtx(int param_0, u16 param_1, MtxP param_2) c
|
||||
if (sTexMtxLoadType == 0x2000) {
|
||||
J3DFifoLoadNrmMtxToTexMtx3x3(mtx, 0x1e);
|
||||
}
|
||||
|
||||
if (!sNBTFlag) {
|
||||
J3DFifoLoadNrmMtxImm3x3(mtx, 0);
|
||||
} else {
|
||||
@@ -428,11 +432,11 @@ void J3DShapeMtxConcatView::loadNrmMtx(int param_0, u16 param_1, MtxP param_2) c
|
||||
/* 80313E4C-80313EEC 30E78C 00A0+00 1/0 0/0 0/0 .text load__16J3DShapeMtxMultiCFv */
|
||||
void J3DShapeMtxMulti::load() const {
|
||||
J3DShapeMtx_LoadFunc func = sMtxLoadPipeline[sCurrentPipeline];
|
||||
|
||||
int use_mtx_num = mUseMtxNum;
|
||||
for (int i = 0; i < use_mtx_num; i++) {
|
||||
u16 use_mtx_index = mUseMtxIndexTable[i];
|
||||
if (use_mtx_index != 0xffff) {
|
||||
(this->*func)(i, use_mtx_index);
|
||||
if (mUseMtxIndexTable[i] != 0xffff) {
|
||||
(this->*func)(i, mUseMtxIndexTable[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -442,9 +446,8 @@ void J3DShapeMtxMulti::load() const {
|
||||
void J3DShapeMtxMulti::calcNBTScale(Vec const& param_0, Mtx33* param_1, Mtx33* param_2) {
|
||||
int use_mtx_num = mUseMtxNum;
|
||||
for (int i = 0; i < use_mtx_num; i++) {
|
||||
u16 use_mtx_index = mUseMtxIndexTable[i];
|
||||
if (use_mtx_index != 0xffff) {
|
||||
J3DPSMtx33Copy(param_1[use_mtx_index], param_2[use_mtx_index]);
|
||||
if (mUseMtxIndexTable[i] != 0xffff) {
|
||||
J3DPSMtx33Copy(param_1[mUseMtxIndexTable[i]], param_2[mUseMtxIndexTable[i]]);
|
||||
J3DScaleNrmMtx33(param_2[mUseMtxIndexTable[i]], param_0);
|
||||
}
|
||||
}
|
||||
@@ -453,36 +456,34 @@ void J3DShapeMtxMulti::calcNBTScale(Vec const& param_0, Mtx33* param_1, Mtx33* p
|
||||
/* 80313FA4-8031419C 30E8E4 01F8+00 1/0 0/0 0/0 .text load__26J3DShapeMtxMultiConcatViewCFv */
|
||||
void J3DShapeMtxMultiConcatView::load() const {
|
||||
sMtxPtrTbl[0] = j3dSys.getModel()->getMtxBuffer()->getUserAnmMtx(0);
|
||||
sMtxPtrTbl[1] = j3dSys.getModel()->getMtxBuffer()->getWeightAnmMtx(0);
|
||||
sMtxPtrTbl[1] = j3dSys.getModel()->getWeightAnmMtx(0);
|
||||
|
||||
if (!sLODFlag) {
|
||||
J3DShapeMtxConcatView_LoadFunc func = sMtxLoadPipeline[sCurrentPipeline];
|
||||
int use_mtx_num = mUseMtxNum;
|
||||
for (int i = 0; i < use_mtx_num; i++) {
|
||||
u16 use_mtx_index = mUseMtxIndexTable[i];
|
||||
if (use_mtx_index != 0xffff) {
|
||||
u16 draw_mtx_index =
|
||||
j3dSys.getModel()->getModelData()->getDrawMtxIndex(use_mtx_index);
|
||||
u8 draw_mtx_flag = j3dSys.getModel()->getModelData()->getDrawMtxFlag(use_mtx_index);
|
||||
j3dSys.setModelDrawMtx((Mtx*)sMtxPtrTbl[draw_mtx_flag]);
|
||||
if (mUseMtxIndexTable[i] != 0xffff) {
|
||||
u16 draw_mtx_index = j3dSys.getModel()->getModelData()->getDrawMtxIndex(mUseMtxIndexTable[i]);
|
||||
j3dSys.setModelDrawMtx((Mtx*)sMtxPtrTbl[j3dSys.getModel()->getModelData()->getDrawMtxFlag(mUseMtxIndexTable[i])]);
|
||||
(this->*func)(i, draw_mtx_index);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
u16* important_mtx_indices = j3dSys.getModel()->getModelData()->getWEvlpImportantMtxIndex();
|
||||
j3dSys.setModelDrawMtx((Mtx*)sMtxPtrTbl[0]);
|
||||
|
||||
int use_mtx_num = mUseMtxNum;
|
||||
for (int i = 0; i < use_mtx_num; i++) {
|
||||
u32 current_pipeline = sCurrentPipeline;
|
||||
J3DShapeMtxConcatView_LoadFunc func = sMtxLoadLODPipeline[current_pipeline];
|
||||
u16 use_mtx_index = mUseMtxIndexTable[i];
|
||||
if (use_mtx_index != 0xffff) {
|
||||
u16 important_mtx_index = important_mtx_indices[use_mtx_index];
|
||||
|
||||
if (mUseMtxIndexTable[i] != 0xffff) {
|
||||
u16 important_mtx_index = important_mtx_indices[mUseMtxIndexTable[i]];
|
||||
if (important_mtx_index != sMtxLoadCache[i]) {
|
||||
u8 draw_mtx_flag =
|
||||
j3dSys.getModel()->getModelData()->getDrawMtxFlag(use_mtx_index);
|
||||
if (draw_mtx_flag == 0) {
|
||||
func = sMtxLoadPipeline[current_pipeline];
|
||||
if (j3dSys.getModel()->getModelData()->getDrawMtxFlag(mUseMtxIndexTable[i]) == 0) {
|
||||
func = sMtxLoadPipeline[sCurrentPipeline];
|
||||
}
|
||||
|
||||
(this->*func)(i, important_mtx_index);
|
||||
sMtxLoadCache[i] = important_mtx_index;
|
||||
}
|
||||
@@ -526,22 +527,24 @@ void J3DShapeMtxMultiConcatView::loadNrmMtx(int param_0, u16 param_1, MtxP param
|
||||
void J3DShapeMtxBBoardConcatView::load() const {
|
||||
Mtx mtx;
|
||||
u16 draw_mtx_index = j3dSys.getModel()->getModelData()->getDrawMtxIndex(mUseMtxIndex);
|
||||
u8 draw_mtx_flag = j3dSys.getModel()->getModelData()->getDrawMtxFlag(mUseMtxIndex);
|
||||
if (draw_mtx_flag == 0) {
|
||||
MtxP user_anm_mtx = j3dSys.getModel()->getMtxBuffer()->getUserAnmMtx(draw_mtx_index);
|
||||
PSMTXConcat(j3dSys.getViewMtx(), user_anm_mtx, mtx);
|
||||
|
||||
if (j3dSys.getModel()->getModelData()->getDrawMtxFlag(mUseMtxIndex) == 0) {
|
||||
MTXConcat(j3dSys.getViewMtx(), j3dSys.getModel()->getMtxBuffer()->getUserAnmMtx(draw_mtx_index), mtx);
|
||||
} else {
|
||||
MtxP weight_anm_mtx = j3dSys.getModel()->getMtxBuffer()->getWeightAnmMtx(draw_mtx_index);
|
||||
PSMTXConcat(j3dSys.getViewMtx(), weight_anm_mtx, mtx);
|
||||
MTXConcat(j3dSys.getViewMtx(), j3dSys.getModel()->getWeightAnmMtx(draw_mtx_index), mtx);
|
||||
}
|
||||
|
||||
J3DCalcBBoardMtx(mtx);
|
||||
J3DFifoLoadPosMtxImm(mtx, 0);
|
||||
|
||||
mtx[0][0] = 1.0f / mtx[0][0];
|
||||
mtx[1][1] = 1.0f / mtx[1][1];
|
||||
mtx[2][2] = 1.0f / mtx[2][2];
|
||||
mtx[0][3] = 0.0f;
|
||||
mtx[1][3] = 0.0f;
|
||||
mtx[2][3] = 0.0f;
|
||||
|
||||
|
||||
if (!sNBTFlag) {
|
||||
J3DFifoLoadNrmMtxImm(mtx, 0);
|
||||
} else {
|
||||
@@ -556,16 +559,16 @@ void J3DShapeMtxYBBoardConcatView::load() const {
|
||||
Mtx mtx1;
|
||||
Mtx33 mtx2;
|
||||
u16 draw_mtx_index = j3dSys.getModel()->getModelData()->getDrawMtxIndex(mUseMtxIndex);
|
||||
u8 draw_mtx_flag = j3dSys.getModel()->getModelData()->getDrawMtxFlag(mUseMtxIndex);
|
||||
if (draw_mtx_flag == 0) {
|
||||
MtxP user_anm_mtx = j3dSys.getModel()->getMtxBuffer()->getUserAnmMtx(draw_mtx_index);
|
||||
PSMTXConcat(j3dSys.getViewMtx(), user_anm_mtx, mtx1);
|
||||
|
||||
if (j3dSys.getModel()->getModelData()->getDrawMtxFlag(mUseMtxIndex) == 0) {
|
||||
MTXConcat(j3dSys.getViewMtx(), j3dSys.getModel()->getMtxBuffer()->getUserAnmMtx(draw_mtx_index), mtx1);
|
||||
} else {
|
||||
MtxP weight_anm_mtx = j3dSys.getModel()->getMtxBuffer()->getWeightAnmMtx(draw_mtx_index);
|
||||
PSMTXConcat(j3dSys.getViewMtx(), weight_anm_mtx, mtx1);
|
||||
MTXConcat(j3dSys.getViewMtx(), j3dSys.getModel()->getWeightAnmMtx(draw_mtx_index), mtx1);
|
||||
}
|
||||
|
||||
J3DCalcYBBoardMtx(mtx1);
|
||||
J3DFifoLoadPosMtxImm(mtx1, 0);
|
||||
|
||||
if (sCurrentScaleFlag[mUseMtxIndex] == 1) {
|
||||
if (!sNBTFlag) {
|
||||
J3DFifoLoadNrmMtxImm(mtx1, 0);
|
||||
|
||||
Reference in New Issue
Block a user