match MxBackgroundAudioManager::Notify

This commit is contained in:
Misha 2023-11-04 20:29:29 -04:00
parent 09f7be4565
commit 65c42bf0f4
No known key found for this signature in database
GPG Key ID: 8441D12AEF33FED8

View File

@ -140,16 +140,15 @@ void MxBackgroundAudioManager::DestroyMusic()
// OFFSET: LEGO1 0x1007f170 // OFFSET: LEGO1 0x1007f170
MxResult MxBackgroundAudioManager::Notify(MxParam& p) MxResult MxBackgroundAudioManager::Notify(MxParam& p)
{ {
if (((MxNotificationParam&) p).GetNotification() == c_notificationStartAction) { switch (((MxNotificationParam&) p).GetNotification()) {
case c_notificationStartAction:
StartAction(p); StartAction(p);
return 1; return 1;
case c_notificationEndAction:
StopAction(p);
return 1;
} }
return 0;
if (((MxNotificationParam&) p).GetNotification() != c_notificationEndAction) {
return 0;
}
StopAction(p);
return 1;
} }
// Matches but register allocation is is different. // Matches but register allocation is is different.
@ -186,12 +185,10 @@ void MxBackgroundAudioManager::StopAction(MxParam& p)
// OFFSET: LEGO1 0x1007f2f0 // OFFSET: LEGO1 0x1007f2f0
MxResult MxBackgroundAudioManager::PlayMusic(MxDSAction& p_action, undefined4 p_unknown, undefined4 p_unknown2) MxResult MxBackgroundAudioManager::PlayMusic(MxDSAction& p_action, undefined4 p_unknown, undefined4 p_unknown2)
{ {
if (!m_musicEnabled) if (!m_musicEnabled) {
{
return SUCCESS; return SUCCESS;
} }
if (m_action2.GetObjectId() == -1 && m_action1.GetObjectId() != p_action.GetObjectId()) if (m_action2.GetObjectId() == -1 && m_action1.GetObjectId() != p_action.GetObjectId()) {
{
MxDSAction action; MxDSAction action;
action.SetAtomId(GetCurrentAction().GetAtomId()); action.SetAtomId(GetCurrentAction().GetAtomId());
action.SetObjectId(GetCurrentAction().GetObjectId()); action.SetObjectId(GetCurrentAction().GetObjectId());
@ -208,8 +205,7 @@ MxResult MxBackgroundAudioManager::PlayMusic(MxDSAction& p_action, undefined4 p_
GetCurrentAction().SetObjectId(action.GetObjectId()); GetCurrentAction().SetObjectId(action.GetObjectId());
GetCurrentAction().SetUnknown24(action.GetUnknown24()); GetCurrentAction().SetUnknown24(action.GetUnknown24());
if (result == SUCCESS) if (result == SUCCESS) {
{
m_unk13c = p_unknown2; m_unk13c = p_unknown2;
m_unk140 = p_unknown; m_unk140 = p_unknown;
} }