Implement LegoAnimationManager::FUN_10061010 (#888)

This commit is contained in:
Christian Semmler 2024-05-07 15:59:46 -04:00 committed by GitHub
parent 4b386fe738
commit 05edf96186
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 93 additions and 16 deletions

View file

@ -95,7 +95,7 @@ class LegoAnimationManager : public MxCore {
MxBool p_param8,
MxBool p_param9
);
void FUN_10061010(undefined4);
void FUN_10061010(MxBool p_und);
void FUN_100617c0(MxS32, MxU16&, MxU16&);
LegoTranInfo* GetTranInfo(MxU32 p_index);
void FUN_10062770();

View file

@ -55,7 +55,11 @@ class LegoAnimMMPresenter : public MxCompositePresenter {
// SYNTHETIC: LEGO1 0x1004aa40
// LegoAnimMMPresenter::`scalar deleting destructor'
void FUN_1004b840();
MxBool FUN_1004b8b0();
void FUN_1004b8c0();
inline LegoAnimPresenter* GetPresenter() { return m_presenter; }
private:
MxBool FUN_1004b450();

View file

@ -83,7 +83,7 @@ void IslePathActor::VTable0xe0()
}
}
AnimationManager()->FUN_10061010(0);
AnimationManager()->FUN_10061010(FALSE);
if (!m_cameraFlag) {
ResetWorldTransform(TRUE);
SetUserNavFlag(TRUE);

View file

@ -1,8 +1,11 @@
#include "legoanimationmanager.h"
#include "anim/legoanim.h"
#include "animstate.h"
#include "define.h"
#include "islepathactor.h"
#include "legoanimmmpresenter.h"
#include "legoanimpresenter.h"
#include "legocharactermanager.h"
#include "legoendanimnotificationparam.h"
#include "legoextraactor.h"
@ -130,7 +133,7 @@ LegoAnimationManager::~LegoAnimationManager()
{
TickleManager()->UnregisterClient(this);
FUN_10061010(0);
FUN_10061010(FALSE);
for (MxS32 i = 0; i < (MxS32) _countof(m_unk0x3c); i++) {
LegoROI* roi = m_unk0x3c[i].m_roi;
@ -215,7 +218,7 @@ void LegoAnimationManager::Suspend()
m_unk0x42a = m_unk0x402;
m_unk0x402 = FALSE;
FUN_10061010(0);
FUN_10061010(FALSE);
MxS32 i;
for (i = 0; i < (MxS32) _countof(m_unk0x3c); i++) {
@ -919,17 +922,75 @@ MxResult LegoAnimationManager::FUN_10060dc0(
}
}
if (!found && p_param3 != 0) {
if (!found && p_param3 != FALSE) {
result = FUN_100609f0(p_objectId, p_matrix, p_param7, p_param8);
}
return result;
}
// STUB: LEGO1 0x10061010
void LegoAnimationManager::FUN_10061010(undefined4)
// FUNCTION: LEGO1 0x10061010
// FUNCTION: BETA10 0x100422cc
void LegoAnimationManager::FUN_10061010(MxBool p_und)
{
// TODO
MxBool unk0x39 = FALSE;
FUN_10064b50(-1);
if (m_tranInfoList != NULL) {
LegoTranInfoListCursor cursor(m_tranInfoList);
LegoTranInfo* tranInfo;
while (cursor.Next(tranInfo)) {
if (tranInfo->m_presenter != NULL) {
// TODO: Match
MxU32 flags = tranInfo->m_flags;
if (tranInfo->m_unk0x14 && tranInfo->m_unk0x12 != -1 && p_und) {
LegoAnim* anim;
if (tranInfo->m_presenter->GetPresenter() != NULL &&
(anim = tranInfo->m_presenter->GetPresenter()->GetAnimation()) != NULL &&
anim->GetScene() != NULL) {
if (flags & LegoTranInfo::c_bit2) {
BackgroundAudioManager()->RaiseVolume();
tranInfo->m_flags &= ~LegoTranInfo::c_bit2;
}
tranInfo->m_presenter->FUN_1004b840();
tranInfo->m_unk0x14 = FALSE;
}
else {
tranInfo->m_presenter->FUN_1004b8c0();
tranInfo->m_unk0x14 = FALSE;
unk0x39 = TRUE;
}
}
else {
if (flags & LegoTranInfo::c_bit2) {
BackgroundAudioManager()->RaiseVolume();
tranInfo->m_flags &= ~LegoTranInfo::c_bit2;
}
tranInfo->m_presenter->FUN_1004b840();
}
}
else {
if (m_tranInfoList2 != NULL) {
LegoTranInfoListCursor cursor(m_tranInfoList2);
if (!cursor.Find(tranInfo)) {
m_tranInfoList2->Append(tranInfo);
}
}
unk0x39 = TRUE;
}
}
}
m_unk0x39 = unk0x39;
m_unk0x404 = Timer()->GetTime();
}
// STUB: LEGO1 0x10061530

View file

@ -465,9 +465,21 @@ MxBool LegoAnimMMPresenter::FUN_1004b6d0(MxLong p_time)
return TRUE;
}
// STUB: LEGO1 0x1004b840
void LegoAnimMMPresenter::FUN_1004b840()
{
// TODO
}
// FUNCTION: LEGO1 0x1004b8b0
// FUNCTION: BETA10 0x1004d104
MxBool LegoAnimMMPresenter::FUN_1004b8b0()
{
return m_tranInfo != NULL ? m_tranInfo->m_unk0x28 : TRUE;
}
// STUB: LEGO1 0x1004b8c0
void LegoAnimMMPresenter::FUN_1004b8c0()
{
// TODO
}

View file

@ -622,7 +622,7 @@ MxLong LegoNavController::Notify(MxParam& p_param)
break;
}
case VK_SPACE:
AnimationManager()->FUN_10061010(1);
AnimationManager()->FUN_10061010(TRUE);
break;
case 'Z':
// TODO

View file

@ -618,7 +618,7 @@ void LegoWorld::Enable(MxBool p_enable)
if (p_enable && !m_set0xd0.empty()) {
if (CurrentWorld() != this) {
if (CurrentWorld()) {
AnimationManager()->FUN_10061010(0);
AnimationManager()->FUN_10061010(FALSE);
CurrentWorld()->Enable(FALSE);
LegoEntityListCursor cursor(m_entityList);

View file

@ -30,7 +30,7 @@ MxLong GasStationEntity::VTable0x50(MxParam& p_param)
Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle);
isle->SetDestLocation(LegoGameState::Area::e_garage);
AnimationManager()->FUN_10061010(0);
AnimationManager()->FUN_10061010(FALSE);
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
}
}

View file

@ -30,7 +30,7 @@ MxLong HospitalEntity::VTable0x50(MxParam& p_param)
Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle);
isle->SetDestLocation(LegoGameState::Area::e_hospital);
AnimationManager()->FUN_10061010(0);
AnimationManager()->FUN_10061010(FALSE);
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
}
}

View file

@ -53,7 +53,7 @@ MxLong InfoCenterEntity::VTable0x50(MxParam& p_param)
break;
}
AnimationManager()->FUN_10061010(0);
AnimationManager()->FUN_10061010(FALSE);
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
return 1;

View file

@ -28,7 +28,7 @@ MxLong BeachHouseEntity::VTable0x50(MxParam& p_param)
Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle);
isle->SetDestLocation(LegoGameState::Area::e_jetskibuild);
AnimationManager()->FUN_10061010(0);
AnimationManager()->FUN_10061010(FALSE);
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
}

View file

@ -30,7 +30,7 @@ MxLong PoliceEntity::VTable0x50(MxParam& p_param)
Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle);
isle->SetDestLocation(LegoGameState::Area::e_police);
AnimationManager()->FUN_10061010(0);
AnimationManager()->FUN_10061010(FALSE);
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
}
}

View file

@ -28,7 +28,7 @@ MxLong RaceStandsEntity::VTable0x50(MxParam& p_param)
Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle);
isle->SetDestLocation(LegoGameState::Area::e_racecarbuild);
AnimationManager()->FUN_10061010(0);
AnimationManager()->FUN_10061010(FALSE);
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
}