Implement/match LegoAnimationManager::FUN_100627d0 (#899)

This commit is contained in:
Christian Semmler 2024-05-10 09:11:35 -04:00 committed by GitHub
parent 79791be574
commit f5ffd3aba3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 62 additions and 13 deletions

View file

@ -26,7 +26,7 @@ struct Character {
MxBool m_unk0x08; // 0x08
MxBool m_unk0x09; // 0x09
MxU32 m_unk0x0c; // 0x0c
MxU32 m_unk0x10; // 0x10
MxS32 m_unk0x10; // 0x10
MxBool m_active; // 0x14
MxU8 m_unk0x15; // 0x15
MxU8 m_unk0x16; // 0x16
@ -43,7 +43,7 @@ struct Vehicle {
struct Unknown0x3c {
LegoROI* m_roi; // 0x00
MxS32 m_characterId; // 0x04
undefined4 m_unk0x08; // 0x08
MxLong m_unk0x08; // 0x08
undefined m_unk0x0c; // 0x0c
MxBool m_unk0x0d; // 0x0d
float m_unk0x10; // 0x10
@ -98,7 +98,7 @@ class LegoAnimationManager : public MxCore {
void FUN_10061010(MxBool p_und);
LegoTranInfo* GetTranInfo(MxU32 p_index);
void FUN_10062770();
void FUN_100627d0(MxBool);
void FUN_100627d0(MxBool p_und);
void FUN_100629b0(MxU32, MxBool);
void FUN_10063270(LegoROIList*, LegoAnimPresenter*);
void FUN_10063780(LegoROIList* p_list);
@ -171,7 +171,7 @@ class LegoAnimationManager : public MxCore {
MxLong m_unk0x408; // 0x408
MxLong m_unk0x40c; // 0x40c
MxLong m_unk0x410; // 0x410
undefined4 m_unk0x414; // 0x414
MxLong m_unk0x414; // 0x414
MxU32 m_numAllowedExtras; // 0x418
undefined4 m_unk0x41c; // 0x41c
AnimState* m_animState; // 0x420

View file

@ -1531,10 +1531,59 @@ void LegoAnimationManager::FUN_10062770()
}
}
// STUB: LEGO1 0x100627d0
void LegoAnimationManager::FUN_100627d0(MxBool)
// FUNCTION: LEGO1 0x100627d0
// FUNCTION: BETA10 0x1004389d
void LegoAnimationManager::FUN_100627d0(MxBool p_und)
{
// TODO
ViewManager* viewManager = GetViewManager();
if (p_und || viewManager != NULL) {
MxLong time = Timer()->GetTime();
for (MxS32 i = 0; i < (MxS32) _countof(m_unk0x3c); i++) {
LegoROI* roi = m_unk0x3c[i].m_roi;
if (roi != NULL) {
MxU16 prefix = *(MxU16*) roi->GetName();
MxLong und = ((m_numAllowedExtras - 2) * 280000 / 18) + 20000;
MxBool maOrPa = prefix == TWOCC('m', 'a') || prefix == TWOCC('p', 'a');
if ((p_und && !maOrPa) ||
(g_characters[m_unk0x3c[i].m_characterId].m_unk0x10 >= 0 && time - m_unk0x3c[i].m_unk0x08 > und &&
CharacterManager()->GetRefCount(roi) == 1 &&
!viewManager->FUN_100a6150(roi->GetWorldBoundingBox()))) {
m_unk0x414--;
LegoPathActor* actor = CharacterManager()->GetActor(roi->GetName());
if (actor != NULL && actor->GetController() != NULL) {
actor->GetController()->FUN_10046770(actor);
actor->ClearController();
}
CharacterManager()->FUN_10083db0(roi);
if (m_unk0x3c[i].m_unk0x14) {
m_unk0x3c[i].m_unk0x14 = FALSE;
MxS32 vehicleId = g_characters[m_unk0x3c[i].m_characterId].m_vehicleId;
if (vehicleId >= 0) {
g_vehicles[vehicleId].m_unk0x05 = FALSE;
LegoROI* roi = Lego()->FindROI(g_vehicles[vehicleId].m_name);
if (roi != NULL) {
roi->SetVisibility(FALSE);
}
}
}
m_unk0x3c[i].m_roi = NULL;
g_characters[m_unk0x3c[i].m_characterId].m_unk0x04 = FALSE;
g_characters[m_unk0x3c[i].m_characterId].m_unk0x07 = FALSE;
m_unk0x3c[i].m_characterId = -1;
}
}
}
}
}
// STUB: LEGO1 0x100629b0