begin implementation of InfoCenter class (#444)

* Push changes

* fixes

* Implement Infocenter::HandleEndAction

* match Infocenter::StopCutScene

* implement Infocenter::HandleKeyPress

* fixes

* Update infocenter.cpp

* Update legoworld.cpp

* use enums

* WIP Fixes

* Fix

* Fix

* Fix

* Rename function

* Change enum

* Update enums

* Refactor another enum

* Refactor MxDSType

* Refactor HashTableOpt

* Fixes

* Refactor tickle enum

* Update other enums

* Add EnumConstantName to ncc

* Move enum to global namespace

* Rename enum

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
Misha
2024-01-17 11:53:53 -05:00
committed by GitHub
parent aaa18bc9e2
commit f50b771fff
100 changed files with 1160 additions and 555 deletions

View File

@@ -21,7 +21,7 @@ DECOMP_SIZE_ASSERT(MxPresenter, 0x40);
// FUNCTION: LEGO1 0x100b4d50
void MxPresenter::Init()
{
m_currentTickleState = TickleState_Idle;
m_currentTickleState = e_idle;
m_action = NULL;
m_location = MxPoint32(0, 0);
m_displayZ = 0;
@@ -41,7 +41,7 @@ MxResult MxPresenter::StartAction(MxStreamController*, MxDSAction* p_action)
this->m_location = MxPoint32(this->m_action->GetLocation()[0], this->m_action->GetLocation()[1]);
this->m_displayZ = this->m_action->GetLocation()[2];
ProgressTickleState(TickleState_Ready);
ProgressTickleState(e_ready);
return SUCCESS;
}
@@ -70,7 +70,7 @@ void MxPresenter::EndAction()
this->m_action = NULL;
MxS32 previousTickleState = 1 << m_currentTickleState;
this->m_previousTickleStates |= previousTickleState;
this->m_currentTickleState = TickleState_Idle;
this->m_currentTickleState = e_idle;
}
// FUNCTION: LEGO1 0x100b4fc0
@@ -96,7 +96,7 @@ void MxPresenter::ParseExtra()
MxS32 val = token ? atoi(token) : 0;
MxEntity* result = MxOmni::GetInstance()->FindWorld(buf, val, this);
m_action->SetFlags(m_action->GetFlags() | MxDSAction::Flag_World);
m_action->SetFlags(m_action->GetFlags() | MxDSAction::c_world);
if (result)
SendToCompositePresenter(MxOmni::GetInstance());
@@ -112,11 +112,11 @@ void MxPresenter::SendToCompositePresenter(MxOmni* p_omni)
#ifdef COMPAT_MODE
{
MxNotificationParam param(MXPRESENTER_NOTIFICATION, this);
MxNotificationParam param(c_notificationPresenter, this);
NotificationManager()->Send(m_compositePresenter, &param);
}
#else
NotificationManager()->Send(m_compositePresenter, &MxNotificationParam(MXPRESENTER_NOTIFICATION, this));
NotificationManager()->Send(m_compositePresenter, &MxNotificationParam(c_notificationPresenter, this));
#endif
m_action->SetOrigin(p_omni ? p_omni : MxOmni::GetInstance());
@@ -130,32 +130,32 @@ MxResult MxPresenter::Tickle()
MxAutoLocker lock(&this->m_criticalSection);
switch (this->m_currentTickleState) {
case TickleState_Ready:
case e_ready:
this->ReadyTickle();
if (m_currentTickleState != TickleState_Starting)
if (m_currentTickleState != e_starting)
break;
case TickleState_Starting:
case e_starting:
this->StartingTickle();
if (m_currentTickleState != TickleState_Streaming)
if (m_currentTickleState != e_streaming)
break;
case TickleState_Streaming:
case e_streaming:
this->StreamingTickle();
if (m_currentTickleState != TickleState_Repeating)
if (m_currentTickleState != e_repeating)
break;
case TickleState_Repeating:
case e_repeating:
this->RepeatingTickle();
if (m_currentTickleState != TickleState_unk5)
if (m_currentTickleState != e_unk5)
break;
case TickleState_unk5:
case e_unk5:
this->Unk5Tickle();
if (m_currentTickleState != TickleState_Done)
if (m_currentTickleState != e_done)
break;
case TickleState_Done:
case e_done:
this->DoneTickle();
default:
break;
@@ -171,9 +171,9 @@ void MxPresenter::Enable(MxBool p_enable)
MxU32 flags = this->m_action->GetFlags();
if (p_enable)
this->m_action->SetFlags(flags | MxDSAction::Flag_Enabled);
this->m_action->SetFlags(flags | MxDSAction::c_enabled);
else
this->m_action->SetFlags(flags & ~MxDSAction::Flag_Enabled);
this->m_action->SetFlags(flags & ~MxDSAction::c_enabled);
}
}
@@ -185,7 +185,7 @@ const char* PresenterNameDispatch(const MxDSAction& p_action)
if (!name || strlen(name) == 0) {
switch (p_action.GetType()) {
case MxDSType_Anim:
case MxDSObject::e_anim:
format = ((MxDSAnim&) p_action).GetMediaFormat();
switch (format) {
case FOURCC(' ', 'F', 'L', 'C'):
@@ -197,7 +197,7 @@ const char* PresenterNameDispatch(const MxDSAction& p_action)
}
break;
case MxDSType_Sound:
case MxDSObject::e_sound:
format = ((MxDSSound&) p_action).GetMediaFormat();
switch (format) {
case FOURCC(' ', 'M', 'I', 'D'):
@@ -209,17 +209,17 @@ const char* PresenterNameDispatch(const MxDSAction& p_action)
}
break;
case MxDSType_SerialAction:
case MxDSType_ParallelAction:
case MxDSType_SelectAction:
case MxDSObject::e_serialAction:
case MxDSObject::e_parallelAction:
case MxDSObject::e_selectAction:
name = "MxCompositePresenter";
break;
case MxDSType_Event:
case MxDSObject::e_event:
name = "MxEventPresenter";
break;
case MxDSType_Still:
case MxDSObject::e_still:
name = "MxStillPresenter";
break;
}
@@ -252,5 +252,5 @@ MxEntity* MxPresenter::CreateEntity(const char* p_name)
// FUNCTION: LEGO1 0x100b54c0
MxBool MxPresenter::IsEnabled()
{
return this->m_action && this->m_action->GetFlags() & MxDSAction::Flag_Enabled;
return this->m_action && this->m_action->GetFlags() & MxDSAction::c_enabled;
}