mirror of
https://github.com/zeldaret/tp
synced 2026-08-21 22:41:04 -04:00
some various J2D/J3D work (#2043)
* most of J2DPicture done * fix GXSetTexCoordGen * some j3d work
This commit is contained in:
@@ -25,10 +25,6 @@ void J2DGrafContext::setPort() {
|
||||
GXSetViewport(bounds.i.x, bounds.i.y, bounds.getWidth(), bounds.getHeight(), 0.0f, 1.0f);
|
||||
}
|
||||
|
||||
static inline void GXSetTexCoordGen(GXTexCoordID dst, GXTexGenType type, GXTexGenSrc src, u32 mtx) {
|
||||
GXSetTexCoordGen2(dst, type, src, mtx, GX_FALSE, GX_PTIDENTITY);
|
||||
}
|
||||
|
||||
/* 802E8C44-802E8E20 2E3584 01DC+00 1/0 1/0 0/0 .text setup2D__14J2DGrafContextFv */
|
||||
void J2DGrafContext::setup2D() {
|
||||
GXSetNumIndStages(0);
|
||||
|
||||
@@ -406,10 +406,6 @@ void J2DTexGenBlock::initialize() {
|
||||
}
|
||||
}
|
||||
|
||||
static inline void GXSetTexCoordGen(GXTexCoordID dst, GXTexGenType type, GXTexGenSrc src, u32 mtx) {
|
||||
GXSetTexCoordGen2(dst, type, src, mtx, GX_FALSE, GX_PTIDENTITY);
|
||||
}
|
||||
|
||||
/* 802EB570-802EB620 2E5EB0 00B0+00 0/0 1/1 0/0 .text setGX__14J2DTexGenBlockFv */
|
||||
void J2DTexGenBlock::setGX() {
|
||||
GXSetNumTexGens(mTexGenNum);
|
||||
|
||||
@@ -342,7 +342,7 @@ void J2DMaterial::setAnimation(J2DAnmTexPattern* anm) {
|
||||
u16 matID = anm->getUpdateMaterialID(i);
|
||||
|
||||
if (index == matID) {
|
||||
mAnmPointer->field_0x22[anmTbl[i]._4] = i;
|
||||
mAnmPointer->field_0x22[anmTbl[i].mTexNo] = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -208,7 +208,7 @@ SECTION_SDATA2 static f32 lit_1563[1 + 1 /* padding */] = {
|
||||
// almost
|
||||
#ifdef NONMATCHING
|
||||
J2DScreen::J2DScreen()
|
||||
: J2DPane(NULL, true, 'root', JGeometry::TBox2<f32>(0.0f, 0.0f, 0.0f, 0.0f)), mColor() {
|
||||
: J2DPane(NULL, true, 'root', JGeometry::TBox2<f32>(0.0f, 0.0f, 640.0f, 480.0f)), mColor() {
|
||||
field_0x4 = -1;
|
||||
mScissor = false;
|
||||
mMaterialNum = 0;
|
||||
@@ -342,14 +342,12 @@ bool J2DScreen::getScreenInformation(JSURandomInputStream* p_stream) {
|
||||
|
||||
/* 802F8990-802F8B98 2F32D0 0208+00 1/1 0/0 0/0 .text
|
||||
* makeHierarchyPanes__9J2DScreenFP7J2DPaneP20JSURandomInputStreamUlP10JKRArchive */
|
||||
// goto can probably be replaced
|
||||
s32 J2DScreen::makeHierarchyPanes(J2DPane* p_basePane, JSURandomInputStream* p_stream, u32 param_2,
|
||||
JKRArchive* p_archive) {
|
||||
J2DScrnBlockHeader header;
|
||||
J2DPane* next_pane = p_basePane;
|
||||
|
||||
do {
|
||||
loop:
|
||||
while (true) {
|
||||
J2DScrnBlockHeader header;
|
||||
p_stream->peek(&header, sizeof(J2DScrnBlockHeader));
|
||||
|
||||
switch (header.mTag) {
|
||||
@@ -360,10 +358,10 @@ s32 J2DScreen::makeHierarchyPanes(J2DPane* p_basePane, JSURandomInputStream* p_s
|
||||
p_stream->seek(header.mSize, JSUStreamSeekFrom_CUR);
|
||||
|
||||
int ret = makeHierarchyPanes(next_pane, p_stream, param_2, p_archive);
|
||||
if (ret == 0) {
|
||||
goto loop;
|
||||
if (ret != 0) {
|
||||
return ret;
|
||||
}
|
||||
return ret;
|
||||
break;
|
||||
case 'END1':
|
||||
p_stream->seek(header.mSize, JSUStreamSeekFrom_CUR);
|
||||
return 0;
|
||||
@@ -371,33 +369,36 @@ s32 J2DScreen::makeHierarchyPanes(J2DPane* p_basePane, JSURandomInputStream* p_s
|
||||
J2DResReference* texRes = getResReference(p_stream, param_2);
|
||||
mTexRes = texRes;
|
||||
|
||||
if (texRes != NULL) {
|
||||
goto loop;
|
||||
if (texRes == NULL) {
|
||||
return 2;
|
||||
}
|
||||
return 2;
|
||||
break;
|
||||
case 'FNT1':
|
||||
J2DResReference* fntRes = getResReference(p_stream, param_2);
|
||||
mFontRes = fntRes;
|
||||
|
||||
if (fntRes != NULL) {
|
||||
goto loop;
|
||||
if (fntRes == NULL) {
|
||||
return 2;
|
||||
}
|
||||
return 2;
|
||||
break;
|
||||
case 'MAT1':
|
||||
if (createMaterial(p_stream, param_2, p_archive)) {
|
||||
goto loop;
|
||||
if (!createMaterial(p_stream, param_2, p_archive)) {
|
||||
return 2;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (p_archive == NULL) {
|
||||
next_pane = createPane(header, p_stream, p_basePane, param_2);
|
||||
} else {
|
||||
next_pane = createPane(header, p_stream, p_basePane, param_2, p_archive);
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
|
||||
if (p_archive == NULL) {
|
||||
next_pane = createPane(header, p_stream, p_basePane, param_2);
|
||||
} else {
|
||||
next_pane = createPane(header, p_stream, p_basePane, param_2, p_archive);
|
||||
if (next_pane == NULL) {
|
||||
return 2;
|
||||
}
|
||||
break;
|
||||
}
|
||||
} while (next_pane != NULL);
|
||||
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
/* 802F8B98-802F8ED4 2F34D8 033C+00 1/0 0/0 0/0 .text
|
||||
|
||||
@@ -557,10 +557,6 @@ void J2DWindow::drawContentsTexture(f32 param_0, f32 param_1, f32 param_2, f32 p
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_S16, 0);
|
||||
}
|
||||
|
||||
static inline void GXSetTexCoordGen(GXTexCoordID dst, GXTexGenType type, GXTexGenSrc src, u32 mtx) {
|
||||
GXSetTexCoordGen2(dst, type, src, mtx, GX_FALSE, GX_PTIDENTITY);
|
||||
}
|
||||
|
||||
/* 802FBB90-802FBE60 2F64D0 02D0+00 2/2 0/0 0/0 .text
|
||||
* setTevMode__9J2DWindowFP10JUTTextureQ28JUtility6TColorQ28JUtility6TColor */
|
||||
void J2DWindow::setTevMode(JUTTexture* param_0, JUtility::TColor param_1,
|
||||
|
||||
@@ -786,11 +786,11 @@ asm void J3DAnmTexPattern::getTexNo(u16 param_0, u16* param_1) const {
|
||||
* searchUpdateMaterialID__16J3DAnmTexPatternFP16J3DMaterialTable */
|
||||
void J3DAnmTexPattern::searchUpdateMaterialID(J3DMaterialTable* param_0) {
|
||||
for (u16 i = 0; i < mUpdateMaterialNum; i++) {
|
||||
s32 r3 = param_0->getMaterialName()->getIndex(field_0x1c.getName(i));
|
||||
s32 r3 = param_0->getMaterialName()->getIndex(mUpdateMaterialName.getName(i));
|
||||
if (r3 != -1) {
|
||||
field_0x18[i] = r3;
|
||||
mUpdateMaterialID[i] = r3;
|
||||
} else {
|
||||
field_0x18[i] = -1;
|
||||
mUpdateMaterialID[i] = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,38 +4,24 @@
|
||||
//
|
||||
|
||||
#include "JSystem/J3DGraphAnimator/J3DCluster.h"
|
||||
#include "JSystem/J3DGraphAnimator/J3DAnimation.h"
|
||||
#include "JSystem/J3DGraphAnimator/J3DModel.h"
|
||||
#include "JSystem/J3DGraphAnimator/J3DSkinDeform.h"
|
||||
#include "JSystem/JMath/JMath.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/os.h"
|
||||
|
||||
//
|
||||
// Types:
|
||||
//
|
||||
|
||||
struct JMath {
|
||||
static f32 asinAcosTable_[1032];
|
||||
};
|
||||
|
||||
struct J3DVertexBuffer {};
|
||||
|
||||
struct J3DModel {};
|
||||
|
||||
struct J3DAnmCluster {};
|
||||
|
||||
struct J3DDeformData {
|
||||
/* 8032E1F8 */ J3DDeformData();
|
||||
/* 8032E230 */ void offAllFlag(u32);
|
||||
/* 8032E298 */ void deform(J3DVertexBuffer*);
|
||||
/* 8032E274 */ void deform(J3DModel*);
|
||||
/* 8032E364 */ void setAnm(J3DAnmCluster*);
|
||||
};
|
||||
|
||||
struct J3DDeformer {
|
||||
/* 8032E39C */ J3DDeformer(J3DDeformData*);
|
||||
/* 8032EAB4 */ void deform(J3DVertexBuffer*, u16, f32*);
|
||||
/* 8032E3BC */ void deform(J3DVertexBuffer*, u16);
|
||||
/* 8032E4A4 */ void deform_VtxPosF32(J3DVertexBuffer*, J3DCluster*, J3DClusterKey*, f32*);
|
||||
/* 8032E60C */ void deform_VtxNrmF32(J3DVertexBuffer*, J3DCluster*, J3DClusterKey*, f32*);
|
||||
/* 8032EBCC */ void normalizeWeight(int, f32*);
|
||||
};
|
||||
#ifdef DEBUG
|
||||
#define J3D_ASSERT(COND) \
|
||||
if ((COND) == 0) { \
|
||||
JUTAssertion::showAssert(JUTAssertion::getSDevice(), __FILE__, __LINE__, \
|
||||
"Error : null pointer"); \
|
||||
OSPanic(__FILE__, __LINE__, "Halt"); \
|
||||
}
|
||||
#else
|
||||
#define J3D_ASSERT(COND)
|
||||
#endif
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
@@ -58,8 +44,6 @@ extern "C" void normalizeWeight__11J3DDeformerFiPf();
|
||||
//
|
||||
|
||||
extern "C" void PPCSync();
|
||||
extern "C" void DCStoreRangeNoSync();
|
||||
extern "C" void PSVECNormalize();
|
||||
extern "C" void __cvt_fp2unsigned();
|
||||
extern "C" void _savegpr_21();
|
||||
extern "C" void _savegpr_26();
|
||||
@@ -76,77 +60,93 @@ extern "C" f32 asinAcosTable___5JMath[1032];
|
||||
//
|
||||
|
||||
/* 8032E1F8-8032E230 328B38 0038+00 0/0 1/1 0/0 .text __ct__13J3DDeformDataFv */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm J3DDeformData::J3DDeformData() {
|
||||
nofralloc
|
||||
#include "asm/JSystem/J3DGraphAnimator/J3DCluster/__ct__13J3DDeformDataFv.s"
|
||||
J3DDeformData::J3DDeformData() {
|
||||
mClusterNum = 0;
|
||||
mClusterKeyNum = 0;
|
||||
mClusterVertexNum = 0;
|
||||
mClusterPointer = NULL;
|
||||
mClusterKeyPointer = NULL;
|
||||
mClusterVertex = NULL;
|
||||
mVtxPosNum = 0;
|
||||
mVtxNrmNum = 0;
|
||||
mVtxPos = NULL;
|
||||
mVtxNrm = NULL;
|
||||
mClusterName = NULL;
|
||||
mClusterKeyName = NULL;
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 8032E230-8032E274 328B70 0044+00 0/0 1/1 0/0 .text offAllFlag__13J3DDeformDataFUl */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void J3DDeformData::offAllFlag(u32 param_0) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/J3DGraphAnimator/J3DCluster/offAllFlag__13J3DDeformDataFUl.s"
|
||||
void J3DDeformData::offAllFlag(u32 i_flag) {
|
||||
for (u16 i = 0; i < mClusterNum; i++) {
|
||||
mClusterPointer[i].getDeformer()->offFlag(i_flag);
|
||||
}
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 8032E274-8032E298 328BB4 0024+00 0/0 1/1 0/0 .text deform__13J3DDeformDataFP8J3DModel
|
||||
*/
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void J3DDeformData::deform(J3DModel* param_0) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/J3DGraphAnimator/J3DCluster/deform__13J3DDeformDataFP8J3DModel.s"
|
||||
void J3DDeformData::deform(J3DModel* model) {
|
||||
J3D_ASSERT(model != NULL);
|
||||
|
||||
deform(model->getVertexBuffer());
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 8032E298-8032E364 328BD8 00CC+00 1/1 0/0 0/0 .text deform__13J3DDeformDataFP15J3DVertexBuffer
|
||||
*/
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void J3DDeformData::deform(J3DVertexBuffer* param_0) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/J3DGraphAnimator/J3DCluster/deform__13J3DDeformDataFP15J3DVertexBuffer.s"
|
||||
void J3DDeformData::deform(J3DVertexBuffer* buffer) {
|
||||
J3D_ASSERT(buffer != NULL);
|
||||
|
||||
buffer->swapVtxPosArrayPointer();
|
||||
buffer->swapVtxNrmArrayPointer();
|
||||
|
||||
for (u16 i = 0; i < mClusterNum; i++) {
|
||||
mClusterPointer[i].getDeformer()->deform(buffer, i);
|
||||
}
|
||||
|
||||
DCStoreRangeNoSync(buffer->getVtxPosArrayPointer(0),
|
||||
buffer->getVertexData()->getVtxNum() * sizeof(Vec));
|
||||
DCStoreRangeNoSync(buffer->getVtxNrmArrayPointer(0),
|
||||
buffer->getVertexData()->getNrmNum() * sizeof(Vec));
|
||||
PPCSync();
|
||||
|
||||
buffer->setCurrentVtxPos(buffer->getVtxPosArrayPointer(0));
|
||||
buffer->setCurrentVtxNrm(buffer->getVtxNrmArrayPointer(0));
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 8032E364-8032E39C 328CA4 0038+00 0/0 1/1 0/0 .text setAnm__13J3DDeformDataFP13J3DAnmCluster */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void J3DDeformData::setAnm(J3DAnmCluster* param_0) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/J3DGraphAnimator/J3DCluster/setAnm__13J3DDeformDataFP13J3DAnmCluster.s"
|
||||
void J3DDeformData::setAnm(J3DAnmCluster* anm) {
|
||||
for (u16 i = 0; i < mClusterNum; i++) {
|
||||
mClusterPointer[i].getDeformer()->setAnmCluster(anm);
|
||||
}
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 8032E39C-8032E3BC 328CDC 0020+00 0/0 1/1 0/0 .text __ct__11J3DDeformerFP13J3DDeformData */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm J3DDeformer::J3DDeformer(J3DDeformData* param_0) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/J3DGraphAnimator/J3DCluster/__ct__11J3DDeformerFP13J3DDeformData.s"
|
||||
J3DDeformer::J3DDeformer(J3DDeformData* data) {
|
||||
mDeformData = data;
|
||||
mAnmCluster = NULL;
|
||||
field_0x8 = NULL;
|
||||
field_0xc = NULL;
|
||||
mFlags = 3;
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 8032E3BC-8032E4A4 328CFC 00E8+00 1/1 0/0 0/0 .text deform__11J3DDeformerFP15J3DVertexBufferUs
|
||||
*/
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void J3DDeformer::deform(J3DVertexBuffer* param_0, u16 param_1) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/J3DGraphAnimator/J3DCluster/deform__11J3DDeformerFP15J3DVertexBufferUs.s"
|
||||
void J3DDeformer::deform(J3DVertexBuffer* buffer, u16 param_1) {
|
||||
J3D_ASSERT(buffer != 0);
|
||||
|
||||
u16 var_r31 = 0;
|
||||
if (mAnmCluster != NULL) {
|
||||
for (u16 i = 0; i < param_1; i++) {
|
||||
var_r31 += mDeformData->getClusterPointer(i)->mKeyNum;
|
||||
}
|
||||
|
||||
u16 num = mDeformData->getClusterPointer(param_1)->mKeyNum;
|
||||
for (u16 i = 0; i < num; i++) {
|
||||
field_0x8[i] = mAnmCluster->getWeight(var_r31++);
|
||||
}
|
||||
|
||||
deform(buffer, param_1, field_0x8);
|
||||
}
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 80456470-80456474 004A70 0004+00 2/2 0/0 0/0 .sdata2 @830 */
|
||||
|
||||
@@ -1,34 +1,12 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: J3DJoint
|
||||
//
|
||||
|
||||
#include "JSystem/J3DGraphAnimator/J3DJoint.h"
|
||||
#include "JSystem/J3DGraphAnimator/J3DModel.h"
|
||||
#include "JSystem/J3DGraphAnimator/J3DMaterialAnm.h"
|
||||
#include "JSystem/J3DGraphAnimator/J3DModel.h"
|
||||
#include "JSystem/J3DGraphBase/J3DDrawBuffer.h"
|
||||
#include "JSystem/J3DGraphBase/J3DMaterial.h"
|
||||
#include "JSystem/JMath/JMath.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "m_Do/m_Do_mtx.h"
|
||||
|
||||
//
|
||||
// Types:
|
||||
//
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* 8032EC28-8032ECAC 329568 0084+00 0/0 1/1 0/0 .text
|
||||
* init__25J3DMtxCalcJ3DSysInitBasicFRC3VecRA3_A4_Cf */
|
||||
void J3DMtxCalcJ3DSysInitBasic::init(Vec const& scale, Mtx const& mtx) {
|
||||
@@ -181,7 +159,7 @@ void J3DJoint::appendChild(J3DJoint* pChild) {
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
/* dead data */
|
||||
SECTION_DEAD static u32 const pad_803A2080[2] = {0,0};
|
||||
SECTION_DEAD static u32 const pad_803A2080[2] = {0, 0};
|
||||
#pragma pop
|
||||
|
||||
/* 8032F170-8032F254 329AB0 00E4+00 0/0 1/1 0/0 .text __ct__8J3DJointFv */
|
||||
@@ -210,12 +188,13 @@ void J3DJoint::entryIn() {
|
||||
MtxP anmMtx = j3dSys.getModel()->i_getAnmMtx(mJntNo);
|
||||
j3dSys.getDrawBuffer(0)->setZMtx(anmMtx);
|
||||
j3dSys.getDrawBuffer(1)->setZMtx(anmMtx);
|
||||
for (J3DMaterial* mesh = mMesh; mesh != NULL; ) {
|
||||
for (J3DMaterial* mesh = mMesh; mesh != NULL;) {
|
||||
if (mesh->getShape()->checkFlag(1)) {
|
||||
mesh = mesh->getNext();
|
||||
} else {
|
||||
J3DMatPacket* matPacket = j3dSys.getModel()->getMatPacket(mesh->getIndex());
|
||||
J3DShapePacket* shapePacket = j3dSys.getModel()->getShapePacket(mesh->getShape()->getIndex());
|
||||
J3DShapePacket* shapePacket =
|
||||
j3dSys.getModel()->getShapePacket(mesh->getShape()->getIndex());
|
||||
if (!matPacket->isLocked()) {
|
||||
if (mesh->getMaterialAnm()) {
|
||||
J3DMaterialAnm* piVar8 = mesh->getMaterialAnm();
|
||||
@@ -276,7 +255,7 @@ void J3DJoint::recursiveCalc() {
|
||||
child->recursiveCalc();
|
||||
}
|
||||
mDoMtx_copy(prevCurrentMtx, J3DSys::mCurrentMtx);
|
||||
|
||||
|
||||
J3DSys::mCurrentS.x = currentX;
|
||||
J3DSys::mCurrentS.y = currentY;
|
||||
J3DSys::mCurrentS.z = currentZ;
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: J3DJointTree
|
||||
//
|
||||
|
||||
#include "JSystem/J3DGraphAnimator/J3DJointTree.h"
|
||||
#include "JSystem/J3DGraphAnimator/J3DMaterialAttach.h"
|
||||
#include "JSystem/J3DGraphAnimator/J3DShapeTable.h"
|
||||
#include "JSystem/J3DGraphBase/J3DMaterial.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
/* 80325A18-80325A9C 320358 0084+00 0/0 1/1 0/0 .text __ct__12J3DJointTreeFv */
|
||||
J3DJointTree::J3DJointTree()
|
||||
|
||||
@@ -111,6 +111,29 @@ int J3DMaterialTable::removeMatColorAnimator(J3DAnmColor* pAnmColor) {
|
||||
|
||||
/* 8032F6F8-8032F7B4 32A038 00BC+00 0/0 5/5 10/10 .text
|
||||
* removeTexNoAnimator__16J3DMaterialTableFP16J3DAnmTexPattern */
|
||||
// regalloc
|
||||
#ifdef NONMATCHING
|
||||
int J3DMaterialTable::removeTexNoAnimator(J3DAnmTexPattern* anm) {
|
||||
int ret = 0;
|
||||
u16 materialNum = anm->getUpdateMaterialNum();
|
||||
J3DAnmTexPatternFullTable* anm_table = anm->getAnmTable();
|
||||
|
||||
for (u16 i = 0; i < materialNum; i++) {
|
||||
if (anm->isValidUpdateMaterialID(i)) {
|
||||
u16 materialID = anm->getUpdateMaterialID(i);
|
||||
|
||||
J3DMaterialAnm* pMatAnm = getMaterialNodePointer(materialID)->getMaterialAnm();
|
||||
u8 texNo = anm_table[i].mTexNo;
|
||||
if (pMatAnm == NULL)
|
||||
ret = 1;
|
||||
else
|
||||
pMatAnm->setTexNoAnm(texNo, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
@@ -119,6 +142,7 @@ asm int J3DMaterialTable::removeTexNoAnimator(J3DAnmTexPattern* param_0) {
|
||||
#include "asm/JSystem/J3DGraphAnimator/J3DMaterialAttach/removeTexNoAnimator__16J3DMaterialTableFP16J3DAnmTexPattern.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* 8032F7B4-8032F880 32A0F4 00CC+00 0/0 4/4 26/26 .text
|
||||
* removeTexMtxAnimator__16J3DMaterialTableFP19J3DAnmTextureSRTKey */
|
||||
|
||||
@@ -40,7 +40,7 @@ void JMAEulerToQuat(s16 x, s16 y, s16 z, Quaternion* quat) {
|
||||
f32 cyz = cosY * cosZ;
|
||||
f32 syz = sinY * sinZ;
|
||||
quat->w = cosX * (cyz) + sinX * (syz);
|
||||
quat->x = sinX * (cyz) - cosX * (syz);
|
||||
quat->x = sinX * (cyz)-cosX * (syz);
|
||||
quat->y = cosZ * (cosX * sinY) + sinZ * (sinX * cosY);
|
||||
quat->z = sinZ * (cosX * cosY) - cosZ * (sinX * sinY);
|
||||
}
|
||||
@@ -61,8 +61,10 @@ void JMAQuatLerp(register const Quaternion* p, register const Quaternion* q, f32
|
||||
Quaternion* dst) {
|
||||
register f32 pxy, pzw, qxy, qzw;
|
||||
register f32 dp;
|
||||
__asm // compute dot product
|
||||
{
|
||||
|
||||
#ifdef __MWERKS__ // clang-format off
|
||||
// compute dot product
|
||||
asm {
|
||||
psq_l pxy, 0(p), 0, 0
|
||||
psq_l qxy, 0(q), 0, 0
|
||||
ps_mul dp, pxy, qxy
|
||||
@@ -73,14 +75,14 @@ void JMAQuatLerp(register const Quaternion* p, register const Quaternion* q, f32
|
||||
|
||||
ps_sum0 dp, dp, dp, dp
|
||||
}
|
||||
#endif // clang-format on
|
||||
|
||||
if (dp < 0.0) {
|
||||
dst->x = -t * (p->x + q->x) + p->x;
|
||||
dst->y = -t * (p->y + q->y) + p->y;
|
||||
dst->z = -t * (p->z + q->z) + p->z;
|
||||
dst->w = -t * (p->w + q->w) + p->w;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
dst->x = -t * (p->x - q->x) + p->x;
|
||||
dst->y = -t * (p->y - q->y) + p->y;
|
||||
dst->z = -t * (p->z - q->z) + p->z;
|
||||
@@ -90,42 +92,78 @@ void JMAQuatLerp(register const Quaternion* p, register const Quaternion* q, f32
|
||||
|
||||
/* 80339A30-80339A5C 334370 002C+00 0/0 1/1 0/0 .text JMAFastVECNormalize__FPC3VecP3Vec
|
||||
*/
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void JMAFastVECNormalize(Vec const* param_0, Vec* param_1) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/JMath/JMath/JMAFastVECNormalize__FPC3VecP3Vec.s"
|
||||
void JMAFastVECNormalize(register const Vec* src, register Vec* dst) {
|
||||
register f32 vxy, rxy, vz, length;
|
||||
#ifdef __MWERKS__ // clang-format off
|
||||
asm {
|
||||
psq_l vxy, 0(src), 0, 0
|
||||
ps_mul rxy, vxy, vxy
|
||||
lfs vz, src->z
|
||||
ps_madd length, vz, vz, rxy
|
||||
ps_sum0 length, length, rxy, rxy
|
||||
frsqrte length, length
|
||||
ps_muls0 vxy, vxy, length;
|
||||
psq_st vxy, 0(dst), 0, 0
|
||||
fmuls vz, vz, length
|
||||
stfs vz, dst->z
|
||||
}
|
||||
#endif // clang-format on
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 80339A5C-80339A84 33439C 0028+00 0/0 1/1 0/0 .text JMAVECScaleAdd__FPC3VecPC3VecP3Vecf
|
||||
*/
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void JMAVECScaleAdd(Vec const* param_0, Vec const* param_1, Vec* param_2, f32 param_3) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/JMath/JMath/JMAVECScaleAdd__FPC3VecPC3VecP3Vecf.s"
|
||||
}
|
||||
#pragma pop
|
||||
void JMAVECScaleAdd(register const Vec* vec1, register const Vec* vec2, register Vec* dst,
|
||||
register f32 scale) {
|
||||
register f32 v1xy;
|
||||
register f32 v2xy = scale;
|
||||
register f32 rxy, v1z, v2z, rz;
|
||||
#ifdef __MWERKS__ // clang-format off
|
||||
asm {
|
||||
psq_l v1xy, 0(vec1), 0, 0
|
||||
psq_l v2xy, 0(vec2), 0, 0
|
||||
ps_madds0 rxy, v1xy, scale, v2xy
|
||||
psq_st rxy, 0(dst), 0, 0
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 804564D0-804564D8 004AD0 0004+04 1/1 0/0 0/0 .sdata2 @411 */
|
||||
SECTION_SDATA2 static f32 lit_411[1 + 1 /* padding */] = {
|
||||
1.0f,
|
||||
/* padding */
|
||||
0.0f,
|
||||
};
|
||||
psq_l v1z, 8(vec1), 1, 0
|
||||
psq_l v2z, 8(vec2), 1, 0
|
||||
ps_madds0 rz, v1z, scale, v2z
|
||||
psq_st rz, 8(dst), 1, 0
|
||||
}
|
||||
#endif // clang-format on
|
||||
}
|
||||
|
||||
/* 80339A84-80339AE4 3343C4 0060+00 0/0 5/5 0/0 .text JMAMTXApplyScale__FPA4_CfPA4_ffff
|
||||
*/
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void JMAMTXApplyScale(f32 const (*param_0)[4], f32 (*param_1)[4], f32 param_2, f32 param_3,
|
||||
f32 param_4) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/JMath/JMath/JMAMTXApplyScale__FPA4_CfPA4_ffff.s"
|
||||
void JMAMTXApplyScale(register const Mtx src, register Mtx dst, register f32 xScale,
|
||||
register f32 yScale, register f32 zScale) {
|
||||
register f32 scale = yScale;
|
||||
register f32 x, y, z;
|
||||
register f32 normal = 1.0f;
|
||||
#ifdef __MWERKS__ // clang-format off
|
||||
asm {
|
||||
// scale first 2 components
|
||||
ps_merge00 scale, xScale, scale
|
||||
psq_l x, 0(src), 0, 0
|
||||
psq_l y, 16(src), 0, 0
|
||||
psq_l z, 32(src), 0, 0
|
||||
ps_mul x, x, scale
|
||||
ps_mul y, y, scale
|
||||
ps_mul z, z, scale
|
||||
psq_st x, 0(dst), 0, 0
|
||||
psq_st y, 16(dst), 0, 0
|
||||
psq_st z, 32(dst), 0, 0
|
||||
|
||||
// scale last 2 components
|
||||
ps_merge00 scale, zScale, normal
|
||||
psq_l x, 8(src), 0, 0
|
||||
psq_l y, 24(src), 0, 0
|
||||
psq_l z, 40(src), 0, 0
|
||||
ps_mul x, x, scale
|
||||
ps_mul y, y, scale
|
||||
ps_mul z, z, scale
|
||||
psq_st x, 8(dst), 0, 0
|
||||
psq_st y, 24(dst), 0, 0
|
||||
psq_st z, 40(dst), 0, 0
|
||||
}
|
||||
#endif // clang-format on
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
Reference in New Issue
Block a user