Merge branch 'replace-si' of github.com:foxtacles/isle-portable into replace-si

This commit is contained in:
Christian Semmler 2025-08-12 20:12:05 -07:00
commit d81d62a8b6
No known key found for this signature in database
GPG Key ID: 086DAA1360BEEE5C
2 changed files with 30 additions and 4 deletions

View File

@ -120,6 +120,15 @@ void MxBackgroundAudioManager::FadeInPendingPresenter()
if (m_activePresenter == NULL) {
if (m_pendingPresenter) {
if (m_pendingPresenter->GetCurrentTickleState() <= MxPresenter::e_starting) {
return;
}
if (!m_pendingPresenter->IsEnabled()) {
m_pendingPresenter->Enable(TRUE);
m_pendingPresenter->SetTickleState(MxPresenter::e_streaming);
}
if (m_volumeSuppressionAmount != 0) {
compare = 30;
}
@ -221,6 +230,7 @@ void MxBackgroundAudioManager::StartAction(MxParam& p_param)
m_action2.SetObjectId(m_pendingPresenter->GetAction()->GetObjectId());
m_targetVolume = ((MxDSSound*) (m_pendingPresenter->GetAction()))->GetVolume();
m_pendingPresenter->SetVolume(0);
m_pendingPresenter->GetAction()->SetFlags(m_pendingPresenter->GetAction()->GetFlags() & ~MxDSAction::c_enabled);
}
// FUNCTION: LEGO1 0x1007f200
@ -254,7 +264,8 @@ MxResult MxBackgroundAudioManager::PlayMusic(
return SUCCESS;
}
if (m_action2.GetObjectId() == -1 && m_action1.GetObjectId() != p_action.GetObjectId()) {
if (m_action2.GetObjectId() == -1 &&
(m_action1.GetObjectId() != p_action.GetObjectId() || m_action1.GetAtomId() != p_action.GetAtomId())) {
MxDSAction action;
action.SetAtomId(GetCurrentAction().GetAtomId());
action.SetObjectId(GetCurrentAction().GetObjectId());

View File

@ -57,6 +57,8 @@ std::optional<MxResult> SiLoader::HandleStart(MxDSAction& p_action)
action.SetAtomId(key.second.first);
action.SetObjectId(key.second.second);
action.SetUnknown24(p_action.GetUnknown24());
action.SetNotificationObject(p_action.GetNotificationObject());
action.SetOrigin(p_action.GetOrigin());
Start(&action);
}
}
@ -67,7 +69,12 @@ std::optional<MxResult> SiLoader::HandleStart(MxDSAction& p_action)
action.SetAtomId(key.second.first);
action.SetObjectId(key.second.second);
action.SetUnknown24(p_action.GetUnknown24());
return Start(&action);
action.SetNotificationObject(p_action.GetNotificationObject());
action.SetOrigin(p_action.GetOrigin());
MxResult result = Start(&action);
p_action.SetUnknown24(action.GetUnknown24());
return result;
}
}
@ -101,6 +108,8 @@ std::optional<MxBool> SiLoader::HandleDelete(MxDSAction& p_action)
action.SetAtomId(key.second.first);
action.SetObjectId(key.second.second);
action.SetUnknown24(p_action.GetUnknown24());
action.SetNotificationObject(p_action.GetNotificationObject());
action.SetOrigin(p_action.GetOrigin());
DeleteObject(action);
}
}
@ -111,7 +120,11 @@ std::optional<MxBool> SiLoader::HandleDelete(MxDSAction& p_action)
action.SetAtomId(key.second.first);
action.SetObjectId(key.second.second);
action.SetUnknown24(p_action.GetUnknown24());
action.SetNotificationObject(p_action.GetNotificationObject());
action.SetOrigin(p_action.GetOrigin());
DeleteObject(action);
p_action.SetUnknown24(action.GetUnknown24());
return TRUE;
}
}
@ -147,6 +160,8 @@ bool SiLoader::LoadFile(const char* p_file)
void SiLoader::ParseDirectives(const MxAtomId& p_atom, si::Core* p_core, MxAtomId p_parentReplacedAtom)
{
for (si::Core* child : p_core->GetChildren()) {
MxAtomId replacedAtom = p_parentReplacedAtom;
if (si::Object* object = dynamic_cast<si::Object*>(child)) {
if (object->type() != si::MxOb::Null) {
std::string extra(object->extra_.data(), object->extra_.size());
@ -185,13 +200,13 @@ void SiLoader::ParseDirectives(const MxAtomId& p_atom, si::Core* p_core, MxAtomI
StreamObject{MxAtomId{atom, e_lowerCase2}, id},
StreamObject{p_atom, object->id_}
);
p_parentReplacedAtom = replace.back().first.first;
replacedAtom = replace.back().first.first;
}
}
}
}
}
ParseDirectives(p_atom, child, p_parentReplacedAtom);
ParseDirectives(p_atom, child, replacedAtom);
}
}