some J3D/misc cleanup (#2628)

* some j3d cleanup

* begin using uintptr_t

* j3dgraphbase cleanup

* j3dgraphanimator cleanup
This commit is contained in:
TakaRikka
2025-09-04 07:56:59 -07:00
committed by GitHub
parent 35029ba909
commit 87069235c0
290 changed files with 4221 additions and 3605 deletions
+12 -21
View File
@@ -5,7 +5,7 @@
#include "JSystem/J3DGraphAnimator/J3DModelData.h"
#include "JSystem/J3DGraphAnimator/J3DMaterialAnm.h"
#include "JSystem/J3DGraphBase/J3DMaterial.h"
#include "dolphin/os.h"
#include "JSystem/J3DGraphAnimator/J3DModel.h"
/* 80325D88-80325DA0 3206C8 0018+00 1/1 2/2 0/0 .text clear__12J3DModelDataFv */
void J3DModelData::clear() {
@@ -21,16 +21,17 @@ J3DModelData::J3DModelData() {
}
/* 80325E14-80325EC8 320754 00B4+00 0/0 2/2 0/0 .text newSharedDisplayList__12J3DModelDataFUl */
s32 J3DModelData::newSharedDisplayList(u32 flag) {
s32 J3DModelData::newSharedDisplayList(u32 mdlFlags) {
u16 matNum = getMaterialNum();
for (u16 i = 0; i < matNum; i++) {
if (!!(flag & 0x40000)) {
s32 ret = getMaterialNodePointer(i)->newSingleSharedDisplayList(getMaterialNodePointer(i)->countDLSize());
s32 ret;
if (mdlFlags & J3DMdlFlag_UseSingleDL) {
ret = getMaterialNodePointer(i)->newSingleSharedDisplayList(getMaterialNodePointer(i)->countDLSize());
if (ret != kJ3DError_Success)
return ret;
} else {
s32 ret = getMaterialNodePointer(i)->newSharedDisplayList(getMaterialNodePointer(i)->countDLSize());
ret = getMaterialNodePointer(i)->newSharedDisplayList(getMaterialNodePointer(i)->countDLSize());
if (ret != kJ3DError_Success)
return ret;
}
@@ -39,22 +40,11 @@ s32 J3DModelData::newSharedDisplayList(u32 flag) {
return kJ3DError_Success;
}
/* ############################################################################################## */
/* 804515E8-804515EC 000AE8 0004+00 1/1 0/0 0/0 .sbss sInterruptFlag$965 */
static s32 sInterruptFlag;
/* 804515EC-804515F0 000AEC 0004+00 1/1 0/0 0/0 .sbss None */
static s8 sInitInterruptFlag;
/* 80325EC8-80325F94 320808 00CC+00 0/0 1/1 0/0 .text indexToPtr__12J3DModelDataFv */
void J3DModelData::indexToPtr() {
J3DTexture* tex = getTexture();
j3dSys.setTexture(tex);
j3dSys.setTexture(getTexture());
if (!sInitInterruptFlag) {
sInterruptFlag = OSDisableInterrupts();
sInitInterruptFlag = true;
}
static BOOL sInterruptFlag = OSDisableInterrupts();
OSDisableScheduler();
GDLObj gdl_obj;
@@ -67,6 +57,7 @@ void J3DModelData::indexToPtr() {
GDSetCurrent(&gdl_obj);
matNode->getTevBlock()->indexToPtr();
}
GDSetCurrent(NULL);
OSEnableScheduler();
OSRestoreInterrupts(sInterruptFlag);
@@ -74,8 +65,7 @@ void J3DModelData::indexToPtr() {
/* 80325F94-8032600C 3208D4 0078+00 0/0 2/2 0/0 .text makeSharedDL__12J3DModelDataFv */
void J3DModelData::makeSharedDL() {
J3DTexture* tex = getTexture();
j3dSys.setTexture(tex);
j3dSys.setTexture(getTexture());
u16 matNum = getMaterialNum();
for (u16 i = 0; i < matNum; i++) {
@@ -88,8 +78,9 @@ void J3DModelData::makeSharedDL() {
void J3DModelData::simpleCalcMaterial(u16 idx, Mtx param_1) {
syncJ3DSysFlags();
J3DMaterial* mat;
J3DJoint* jointNode = getJointNodePointer(idx);
for (J3DMaterial* mat = jointNode->getMesh(); mat != NULL; mat = mat->getNext()) {
for (mat = jointNode->getMesh(); mat != NULL; mat = mat->getNext()) {
if (mat->getMaterialAnm() != NULL) {
mat->getMaterialAnm()->calc(mat);
}