2023-06-19 01:36:07 -04:00
|
|
|
#include "mxomni.h"
|
|
|
|
|
2023-12-16 13:14:01 -05:00
|
|
|
#include "mxactionnotificationparam.h"
|
2023-10-07 11:30:04 -04:00
|
|
|
#include "mxatomidcounter.h"
|
2023-10-24 19:38:27 -04:00
|
|
|
#include "mxautolocker.h"
|
2023-10-07 11:30:04 -04:00
|
|
|
#include "mxeventmanager.h"
|
2023-10-07 13:12:59 -04:00
|
|
|
#include "mxmusicmanager.h"
|
2023-10-07 11:30:04 -04:00
|
|
|
#include "mxnotificationmanager.h"
|
|
|
|
#include "mxobjectfactory.h"
|
|
|
|
#include "mxomnicreateparam.h"
|
2023-12-16 13:14:01 -05:00
|
|
|
#include "mxpresenter.h"
|
2023-10-07 11:30:04 -04:00
|
|
|
#include "mxsoundmanager.h"
|
|
|
|
#include "mxstreamer.h"
|
|
|
|
#include "mxticklemanager.h"
|
|
|
|
#include "mxtimer.h"
|
|
|
|
#include "mxvideomanager.h"
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// GLOBAL: LEGO1 0x101015b8
|
2023-06-30 14:34:39 -04:00
|
|
|
char g_hdPath[1024];
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// GLOBAL: LEGO1 0x101019b8
|
2023-06-30 14:34:39 -04:00
|
|
|
char g_cdPath[1024];
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// GLOBAL: LEGO1 0x10101db8
|
2023-06-30 14:34:39 -04:00
|
|
|
MxBool g_use3dSound;
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// GLOBAL: LEGO1 0x101015b0
|
2023-10-24 19:38:27 -04:00
|
|
|
MxOmni* MxOmni::g_instance = NULL;
|
2023-06-19 01:36:07 -04:00
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100159e0
|
2023-11-21 03:44:45 -05:00
|
|
|
void DeleteObjects(MxAtomId* p_id, MxS32 p_first, MxS32 p_last)
|
2023-06-19 02:19:40 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
MxDSAction action;
|
2023-06-19 02:19:40 -04:00
|
|
|
|
2023-11-21 03:44:45 -05:00
|
|
|
action.SetAtomId(*p_id);
|
|
|
|
action.SetUnknown24(-2);
|
|
|
|
|
2023-12-13 05:48:14 -05:00
|
|
|
for (MxS32 first = p_first, last = p_last; first <= last; first++) {
|
|
|
|
action.SetObjectId(first);
|
2023-11-21 03:44:45 -05:00
|
|
|
DeleteObject(action);
|
|
|
|
}
|
2023-06-19 02:19:40 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x10058a90
|
2023-11-21 03:44:45 -05:00
|
|
|
MxBool MxOmni::IsTimerRunning()
|
2023-06-19 02:19:40 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
return m_timerRunning;
|
2023-06-19 02:19:40 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100acea0
|
2023-11-21 03:44:45 -05:00
|
|
|
MxObjectFactory* ObjectFactory()
|
2023-09-13 03:44:03 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
return MxOmni::GetInstance()->GetObjectFactory();
|
2023-09-13 03:44:03 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100aceb0
|
2023-11-21 03:44:45 -05:00
|
|
|
MxNotificationManager* NotificationManager()
|
2023-09-13 03:44:03 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
return MxOmni::GetInstance()->GetNotificationManager();
|
2023-09-13 03:44:03 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100acec0
|
2023-11-21 03:44:45 -05:00
|
|
|
MxTickleManager* TickleManager()
|
2023-09-13 03:44:03 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
return MxOmni::GetInstance()->GetTickleManager();
|
2023-09-13 03:44:03 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100aced0
|
2023-11-21 03:44:45 -05:00
|
|
|
MxTimer* Timer()
|
2023-09-13 03:44:03 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
return MxOmni::GetInstance()->GetTimer();
|
2023-09-13 03:44:03 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100acee0
|
2023-11-21 03:44:45 -05:00
|
|
|
MxAtomIdCounterSet* AtomIdCounterSet()
|
2023-09-13 03:44:03 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
return MxOmni::GetInstance()->GetAtomIdCounterSet();
|
2023-09-13 03:44:03 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100acef0
|
2023-11-21 03:44:45 -05:00
|
|
|
MxStreamer* Streamer()
|
2023-09-13 03:44:03 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
return MxOmni::GetInstance()->GetStreamer();
|
2023-09-13 03:44:03 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100acf00
|
2023-11-21 03:44:45 -05:00
|
|
|
MxSoundManager* MSoundManager()
|
2023-09-13 03:44:03 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
return MxOmni::GetInstance()->GetSoundManager();
|
2023-09-13 03:44:03 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100acf10
|
2023-11-21 03:44:45 -05:00
|
|
|
MxVideoManager* MVideoManager()
|
2023-09-13 03:44:03 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
return MxOmni::GetInstance()->GetVideoManager();
|
2023-09-13 03:44:03 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100acf20
|
2023-11-21 03:44:45 -05:00
|
|
|
MxVariableTable* VariableTable()
|
2023-10-09 06:31:36 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
return MxOmni::GetInstance()->GetVariableTable();
|
2023-10-09 06:31:36 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100acf30
|
2023-11-21 03:44:45 -05:00
|
|
|
MxMusicManager* MusicManager()
|
2023-06-29 13:02:47 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
return MxOmni::GetInstance()->GetMusicManager();
|
2023-06-29 13:02:47 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100acf40
|
2023-11-21 03:44:45 -05:00
|
|
|
MxEventManager* EventManager()
|
2023-06-30 14:34:39 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
return MxOmni::GetInstance()->GetEventManager();
|
2023-06-30 14:34:39 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100acf70
|
2023-12-16 13:14:01 -05:00
|
|
|
void DeleteObject(MxDSAction& p_dsAction)
|
2023-06-30 14:34:39 -04:00
|
|
|
{
|
2023-12-16 13:14:01 -05:00
|
|
|
MxOmni::GetInstance()->DeleteObject(p_dsAction);
|
2023-06-30 14:34:39 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100aef10
|
2023-11-21 03:44:45 -05:00
|
|
|
MxOmni::MxOmni()
|
2023-06-30 14:34:39 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
Init();
|
2023-06-30 14:34:39 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100aefb0
|
2023-11-21 03:44:45 -05:00
|
|
|
MxEntity* MxOmni::FindWorld(const char*, MxS32, MxPresenter*)
|
2023-06-30 14:34:39 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
return NULL;
|
2023-06-30 14:34:39 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100aefc0
|
2023-11-21 03:44:45 -05:00
|
|
|
void MxOmni::NotifyCurrentEntity(MxNotificationParam* p_param)
|
2023-06-30 14:34:39 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100aeff0
|
2023-11-21 03:44:45 -05:00
|
|
|
MxOmni::~MxOmni()
|
2023-06-30 14:34:39 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
Destroy();
|
2023-06-30 14:34:39 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100af080
|
2023-11-21 03:44:45 -05:00
|
|
|
void MxOmni::Init()
|
2023-06-19 01:36:07 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
m_windowHandle = NULL;
|
|
|
|
m_objectFactory = NULL;
|
|
|
|
m_variableTable = NULL;
|
|
|
|
m_tickleManager = NULL;
|
|
|
|
m_notificationManager = NULL;
|
|
|
|
m_videoManager = NULL;
|
|
|
|
m_soundManager = NULL;
|
|
|
|
m_musicManager = NULL;
|
|
|
|
m_eventManager = NULL;
|
|
|
|
m_timer = NULL;
|
|
|
|
m_streamer = NULL;
|
|
|
|
m_atomIdCounterSet = NULL;
|
|
|
|
m_timerRunning = NULL;
|
2023-06-29 13:02:47 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100af0b0
|
2023-12-13 05:48:14 -05:00
|
|
|
void MxOmni::SetInstance(MxOmni* p_instance)
|
2023-06-29 13:02:47 -04:00
|
|
|
{
|
2023-12-13 05:48:14 -05:00
|
|
|
g_instance = p_instance;
|
2023-06-19 01:36:07 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100af0c0
|
2023-12-13 05:48:14 -05:00
|
|
|
MxResult MxOmni::Create(MxOmniCreateParam& p_param)
|
2023-10-24 19:38:27 -04:00
|
|
|
{
|
|
|
|
MxResult result = FAILURE;
|
|
|
|
|
|
|
|
if (!(m_atomIdCounterSet = new MxAtomIdCounterSet()))
|
|
|
|
goto done;
|
|
|
|
|
2023-12-13 05:48:14 -05:00
|
|
|
m_mediaPath = p_param.GetMediaPath();
|
|
|
|
m_windowHandle = p_param.GetWindowHandle();
|
2023-10-24 19:38:27 -04:00
|
|
|
|
2023-12-13 05:48:14 -05:00
|
|
|
if (p_param.CreateFlags().CreateObjectFactory()) {
|
2023-10-24 19:38:27 -04:00
|
|
|
if (!(m_objectFactory = new MxObjectFactory()))
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
|
2023-12-13 05:48:14 -05:00
|
|
|
if (p_param.CreateFlags().CreateVariableTable()) {
|
2023-10-24 19:38:27 -04:00
|
|
|
if (!(m_variableTable = new MxVariableTable()))
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
|
2023-12-13 05:48:14 -05:00
|
|
|
if (p_param.CreateFlags().CreateTimer()) {
|
2023-10-24 19:38:27 -04:00
|
|
|
if (!(m_timer = new MxTimer()))
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
|
2023-12-13 05:48:14 -05:00
|
|
|
if (p_param.CreateFlags().CreateTickleManager()) {
|
2023-10-24 19:38:27 -04:00
|
|
|
if (!(m_tickleManager = new MxTickleManager()))
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
|
2023-12-13 05:48:14 -05:00
|
|
|
if (p_param.CreateFlags().CreateNotificationManager()) {
|
2023-10-24 19:38:27 -04:00
|
|
|
if (m_notificationManager = new MxNotificationManager()) {
|
|
|
|
if (m_notificationManager->Create(100, 0) != SUCCESS)
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
|
2023-12-13 05:48:14 -05:00
|
|
|
if (p_param.CreateFlags().CreateStreamer()) {
|
2023-10-24 19:38:27 -04:00
|
|
|
if (!(m_streamer = new MxStreamer()) || m_streamer->Create() != SUCCESS)
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
|
2023-12-13 05:48:14 -05:00
|
|
|
if (p_param.CreateFlags().CreateVideoManager()) {
|
2023-10-24 19:38:27 -04:00
|
|
|
if (m_videoManager = new MxVideoManager()) {
|
2023-12-13 05:48:14 -05:00
|
|
|
if (m_videoManager->Create(p_param.GetVideoParam(), 100, 0) != SUCCESS) {
|
2023-10-24 19:38:27 -04:00
|
|
|
delete m_videoManager;
|
|
|
|
m_videoManager = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-12-13 05:48:14 -05:00
|
|
|
if (p_param.CreateFlags().CreateSoundManager()) {
|
2023-10-24 19:38:27 -04:00
|
|
|
if (m_soundManager = new MxSoundManager()) {
|
|
|
|
if (m_soundManager->Create(10, 0) != SUCCESS) {
|
|
|
|
delete m_soundManager;
|
|
|
|
m_soundManager = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-12-13 05:48:14 -05:00
|
|
|
if (p_param.CreateFlags().CreateMusicManager()) {
|
2023-10-24 19:38:27 -04:00
|
|
|
if (m_musicManager = new MxMusicManager()) {
|
|
|
|
if (m_musicManager->Create(50, 0) != SUCCESS) {
|
|
|
|
delete m_musicManager;
|
|
|
|
m_musicManager = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-12-13 05:48:14 -05:00
|
|
|
if (p_param.CreateFlags().CreateEventManager()) {
|
2023-10-24 19:38:27 -04:00
|
|
|
if (m_eventManager = new MxEventManager()) {
|
|
|
|
if (m_eventManager->Create(50, 0) != SUCCESS) {
|
|
|
|
delete m_eventManager;
|
|
|
|
m_eventManager = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
result = SUCCESS;
|
2023-10-14 20:49:07 -04:00
|
|
|
done:
|
2023-10-24 19:38:27 -04:00
|
|
|
if (result != SUCCESS)
|
|
|
|
Destroy();
|
2023-10-07 14:05:45 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
return result;
|
2023-06-19 01:36:07 -04:00
|
|
|
}
|
2023-06-19 02:19:40 -04:00
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100afe90
|
2023-06-19 02:19:40 -04:00
|
|
|
void MxOmni::Destroy()
|
|
|
|
{
|
2023-10-25 16:51:59 -04:00
|
|
|
{
|
|
|
|
MxDSAction action;
|
|
|
|
action.SetObjectId(-1);
|
|
|
|
action.SetUnknown24(-2);
|
|
|
|
DeleteObject(action);
|
|
|
|
}
|
2023-10-24 19:38:27 -04:00
|
|
|
|
|
|
|
// TODO: private members
|
|
|
|
if (m_notificationManager) {
|
2023-10-25 16:51:59 -04:00
|
|
|
while (m_notificationManager->GetQueue()) {
|
|
|
|
if (m_notificationManager->GetQueue()->size() == 0)
|
|
|
|
break;
|
|
|
|
m_notificationManager->Tickle();
|
|
|
|
}
|
2023-10-24 19:38:27 -04:00
|
|
|
|
2023-10-25 16:51:59 -04:00
|
|
|
m_notificationManager->SetActive(FALSE);
|
|
|
|
}
|
2023-10-24 19:38:27 -04:00
|
|
|
|
|
|
|
delete m_eventManager;
|
|
|
|
delete m_soundManager;
|
|
|
|
delete m_musicManager;
|
|
|
|
delete m_videoManager;
|
|
|
|
delete m_streamer;
|
|
|
|
delete m_timer;
|
|
|
|
delete m_objectFactory;
|
|
|
|
delete m_variableTable;
|
|
|
|
delete m_notificationManager;
|
|
|
|
delete m_tickleManager;
|
|
|
|
|
|
|
|
// There could be a tree/iterator function that does this inline
|
|
|
|
if (m_atomIdCounterSet) {
|
|
|
|
while (!m_atomIdCounterSet->empty()) {
|
|
|
|
// Pop each node and delete its value
|
|
|
|
MxAtomIdCounterSet::iterator begin = m_atomIdCounterSet->begin();
|
|
|
|
MxAtomIdCounter* value = *begin;
|
|
|
|
m_atomIdCounterSet->erase(begin);
|
|
|
|
delete value;
|
|
|
|
}
|
|
|
|
delete m_atomIdCounterSet;
|
|
|
|
}
|
2023-10-25 16:51:59 -04:00
|
|
|
Init();
|
2023-06-19 02:19:40 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100b0090
|
2023-11-21 03:44:45 -05:00
|
|
|
MxResult MxOmni::Start(MxDSAction* p_dsAction)
|
2023-06-19 02:19:40 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
MxResult result = FAILURE;
|
|
|
|
if (p_dsAction->GetAtomId().GetInternal() != NULL && p_dsAction->GetObjectId() != -1 && m_streamer != NULL) {
|
|
|
|
result = m_streamer->FUN_100b99b0(p_dsAction);
|
|
|
|
}
|
2023-10-07 14:05:45 -04:00
|
|
|
|
2023-11-21 03:44:45 -05:00
|
|
|
return result;
|
2023-10-07 14:05:45 -04:00
|
|
|
}
|
|
|
|
|
2023-12-16 13:14:01 -05:00
|
|
|
// FUNCTION: LEGO1 0x100b00c0
|
|
|
|
void MxOmni::DeleteObject(MxDSAction& p_dsAction)
|
2023-10-07 14:05:45 -04:00
|
|
|
{
|
2023-12-16 13:14:01 -05:00
|
|
|
if (m_streamer != NULL) {
|
|
|
|
m_streamer->DeleteObject(&p_dsAction);
|
|
|
|
}
|
2023-06-19 02:19:40 -04:00
|
|
|
}
|
2023-06-19 04:34:58 -04:00
|
|
|
|
2023-12-16 13:14:01 -05:00
|
|
|
// FUNCTION: LEGO1 0x100b00e0
|
|
|
|
MxResult MxOmni::CreatePresenter(MxStreamController* p_controller, MxDSAction& p_action)
|
2023-06-29 13:02:47 -04:00
|
|
|
{
|
2023-12-16 13:14:01 -05:00
|
|
|
MxResult result = FAILURE;
|
2024-01-05 12:31:19 -05:00
|
|
|
const char* name = PresenterNameDispatch(p_action);
|
|
|
|
MxPresenter* object = (MxPresenter*) m_objectFactory->Create(name);
|
2023-12-16 13:14:01 -05:00
|
|
|
|
|
|
|
if (object) {
|
|
|
|
if (object->AddToManager() == SUCCESS) {
|
|
|
|
MxPresenter* sender = p_action.GetUnknown28();
|
2024-01-05 12:31:19 -05:00
|
|
|
if (!sender)
|
|
|
|
sender = p_controller->FUN_100c1e70(p_action);
|
2023-12-16 13:14:01 -05:00
|
|
|
|
2024-01-05 12:31:19 -05:00
|
|
|
if (sender) {
|
2023-12-16 13:14:01 -05:00
|
|
|
p_action.SetOrigin(sender);
|
|
|
|
object->SetCompositePresenter((MxCompositePresenter*) sender);
|
|
|
|
}
|
2024-01-05 12:31:19 -05:00
|
|
|
else {
|
|
|
|
if (!p_action.GetOrigin())
|
|
|
|
p_action.SetOrigin(this);
|
|
|
|
object->SetCompositePresenter(NULL);
|
|
|
|
}
|
2023-12-16 13:14:01 -05:00
|
|
|
|
|
|
|
if (object->StartAction(p_controller, &p_action) == SUCCESS) {
|
|
|
|
if (sender) {
|
|
|
|
NotificationManager()->Send(sender, &MxType4NotificationParam(this, &p_action, object));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (p_action.GetUnknown84()) {
|
|
|
|
NotificationManager()->Send(
|
|
|
|
p_action.GetUnknown84(),
|
2024-01-05 12:31:19 -05:00
|
|
|
&MxStartActionNotificationParam(c_notificationStartAction, object, &p_action, FALSE)
|
2023-12-16 13:14:01 -05:00
|
|
|
);
|
|
|
|
}
|
|
|
|
result = SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-01-05 12:31:19 -05:00
|
|
|
|
2023-12-16 13:14:01 -05:00
|
|
|
return result;
|
2023-06-29 13:02:47 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100b0680
|
2023-11-21 03:44:45 -05:00
|
|
|
MxOmni* MxOmni::GetInstance()
|
2023-06-29 13:02:47 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
return g_instance;
|
2023-06-29 13:02:47 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100b0690
|
2023-11-21 03:44:45 -05:00
|
|
|
void MxOmni::DestroyInstance()
|
2023-06-29 13:02:47 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
if (g_instance != NULL) {
|
|
|
|
delete g_instance;
|
|
|
|
g_instance = NULL;
|
|
|
|
}
|
2023-06-29 13:02:47 -04:00
|
|
|
}
|
|
|
|
|
2023-12-16 13:14:01 -05:00
|
|
|
// STUB: LEGO1 0x100b06b0
|
|
|
|
MxBool MxOmni::FUN_100b06b0(MxDSAction* p_action, const char* p_name)
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
return FAILURE;
|
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100b07f0
|
2023-12-13 05:48:14 -05:00
|
|
|
MxLong MxOmni::Notify(MxParam& p_param)
|
2023-06-19 04:34:58 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
MxAutoLocker lock(&this->m_criticalsection);
|
|
|
|
|
2023-12-13 05:48:14 -05:00
|
|
|
if (((MxNotificationParam&) p_param).GetNotification() != c_notificationEndAction)
|
2023-11-21 03:44:45 -05:00
|
|
|
return 0;
|
|
|
|
|
2023-12-16 13:14:01 -05:00
|
|
|
return HandleActionEnd(p_param);
|
2023-06-19 04:34:58 -04:00
|
|
|
}
|
2023-06-29 13:02:47 -04:00
|
|
|
|
2023-12-16 13:14:01 -05:00
|
|
|
// FUNCTION: LEGO1 0x100b0880
|
|
|
|
MxLong MxOmni::HandleActionEnd(MxParam& p_param)
|
2023-08-16 13:09:44 -04:00
|
|
|
{
|
2023-12-16 13:14:01 -05:00
|
|
|
MxDSAction* action = ((MxEndActionNotificationParam&) p_param).GetAction();
|
|
|
|
MxStreamController* controller = Streamer()->GetOpenStream(action->GetAtomId().GetInternal());
|
|
|
|
|
|
|
|
if (controller != NULL) {
|
|
|
|
action = controller->GetUnk0x54().Find(action, FALSE);
|
|
|
|
if (action) {
|
|
|
|
if (FUN_100b06b0(action, "LegoLoopingAnimPresenter") == 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;
|
2023-08-16 13:09:44 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100b0900
|
2023-11-21 03:44:45 -05:00
|
|
|
const char* MxOmni::GetHD()
|
2023-06-29 13:02:47 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
return g_hdPath;
|
2023-10-07 09:05:44 -04:00
|
|
|
}
|
2023-06-29 13:02:47 -04:00
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100b0910
|
2023-11-21 03:44:45 -05:00
|
|
|
void MxOmni::SetHD(const char* p_hd)
|
2023-06-29 13:02:47 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
strcpy(g_hdPath, p_hd);
|
2023-06-29 13:02:47 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100b0940
|
2023-11-21 03:44:45 -05:00
|
|
|
const char* MxOmni::GetCD()
|
2023-06-29 13:02:47 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
return g_cdPath;
|
2023-06-29 13:02:47 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100b0950
|
2023-11-21 03:44:45 -05:00
|
|
|
void MxOmni::SetCD(const char* p_cd)
|
2023-06-29 13:02:47 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
strcpy(g_cdPath, p_cd);
|
2023-06-29 13:02:47 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100b0980
|
2023-11-21 03:44:45 -05:00
|
|
|
MxBool MxOmni::IsSound3D()
|
2023-06-29 13:02:47 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
return g_use3dSound;
|
2023-06-29 13:02:47 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100b0990
|
2023-12-13 05:48:14 -05:00
|
|
|
void MxOmni::SetSound3D(MxBool p_use3dSound)
|
2023-06-29 13:02:47 -04:00
|
|
|
{
|
2023-12-13 05:48:14 -05:00
|
|
|
g_use3dSound = p_use3dSound;
|
2023-10-07 09:05:44 -04:00
|
|
|
}
|
2023-10-22 10:11:46 -04:00
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100b09a0
|
2023-11-21 03:44:45 -05:00
|
|
|
MxBool MxOmni::DoesEntityExist(MxDSAction& p_dsAction)
|
2023-10-22 10:11:46 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
if (m_streamer->FUN_100b9b30(p_dsAction)) {
|
|
|
|
MxNotificationPtrList* queue = m_notificationManager->GetQueue();
|
|
|
|
|
|
|
|
if (!queue || queue->size() == 0)
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
return FALSE;
|
2023-10-23 07:16:21 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100b09d0
|
2023-11-21 03:44:45 -05:00
|
|
|
void MxOmni::StartTimer()
|
2023-10-23 07:16:21 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
if (m_timerRunning == FALSE && m_timer != NULL && m_soundManager != NULL) {
|
|
|
|
m_timer->Start();
|
2023-11-24 12:09:53 -05:00
|
|
|
m_soundManager->Pause();
|
2023-11-21 03:44:45 -05:00
|
|
|
m_timerRunning = TRUE;
|
|
|
|
}
|
|
|
|
}
|
2023-10-23 07:16:21 -04:00
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100b0a00
|
2023-11-21 03:44:45 -05:00
|
|
|
void MxOmni::StopTimer()
|
|
|
|
{
|
|
|
|
if (m_timerRunning != FALSE && m_timer != NULL && m_soundManager != NULL) {
|
|
|
|
m_timer->Stop();
|
2023-11-24 12:09:53 -05:00
|
|
|
m_soundManager->Resume();
|
2023-11-21 03:44:45 -05:00
|
|
|
m_timerRunning = FALSE;
|
2023-10-24 19:38:27 -04:00
|
|
|
}
|
2023-10-23 07:16:21 -04:00
|
|
|
}
|