MxOmni::HandleActionEnd

This commit is contained in:
Misha 2023-12-16 12:27:15 -05:00
parent dcbabb8f3a
commit 08f578b79f
No known key found for this signature in database
GPG Key ID: 8441D12AEF33FED8
6 changed files with 61 additions and 10 deletions

View File

@ -226,7 +226,7 @@ void MxBackgroundAudioManager::StopAction(MxParam& p_param)
m_action2.SetObjectId(-1);
}
Lego()->HandleNotificationType2(p_param);
Lego()->HandleActionEnd(p_param);
}
// FUNCTION: LEGO1 0x1007f2f0

View File

@ -312,11 +312,15 @@ MxResult MxOmni::Start(MxDSAction* p_dsAction)
return result;
}
// STUB: LEGO1 0x100b00c0
// FUNCTION: LEGO1 0x100b00c0
MxResult MxOmni::DeleteObject(MxDSAction& p_dsAction)
{
// TODO
return FAILURE;
MxResult result;
if (m_streamer != NULL) {
result = m_streamer->DeleteObject(&p_dsAction);
}
return result;
}
// FUNCTION: LEGO1 0x100b00e0
@ -375,6 +379,12 @@ void MxOmni::DestroyInstance()
}
}
MxBool MxOmni::FUN_100b06b0(MxDSAction* p_action)
{
// TODO STUB
return FAILURE;
}
// FUNCTION: LEGO1 0x100b07f0
MxLong MxOmni::Notify(MxParam& p_param)
{
@ -383,14 +393,31 @@ MxLong MxOmni::Notify(MxParam& p_param)
if (((MxNotificationParam&) p_param).GetNotification() != c_notificationEndAction)
return 0;
return HandleNotificationType2(p_param);
return HandleActionEnd(p_param);
}
// STUB: LEGO1 0x100b0880
MxResult MxOmni::HandleNotificationType2(MxParam& p_param)
// FUNCTION: LEGO1 0x100b0880
MxLong MxOmni::HandleActionEnd(MxParam& p_param)
{
// TODO STUB
return FAILURE;
MxDSAction* action = ((MxEndActionNotificationParam&) p_param).GetAction();
MxStreamController* controller = Streamer()->GetOpenStream(action->GetAtomId().GetInternal());
if (controller != NULL) {
if (controller->GetUnk0x54().Find(action, FALSE)) {
if (FUN_100b06b0(action) == FALSE) {
delete controller->GetUnk0x54().Find(action, TRUE);
}
}
}
if (((MxEndActionNotificationParam&) p_param).GetSender()) {
delete ((MxEndActionNotificationParam&) p_param).GetSender();
}
if (((MxEndActionNotificationParam&) p_param).GetAction())
{
delete ((MxEndActionNotificationParam&) p_param).GetAction();
}
return 1;
}
// FUNCTION: LEGO1 0x100b0900

View File

@ -54,6 +54,7 @@ class MxOmni : public MxCore {
virtual void StopTimer(); // vtable+3c
virtual MxBool IsTimerRunning(); // vtable+40
static void SetInstance(MxOmni* p_instance);
static MxBool FUN_100b06b0(MxDSAction* p_action);
HWND GetWindowHandle() const { return this->m_windowHandle; }
MxObjectFactory* GetObjectFactory() const { return this->m_objectFactory; }
MxNotificationManager* GetNotificationManager() const { return this->m_notificationManager; }
@ -66,7 +67,7 @@ class MxOmni : public MxCore {
MxMusicManager* GetMusicManager() const { return this->m_musicManager; }
MxEventManager* GetEventManager() const { return this->m_eventManager; }
MxAtomIdCounterSet* GetAtomIdCounterSet() const { return this->m_atomIdCounterSet; }
MxResult HandleNotificationType2(MxParam& p_param);
MxLong HandleActionEnd(MxParam& p_param);
protected:
static MxOmni* g_instance;

View File

@ -48,6 +48,7 @@ class MxStreamController : public MxCore {
MxResult FUN_100c1f00(MxDSAction* p_action);
inline MxAtomId& GetAtom() { return m_atom; };
inline MxStreamListMxDSAction& GetUnk0x54() { return m_unk0x54; };
protected:
MxCriticalSection m_criticalSection; // 0x8

View File

@ -143,6 +143,27 @@ MxResult MxStreamer::FUN_100b99b0(MxDSAction* p_action)
return FAILURE;
}
// STUB: LEGO1 0x100b99f0
MxResult MxStreamer::DeleteObject(MxDSAction* p_dsAction)
{
MxDSAction tempAction;
if (p_dsAction == NULL)
{
tempAction.SetUnknown24(-2);
}
else
{
tempAction.SetObjectId(p_dsAction->GetObjectId());
tempAction.SetAtomId(p_dsAction->GetAtomId());
tempAction.SetUnknown24(p_dsAction->GetUnknown24());
}
// TODO: remove action from list
return -1;
}
// FUNCTION: LEGO1 0x100b9b30
MxBool MxStreamer::FUN_100b9b30(MxDSObject& p_dsObject)
{

View File

@ -94,6 +94,7 @@ class MxStreamer : public MxCore {
MxStreamController* GetOpenStream(const char* p_name);
MxResult AddStreamControllerToOpenList(MxStreamController* p_stream);
MxResult FUN_100b99b0(MxDSAction* p_action);
MxResult DeleteObject(MxDSAction* p_dsAction);
inline const MxStreamerSubClass2& GetSubclass1() { return m_subclass1; }
inline const MxStreamerSubClass3& GetSubclass2() { return m_subclass2; }