mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-05-30 08:26:24 -04:00
add more be swap in J3DDeform data, stub TObject_sound::do_paragraph
This commit is contained in:
@@ -650,13 +650,13 @@ public:
|
||||
*/
|
||||
class J3DAnmCluster : public J3DAnmBase {
|
||||
public:
|
||||
J3DAnmCluster(s16 frameMax, f32* pWeight) : J3DAnmBase(frameMax) { mWeight = pWeight; }
|
||||
J3DAnmCluster(s16 frameMax, BE(f32)* pWeight) : J3DAnmBase(frameMax) { mWeight = pWeight; }
|
||||
|
||||
virtual ~J3DAnmCluster() {}
|
||||
virtual s32 getKind() const { return 3; }
|
||||
virtual f32 getWeight(u16) const { return 1.0f; }
|
||||
|
||||
/* 0x0C */ f32* mWeight;
|
||||
/* 0x0C */ BE(f32)* mWeight;
|
||||
}; // Size: 0x10
|
||||
|
||||
/**
|
||||
|
||||
@@ -108,8 +108,8 @@ public:
|
||||
J3D_ASSERT_RANGE(199, (i < mClusterKeyNum));
|
||||
return &mClusterKeyPointer[i];
|
||||
}
|
||||
f32* getVtxPos() { return mVtxPos; }
|
||||
f32* getVtxNrm() { return mVtxNrm; }
|
||||
BE(f32)* getVtxPos() { return mVtxPos; }
|
||||
BE(f32)* getVtxNrm() { return mVtxNrm; }
|
||||
|
||||
/* 0x00 */ u16 mClusterNum;
|
||||
/* 0x02 */ u16 mClusterKeyNum;
|
||||
@@ -119,8 +119,8 @@ public:
|
||||
/* 0x10 */ J3DClusterVertex* mClusterVertex;
|
||||
/* 0x14 */ u16 mVtxPosNum;
|
||||
/* 0x16 */ u16 mVtxNrmNum;
|
||||
/* 0x18 */ f32* mVtxPos;
|
||||
/* 0x1C */ f32* mVtxNrm;
|
||||
/* 0x18 */ BE(f32)* mVtxPos;
|
||||
/* 0x1C */ BE(f32)* mVtxNrm;
|
||||
/* 0x20 */ JUTNameTab* mClusterName;
|
||||
/* 0x24 */ JUTNameTab* mClusterKeyName;
|
||||
|
||||
|
||||
@@ -104,8 +104,8 @@ void J3DDeformer::deform_VtxPosF32(J3DVertexBuffer* i_buffer, J3DCluster* i_clus
|
||||
int posNum = i_cluster->mPosNum;
|
||||
int keyNum = i_cluster->mKeyNum;
|
||||
f32* vtxPosArray = (f32*)i_buffer->getVtxPosArrayPointer(0);
|
||||
f32* deformVtxPos = mDeformData->getVtxPos();
|
||||
u16* iVar9 = CALC_OFFSET(i_cluster->field_0x18, u16, mBlockBase);
|
||||
BE(f32)* deformVtxPos = mDeformData->getVtxPos();
|
||||
BE(u16)* iVar9 = CALC_OFFSET(i_cluster->field_0x18, BE(u16), mBlockBase);
|
||||
|
||||
for (int i = 0; i < posNum; i++) {
|
||||
int index = iVar9[i] * 3;
|
||||
@@ -117,12 +117,12 @@ void J3DDeformer::deform_VtxPosF32(J3DVertexBuffer* i_buffer, J3DCluster* i_clus
|
||||
f32 local_58[2] = {1.0f, -1.0f};
|
||||
|
||||
for (u16 i = 0; i < posNum; i++) {
|
||||
int index = CALC_OFFSET(i_cluster->field_0x18, u16, mBlockBase)[i] * 3;
|
||||
int index = CALC_OFFSET(i_cluster->field_0x18, BE(u16), mBlockBase)[i] * 3;
|
||||
for (u16 j = 0; j < keyNum; j++) {
|
||||
int uVar8;
|
||||
int uVar7;
|
||||
key = &i_key[j];
|
||||
uVar8 = uVar7 = CALC_OFFSET(key->field_0x4, u16, mBlockBase)[i];
|
||||
uVar8 = uVar7 = CALC_OFFSET(key->field_0x4, BE(u16), mBlockBase)[i];
|
||||
uVar7 &= ~0xE000;
|
||||
uVar7 *= 3;
|
||||
f32 deform0 = deformVtxPos[uVar7];
|
||||
@@ -142,7 +142,7 @@ void J3DDeformer::deform_VtxPosF32(J3DVertexBuffer* i_buffer, J3DCluster* i_clus
|
||||
void J3DDeformer::deform_VtxNrmF32(J3DVertexBuffer* i_buffer, J3DCluster* i_cluster,
|
||||
J3DClusterKey* i_key, f32* i_weights) {
|
||||
f32* vtxNrmArray = (f32*)i_buffer->getVtxNrmArrayPointer(0);
|
||||
f32* deformVtxNrm = mDeformData->getVtxNrm();
|
||||
BE(f32)* deformVtxNrm = mDeformData->getVtxNrm();
|
||||
f32* iVar13 = field_0xc;
|
||||
u16 keyNum = i_cluster->mKeyNum;
|
||||
int uVar2 = i_cluster->field_0x16;
|
||||
@@ -154,7 +154,7 @@ void J3DDeformer::deform_VtxNrmF32(J3DVertexBuffer* i_buffer, J3DCluster* i_clus
|
||||
iVar13[index + 2] = 0.0f;
|
||||
for (u16 j = 0; j < keyNum; j++) {
|
||||
J3DClusterKey* key = &i_key[j];
|
||||
int uVar3 = CALC_OFFSET(key->field_0x8, u16, mBlockBase)[i];
|
||||
int uVar3 = CALC_OFFSET(key->field_0x8, BE(u16), mBlockBase)[i];
|
||||
int uVar4 = uVar3;
|
||||
uVar3 &= ~0xE000;
|
||||
uVar3 *= 3;
|
||||
@@ -189,7 +189,7 @@ void J3DDeformer::deform_VtxNrmF32(J3DVertexBuffer* i_buffer, J3DCluster* i_clus
|
||||
vec.z = 0.0f;
|
||||
f32 scale = 1.0f / clusterVtx->mNum;
|
||||
for (u16 j = 0; j < clusterVtx->mNum; j++) {
|
||||
int index = CALC_OFFSET(clusterVtx->field_0x4, u16, mBlockBase)[j] * 3;
|
||||
int index = CALC_OFFSET(clusterVtx->field_0x4, BE(u16), mBlockBase)[j] * 3;
|
||||
vec.x += scale * iVar13[index];
|
||||
vec.y += scale * iVar13[index + 1];
|
||||
vec.z += scale * iVar13[index + 2];
|
||||
@@ -197,12 +197,12 @@ void J3DDeformer::deform_VtxNrmF32(J3DVertexBuffer* i_buffer, J3DCluster* i_clus
|
||||
normalize((f32*)&vec);
|
||||
|
||||
for (u16 j = 0; j < clusterVtx->mNum; j++) {
|
||||
u16 tmp = CALC_OFFSET(clusterVtx->field_0x8, u16, mBlockBase)[j];
|
||||
u16 tmp = CALC_OFFSET(clusterVtx->field_0x8, BE(u16), mBlockBase)[j];
|
||||
if (tmp == 0xffff) {
|
||||
continue;
|
||||
}
|
||||
int index = tmp * 3;
|
||||
u16 iVar4 = CALC_OFFSET(clusterVtx->field_0x4, u16, mBlockBase)[j];
|
||||
u16 iVar4 = CALC_OFFSET(clusterVtx->field_0x4, BE(u16), mBlockBase)[j];
|
||||
int index2 = iVar4 * 3;
|
||||
|
||||
f32 dot = vec.x * iVar13[index2] + vec.y * iVar13[index2 + 1]
|
||||
|
||||
@@ -354,7 +354,7 @@ void J3DAnmFullLoader_v15::setAnmCluster(J3DAnmClusterFull* param_1,
|
||||
param_1->mFrame = 0.0f;
|
||||
param_1->mAnmTable =
|
||||
JSUConvertOffsetToPtr<J3DAnmClusterFullTable>(param_2, param_2->mTableOffset);
|
||||
param_1->mWeight = JSUConvertOffsetToPtr<f32>(param_2, param_2->mWeightOffset);
|
||||
param_1->mWeight = JSUConvertOffsetToPtr<BE(f32)>(param_2, param_2->mWeightOffset);
|
||||
}
|
||||
|
||||
void J3DAnmFullLoader_v15::readAnmVtxColor(const J3DAnmVtxColorFullData* param_1) {
|
||||
@@ -618,7 +618,7 @@ void J3DAnmKeyLoader_v15::setAnmCluster(J3DAnmClusterKey* param_1,
|
||||
param_1->mFrame = 0.0f;
|
||||
param_1->mAnmTable =
|
||||
JSUConvertOffsetToPtr<J3DAnmClusterKeyTable>(param_2, param_2->mTableOffset);
|
||||
param_1->mWeight = JSUConvertOffsetToPtr<f32>(param_2, param_2->mWeightOffset);
|
||||
param_1->mWeight = JSUConvertOffsetToPtr<BE(f32)>(param_2, param_2->mWeightOffset);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -69,8 +69,8 @@ void J3DClusterLoader_v15::readCluster(const J3DClusterBlock* block) {
|
||||
mpDeformData->mClusterKeyName = NULL;
|
||||
}
|
||||
|
||||
mpDeformData->mVtxPos = JSUConvertOffsetToPtr<f32>(block, block->mVtxPos);
|
||||
mpDeformData->mVtxNrm = JSUConvertOffsetToPtr<f32>(block, block->mVtxNrm);
|
||||
mpDeformData->mVtxPos = JSUConvertOffsetToPtr<BE(f32)>(block, block->mVtxPos);
|
||||
mpDeformData->mVtxNrm = JSUConvertOffsetToPtr<BE(f32)>(block, block->mVtxNrm);
|
||||
|
||||
intptr_t clusterPointer = (intptr_t) block->mClusterPointer;
|
||||
int clusterKeyPointerSize = (intptr_t)block->mClusterKeyPointer - (intptr_t)block->mClusterPointer;
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
#include "JSystem/JStudio/JStudio/jstudio-object.h"
|
||||
|
||||
#include "dusk/audio.h"
|
||||
|
||||
namespace JStudio {
|
||||
namespace {
|
||||
|
||||
@@ -1103,6 +1105,8 @@ u32 const JStudio::TAdaptor_sound::sauVariableValue_3_POSITION_XYZ[3] = {
|
||||
};
|
||||
|
||||
void JStudio::TObject_sound::do_paragraph(u32 param_1, void const* param_2, u32 param_3) {
|
||||
DUSK_AUDIO_SKIP()
|
||||
|
||||
TAdaptor* adaptor = getAdaptor();
|
||||
TControl* control;
|
||||
if (adaptor == NULL) {
|
||||
|
||||
Reference in New Issue
Block a user