Clear unknowns in LegoAnimActorEntry and LegoAnimKey (#1580)

This commit is contained in:
Fabian Neundorf
2025-06-22 14:34:29 +02:00
committed by GitHub
parent 16db496832
commit 2595537c4c
4 changed files with 25 additions and 17 deletions

View File

@@ -577,10 +577,10 @@ void LegoCarBuildAnimPresenter::RotateAroundYAxis(MxFloat p_angle)
newRotation.EqualsHamiltonProduct(currentRotation, additionalRotation);
if (newRotation[3] < 0.9999) {
rotationKey->FUN_100739a0(TRUE);
rotationKey->SetActive(TRUE);
}
else {
rotationKey->FUN_100739a0(FALSE);
rotationKey->SetActive(FALSE);
}
m_platformAnimNodeData->GetRotationKey(0)->SetX(newRotation[0]);

View File

@@ -221,10 +221,10 @@ void LegoAnimPresenter::FUN_100692b0()
for (LegoU32 i = 0; i < numActors; i++) {
LegoChar* str = GetVariableOrIdentity(m_anim->GetActorName(i), NULL);
undefined4 unk0x04 = m_anim->GetActorUnknown0x04(i);
LegoU32 actorType = m_anim->GetActorType(i);
LegoROI* roi = NULL;
if (unk0x04 == 2) {
if (actorType == LegoAnimActorEntry::e_actorType2) {
LegoChar* src;
if (str[0] == '*') {
src = str + 1;
@@ -239,7 +239,7 @@ void LegoAnimPresenter::FUN_100692b0()
roi->SetVisibility(FALSE);
}
}
else if (unk0x04 == 4) {
else if (actorType == LegoAnimActorEntry::e_actorType4) {
LegoChar* baseName = new LegoChar[strlen(str)];
strcpy(baseName, str + 1);
strlwr(baseName);
@@ -254,7 +254,7 @@ void LegoAnimPresenter::FUN_100692b0()
delete[] baseName;
delete[] und;
}
else if (unk0x04 == 3) {
else if (actorType == LegoAnimActorEntry::e_actorType3) {
LegoChar* lodName = new LegoChar[strlen(str)];
strcpy(lodName, str + 1);
@@ -300,9 +300,9 @@ void LegoAnimPresenter::FUN_100695c0()
for (LegoU32 i = 0; i < numActors; i++) {
if (FUN_100698b0(rois, m_anim->GetActorName(i)) == FALSE) {
undefined4 unk0x04 = m_anim->GetActorUnknown0x04(i);
LegoU32 actorType = m_anim->GetActorType(i);
if (unk0x04 == 5 || unk0x04 == 6) {
if (actorType == LegoAnimActorEntry::e_actorType5 || actorType == LegoAnimActorEntry::e_actorType6) {
LegoChar lodName[256];
const LegoChar* actorName = m_anim->GetActorName(i);

View File

@@ -1063,7 +1063,7 @@ LegoResult LegoAnim::Read(LegoStorage* p_storage, LegoS32 p_parseScene)
m_modelList[i].m_name[length] = '\0';
if (p_storage->Read(&m_modelList[i].m_unk0x04, sizeof(undefined4)) != SUCCESS) {
if (p_storage->Read(&m_modelList[i].m_type, sizeof(LegoU32)) != SUCCESS) {
goto done;
}
}
@@ -1124,7 +1124,7 @@ LegoResult LegoAnim::Write(LegoStorage* p_storage)
goto done;
}
if (p_storage->Write(&m_modelList[i].m_unk0x04, sizeof(m_modelList[i].m_unk0x04)) != SUCCESS) {
if (p_storage->Write(&m_modelList[i].m_type, sizeof(m_modelList[i].m_type)) != SUCCESS) {
goto done;
}
}
@@ -1159,10 +1159,10 @@ const LegoChar* LegoAnim::GetActorName(LegoU32 p_index)
// FUNCTION: LEGO1 0x100a0f40
// FUNCTION: BETA10 0x1018023c
undefined4 LegoAnim::GetActorUnknown0x04(LegoU32 p_index)
LegoU32 LegoAnim::GetActorType(LegoU32 p_index)
{
if (p_index < m_numActors) {
return m_modelList[p_index].m_unk0x04;
return m_modelList[p_index].m_type;
}
return 0;

View File

@@ -30,9 +30,9 @@ public:
LegoU32 ShouldSkipInterpolation() { return m_flags & c_skipInterpolation; }
// FUNCTION: BETA10 0x100739a0
void FUN_100739a0(MxS32 p_param)
void SetActive(MxS32 p_active)
{
if (p_param) {
if (p_active) {
m_flags |= c_active;
}
else {
@@ -289,8 +289,16 @@ protected:
// SIZE 0x08
struct LegoAnimActorEntry {
enum {
e_actorType2 = 2,
e_actorType3 = 3,
e_actorType4 = 4,
e_actorType5 = 5,
e_actorType6 = 6,
};
LegoChar* m_name; // 0x00
undefined4 m_unk0x04; // 0x04
LegoU32 m_type; // 0x04
};
// TODO: Possibly called `LegoCameraAnim(ation)`?
@@ -338,7 +346,7 @@ public:
virtual LegoResult Read(LegoStorage* p_storage, LegoS32 p_parseScene); // vtable+0x10
const LegoChar* GetActorName(LegoU32 p_index);
undefined4 GetActorUnknown0x04(LegoU32 p_index);
LegoU32 GetActorType(LegoU32 p_index);
// FUNCTION: BETA10 0x1005abf0
LegoAnimScene* GetCamAnim() { return m_camAnim; }