Implement/match LegoAnimationManager::FUN_10063d10 (#927)

This commit is contained in:
Christian Semmler 2024-05-17 10:20:04 -04:00 committed by GitHub
parent 02c4aad33e
commit ed782980ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 40 additions and 4 deletions

View file

@ -32,7 +32,7 @@ class LegoAnimationManager : public MxCore {
MxBool m_unk0x07; // 0x07
MxBool m_unk0x08; // 0x08
MxBool m_unk0x09; // 0x09
MxU32 m_unk0x0c; // 0x0c
MxS32 m_unk0x0c; // 0x0c
MxS32 m_unk0x10; // 0x10
MxBool m_active; // 0x14
MxU8 m_unk0x15; // 0x15
@ -51,7 +51,7 @@ class LegoAnimationManager : public MxCore {
LegoROI* m_roi; // 0x00
MxS32 m_characterId; // 0x04
MxLong m_unk0x08; // 0x08
undefined m_unk0x0c; // 0x0c
MxBool m_unk0x0c; // 0x0c
MxBool m_unk0x0d; // 0x0d
float m_unk0x10; // 0x10
MxBool m_unk0x14; // 0x14

View file

@ -1824,11 +1824,47 @@ MxBool LegoAnimationManager::FUN_10063b90(
return TRUE;
}
// STUB: LEGO1 0x10063d10
// FUNCTION: LEGO1 0x10063d10
// FUNCTION: BETA10 0x10045034
void LegoAnimationManager::FUN_10063d10()
{
// TODO
if (CurrentWorld() != NULL) {
MxLong time = Timer()->GetTime();
for (MxS32 i = 0; i < (MxS32) sizeOfArray(m_extras); i++) {
LegoROI* roi = m_extras[i].m_roi;
if (roi != NULL) {
if (m_extras[i].m_unk0x0c && g_characters[m_extras[i].m_characterId].m_unk0x0c >= 0 &&
g_characters[m_extras[i].m_characterId].m_unk0x0c < time - m_extras[i].m_unk0x08) {
m_extras[i].m_unk0x0c = FALSE;
LegoExtraActor* actor = CharacterManager()->GetActor(roi->GetName());
if (actor != NULL) {
float speed = m_extras[i].m_unk0x10;
if (speed < 0.0f) {
if (m_extras[i].m_unk0x14) {
speed = ((float) (rand() * 1.5) / 32767.0f) + 0.9;
}
else {
speed = ((float) (rand() * 1.4) / 32767.0f) + 0.6;
}
}
actor->SetWorldSpeed(speed);
}
}
else {
LegoExtraActor* actor = CharacterManager()->GetActor(roi->GetName());
if (actor != NULL) {
actor->Restart();
}
}
}
}
}
}
// STUB: LEGO1 0x10063fb0