Implement/match LegoControlManager::FUN_100293c0 (#970)

This commit is contained in:
Christian Semmler 2024-05-30 09:15:16 -04:00 committed by GitHub
parent 689178f689
commit ae859fbc19
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 33 additions and 12 deletions

View File

@ -63,7 +63,7 @@ public:
void Register(MxCore* p_listener);
void Unregister(MxCore* p_listener);
MxBool FUN_10029210(LegoEventNotificationParam& p_param, MxPresenter* p_presenter);
void FUN_100293c0(undefined4, const char*, undefined2);
void FUN_100293c0(MxU32 p_objectId, const char* p_atom, MxS16 p_unk0x4e);
MxControlPresenter* FUN_100294e0(MxS32 p_x, MxS32 p_y);
MxBool FUN_10029630();
MxBool FUN_10029750();

View File

@ -37,11 +37,13 @@ public:
void Enable(MxBool p_enable) override; // vtable+0x54
MxBool VTable0x64(undefined4 p_undefined) override; // vtable+0x64
virtual void VTable0x68(MxBool p_unk0x50); // vtable+0x68
virtual void VTable0x6c(MxS16); // vtable+0x6c
virtual void VTable0x6c(MxS16 p_unk0x4e); // vtable+0x6c
MxBool FUN_10044480(LegoControlManagerEvent* p_event, MxPresenter* p_presenter);
MxBool FUN_10044270(MxS32 p_x, MxS32 p_y, MxVideoPresenter* p_presenter);
inline MxS16 GetUnknown0x4e() { return m_unk0x4e; }
private:
undefined2 m_unk0x4c; // 0x4c
MxS16 m_unk0x4e; // 0x4e

View File

@ -206,9 +206,9 @@ MxBool MxControlPresenter::FUN_10044480(LegoControlManagerEvent* p_event, MxPres
}
// FUNCTION: LEGO1 0x10044540
void MxControlPresenter::VTable0x6c(MxS16 p_val)
void MxControlPresenter::VTable0x6c(MxS16 p_unk0x4e)
{
if (p_val == -1) {
if (p_unk0x4e == -1) {
if ((MxS16) ((MxDSMultiAction*) m_action)->GetActionList()->GetCount() - m_unk0x4e == 1) {
m_unk0x4e = 0;
}
@ -217,7 +217,7 @@ void MxControlPresenter::VTable0x6c(MxS16 p_val)
}
}
else {
m_unk0x4e = p_val;
m_unk0x4e = p_unk0x4e;
}
m_action->SetUnknown90(Timer()->GetTime());

View File

@ -116,9 +116,27 @@ void LegoControlManager::FUN_100292e0()
}
}
// STUB: LEGO1 0x100293c0
void LegoControlManager::FUN_100293c0(undefined4, const char*, undefined2)
// FUNCTION: LEGO1 0x100293c0
void LegoControlManager::FUN_100293c0(MxU32 p_objectId, const char* p_atom, MxS16 p_unk0x4e)
{
if (m_presenterList) {
MxPresenterListCursor cursor(m_presenterList);
MxPresenter* control;
while (cursor.Next(control)) {
MxDSAction* action = control->GetAction();
if (action->GetObjectId() == p_objectId && action->GetAtomId().GetInternal() == p_atom) {
((MxControlPresenter*) control)->VTable0x6c(p_unk0x4e);
if (((MxControlPresenter*) control)->GetUnknown0x4e() == 0) {
g_unk0x100f31b0 = -1;
g_unk0x100f31b4 = NULL;
break;
}
}
}
}
}
// FUNCTION: LEGO1 0x100294e0

View File

@ -246,7 +246,7 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
}
if (action->GetObjectId() == InfomainScript::c_iicx26in_RunAnim) {
ControlManager()->FUN_100293c0(0x10, action->GetAtomId().GetInternal(), 0);
ControlManager()->FUN_100293c0(InfomainScript::c_BigInfo_Ctl, action->GetAtomId().GetInternal(), 0);
m_unk0x1d6 = 0;
}
@ -1159,16 +1159,16 @@ MxResult Infocenter::Tickle()
m_unk0x1d6 += 100;
if (m_unk0x1d6 > 3400 && m_unk0x1d6 < 3650) {
ControlManager()->FUN_100293c0(0x10, m_atom.GetInternal(), 1);
ControlManager()->FUN_100293c0(InfomainScript::c_BigInfo_Ctl, m_atom.GetInternal(), 1);
}
else if (m_unk0x1d6 > 3650 && m_unk0x1d6 < 3900) {
ControlManager()->FUN_100293c0(0x10, m_atom.GetInternal(), 0);
ControlManager()->FUN_100293c0(InfomainScript::c_BigInfo_Ctl, m_atom.GetInternal(), 0);
}
else if (m_unk0x1d6 > 3900 && m_unk0x1d6 < 4150) {
ControlManager()->FUN_100293c0(0x10, m_atom.GetInternal(), 1);
ControlManager()->FUN_100293c0(InfomainScript::c_BigInfo_Ctl, m_atom.GetInternal(), 1);
}
else if (m_unk0x1d6 > 4400) {
ControlManager()->FUN_100293c0(0x10, m_atom.GetInternal(), 0);
ControlManager()->FUN_100293c0(InfomainScript::c_BigInfo_Ctl, m_atom.GetInternal(), 0);
m_unk0x1d6 = 0;
}
}

View File

@ -62,6 +62,7 @@ public:
// FUNCTION: BETA10 0x1012efb0
inline const char* GetSourceName() const { return m_sourceName; }
inline const char* GetObjectName() const { return m_objectName; }
inline MxU32 GetObjectId() { return m_objectId; }
inline const MxAtomId& GetAtomId() { return m_atomId; }