Implement/match MxMediaManager::StopPresenters

This commit is contained in:
Christian Semmler 2023-09-14 11:49:44 -04:00
parent 9e8f8b0f60
commit 68ac78ae03
2 changed files with 19 additions and 3 deletions

View File

@ -101,6 +101,18 @@ class MxListCursor : public MxCore
m_list->m_count--;
m_match = NULL;
}
MxBool Next(T*& p_obj) {
if (!m_match)
m_match = m_list->m_first;
else
m_match = m_match->m_next;
if (m_match)
p_obj = m_match->m_obj;
return m_match != NULL;
}
private:
MxList<T> *m_list;
MxListEntry<T> *m_match;

View File

@ -1,5 +1,6 @@
#include "mxmediamanager.h"
#include "mxautolocker.h"
#include "mxpresenter.h"
#include "decomp.h"
DECOMP_SIZE_ASSERT(MxMediaManager, 0x2c);
@ -76,10 +77,13 @@ void MxMediaManager::RemovePresenter(MxPresenter &p_presenter)
cursor.Detach();
}
// OFFSET: LEGO1 0x100b8ac0 STUB
// OFFSET: LEGO1 0x100b8ac0
void MxMediaManager::StopPresenters()
{
MxAutoLocker lock(&this->m_criticalSection);
// Call EndAction on all presenters in list
MxPresenter *presenter;
MxPresenterListCursor cursor(this->m_presenters);
while (cursor.Next(presenter))
presenter->EndAction();
}