Refactor tickle enum

This commit is contained in:
Christian Semmler 2024-01-17 10:26:34 -05:00
parent 8dad6b50bf
commit fb803394ac
25 changed files with 117 additions and 117 deletions

View File

@ -77,13 +77,13 @@ void MxBackgroundAudioManager::DestroyMusic()
MxResult MxBackgroundAudioManager::Tickle() MxResult MxBackgroundAudioManager::Tickle()
{ {
switch (m_unk0x13c) { switch (m_unk0x13c) {
case MxPresenter::TickleState_Starting: case MxPresenter::e_starting:
FadeInOrFadeOut(); FadeInOrFadeOut();
return SUCCESS; return SUCCESS;
case MxPresenter::TickleState_Streaming: case MxPresenter::e_streaming:
FUN_1007ee70(); FUN_1007ee70();
return SUCCESS; return SUCCESS;
case MxPresenter::TickleState_Repeating: case MxPresenter::e_repeating:
FUN_1007ef40(); FUN_1007ef40();
return SUCCESS; return SUCCESS;
default: default:

View File

@ -19,7 +19,7 @@ void LegoActionControlPresenter::ReadyTickle()
if (chunk) { if (chunk) {
ParseExtra(); ParseExtra();
ProgressTickleState(TickleState_Starting); ProgressTickleState(e_starting);
m_subscriber->DestroyChunk(chunk); m_subscriber->DestroyChunk(chunk);
if (m_compositePresenter) { if (m_compositePresenter) {
@ -46,7 +46,7 @@ void LegoActionControlPresenter::RepeatingTickle()
#else #else
InvokeAction(m_unk0x50, MxAtomId(m_unk0x54.GetData(), MxAtomId::e_lowerCase2), m_unk0x64, NULL); InvokeAction(m_unk0x50, MxAtomId(m_unk0x54.GetData(), MxAtomId::e_lowerCase2), m_unk0x64, NULL);
#endif #endif
ProgressTickleState(TickleState_Done); ProgressTickleState(e_done);
} }
} }

View File

@ -55,7 +55,7 @@ MxResult MxCompositeMediaPresenter::StartAction(MxStreamController* p_controller
if (presenter && presenter->AddToManager() == SUCCESS) { if (presenter && presenter->AddToManager() == SUCCESS) {
presenter->SetCompositePresenter(this); presenter->SetCompositePresenter(this);
if (presenter->StartAction(p_controller, action) == SUCCESS) { if (presenter->StartAction(p_controller, action) == SUCCESS) {
presenter->SetTickleState(TickleState_Idle); presenter->SetTickleState(e_idle);
if (presenter->IsA("MxVideoPresenter")) if (presenter->IsA("MxVideoPresenter"))
VideoManager()->UnregisterPresenter(*presenter); VideoManager()->UnregisterPresenter(*presenter);
@ -75,7 +75,7 @@ MxResult MxCompositeMediaPresenter::StartAction(MxStreamController* p_controller
} }
if (!m_compositePresenter) { if (!m_compositePresenter) {
SetTickleState(TickleState_Ready); SetTickleState(e_ready);
MxLong time = Timer()->GetTime(); MxLong time = Timer()->GetTime();
m_action->SetUnknown90(time); m_action->SetUnknown90(time);
} }
@ -93,10 +93,10 @@ void MxCompositeMediaPresenter::StartingTickle()
if (!m_unk0x4e) { if (!m_unk0x4e) {
for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++) { for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++) {
if ((*it)->GetCurrentTickleState() < TickleState_Streaming) { if ((*it)->GetCurrentTickleState() < e_streaming) {
(*it)->Tickle(); (*it)->Tickle();
if ((*it)->GetCurrentTickleState() == TickleState_Streaming || if ((*it)->GetCurrentTickleState() == e_streaming ||
((*it)->GetAction() && (*it)->GetAction()->GetStartTime())) ((*it)->GetAction() && (*it)->GetAction()->GetStartTime()))
m_unk0x4c++; m_unk0x4c++;
} }
@ -123,7 +123,7 @@ void MxCompositeMediaPresenter::StartingTickle()
} }
if (!m_unk0x4c) { if (!m_unk0x4c) {
ProgressTickleState(TickleState_Streaming); ProgressTickleState(e_streaming);
MxLong time = Timer()->GetTime(); MxLong time = Timer()->GetTime();
m_action->SetUnknown90(time); m_action->SetUnknown90(time);
} }
@ -136,15 +136,15 @@ MxResult MxCompositeMediaPresenter::Tickle()
MxAutoLocker lock(&m_criticalSection); MxAutoLocker lock(&m_criticalSection);
switch (m_currentTickleState) { switch (m_currentTickleState) {
case TickleState_Ready: case e_ready:
ProgressTickleState(TickleState_Starting); ProgressTickleState(e_starting);
case TickleState_Starting: case e_starting:
StartingTickle(); StartingTickle();
break; break;
case TickleState_Streaming: case e_streaming:
case TickleState_Repeating: case e_repeating:
case TickleState_unk5: case e_unk5:
case TickleState_Done: { case e_done: {
for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++) for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++)
(*it)->Tickle(); (*it)->Tickle();
break; break;
@ -161,7 +161,7 @@ MxResult MxCompositeMediaPresenter::PutData()
{ {
MxAutoLocker lock(&m_criticalSection); MxAutoLocker lock(&m_criticalSection);
if (m_currentTickleState >= TickleState_Streaming && m_currentTickleState <= TickleState_Done) { if (m_currentTickleState >= e_streaming && m_currentTickleState <= e_done) {
for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++) for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++)
(*it)->PutData(); (*it)->PutData();
} }

View File

@ -106,7 +106,7 @@ void MxControlPresenter::ReadyTickle()
{ {
MxPresenter::ParseExtra(); MxPresenter::ParseExtra();
TickleManager()->UnregisterClient(this); TickleManager()->UnregisterClient(this);
ProgressTickleState(TickleState_Repeating); ProgressTickleState(e_repeating);
} }
// STUB: LEGO1 0x10044640 // STUB: LEGO1 0x10044640

View File

@ -12,7 +12,7 @@ void LegoActorPresenter::ReadyTickle()
SetEntityLocation(m_action->GetLocation(), m_action->GetDirection(), m_action->GetUp()); SetEntityLocation(m_action->GetLocation(), m_action->GetDirection(), m_action->GetUp());
m_entity->Create(*m_action); m_entity->Create(*m_action);
} }
ProgressTickleState(TickleState_Starting); ProgressTickleState(e_starting);
} }
} }
@ -20,7 +20,7 @@ void LegoActorPresenter::ReadyTickle()
void LegoActorPresenter::StartingTickle() void LegoActorPresenter::StartingTickle()
{ {
if (m_entity->GetROI()) { if (m_entity->GetROI()) {
ProgressTickleState(TickleState_Streaming); ProgressTickleState(e_streaming);
ParseExtra(); ParseExtra();
} }
} }

View File

@ -69,7 +69,7 @@ void LegoEntityPresenter::ReadyTickle()
m_entity->SetLocation(m_action->GetLocation(), m_action->GetDirection(), m_action->GetUp(), TRUE); m_entity->SetLocation(m_action->GetLocation(), m_action->GetDirection(), m_action->GetUp(), TRUE);
ParseExtra(); ParseExtra();
} }
ProgressTickleState(TickleState_Starting); ProgressTickleState(e_starting);
} }
} }

View File

@ -91,7 +91,7 @@ MxResult LegoWorldPresenter::StartAction(MxStreamController* p_controller, MxDSA
if (presenter && presenter->AddToManager() == SUCCESS) { if (presenter && presenter->AddToManager() == SUCCESS) {
presenter->SetCompositePresenter(this); presenter->SetCompositePresenter(this);
if (presenter->StartAction(p_controller, action) == SUCCESS) { if (presenter->StartAction(p_controller, action) == SUCCESS) {
presenter->SetTickleState(TickleState_Idle); presenter->SetTickleState(e_idle);
success = TRUE; success = TRUE;
} }
} }
@ -123,7 +123,7 @@ void LegoWorldPresenter::ReadyTickle()
} }
ParseExtra(); ParseExtra();
ProgressTickleState(TickleState_Starting); ProgressTickleState(e_starting);
} }
// FUNCTION: LEGO1 0x10066ac0 // FUNCTION: LEGO1 0x10066ac0
@ -131,19 +131,19 @@ void LegoWorldPresenter::StartingTickle()
{ {
if (m_action->IsA("MxDSSerialAction")) { if (m_action->IsA("MxDSSerialAction")) {
MxPresenter* presenter = *m_list.begin(); MxPresenter* presenter = *m_list.begin();
if (presenter->GetCurrentTickleState() == TickleState_Idle) { if (presenter->GetCurrentTickleState() == e_idle) {
presenter->SetTickleState(TickleState_Ready); presenter->SetTickleState(e_ready);
} }
} }
else { else {
for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++) { for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++) {
if ((*it)->GetCurrentTickleState() == TickleState_Idle) { if ((*it)->GetCurrentTickleState() == e_idle) {
(*it)->SetTickleState(TickleState_Ready); (*it)->SetTickleState(e_ready);
} }
} }
} }
ProgressTickleState(TickleState_Streaming); ProgressTickleState(e_streaming);
} }
// FUNCTION: LEGO1 0x10067a70 // FUNCTION: LEGO1 0x10067a70

View File

@ -61,7 +61,7 @@ void LegoPathPresenter::Destroy()
void LegoPathPresenter::ReadyTickle() void LegoPathPresenter::ReadyTickle()
{ {
// TODO // TODO
ProgressTickleState(TickleState_Starting); // Allow initialization process to continue ProgressTickleState(e_starting); // Allow initialization process to continue
} }
// FUNCTION: LEGO1 0x10044d00 // FUNCTION: LEGO1 0x10044d00
@ -71,7 +71,7 @@ void LegoPathPresenter::StreamingTickle()
if (chunk) { if (chunk) {
if (chunk->GetFlags() & MxStreamChunk::Flag_End) { if (chunk->GetFlags() & MxStreamChunk::Flag_End) {
ProgressTickleState(TickleState_Repeating); ProgressTickleState(e_repeating);
} }
m_subscriber->DestroyChunk(chunk); m_subscriber->DestroyChunk(chunk);

View File

@ -114,7 +114,7 @@ void LegoAnimPresenter::ReadyTickle()
m_subscriber->DestroyChunk(chunk); m_subscriber->DestroyChunk(chunk);
if (result == SUCCESS) { if (result == SUCCESS) {
ProgressTickleState(TickleState_Starting); ProgressTickleState(e_starting);
ParseExtra(); ParseExtra();
} }
else { else {
@ -128,7 +128,7 @@ void LegoAnimPresenter::ReadyTickle()
void LegoAnimPresenter::StartingTickle() void LegoAnimPresenter::StartingTickle()
{ {
// TODO // TODO
ProgressTickleState(TickleState_Streaming); ProgressTickleState(e_streaming);
EndAction(); // Allow game to start EndAction(); // Allow game to start
} }
@ -146,7 +146,7 @@ void LegoAnimPresenter::StreamingTickle()
} }
} }
else { else {
ProgressTickleState(TickleState_Done); ProgressTickleState(e_done);
if (m_compositePresenter) { if (m_compositePresenter) {
if (m_compositePresenter->IsA("LegoAnimMMPresenter")) { if (m_compositePresenter->IsA("LegoAnimMMPresenter")) {
m_compositePresenter->VTable0x60(this); m_compositePresenter->VTable0x60(this);

View File

@ -31,7 +31,7 @@ void LegoModelPresenter::Destroy(MxBool p_fromDestructor)
void LegoModelPresenter::ReadyTickle() void LegoModelPresenter::ReadyTickle()
{ {
// TODO // TODO
SetTickleState(TickleState_Starting); SetTickleState(e_starting);
} }
// STUB: LEGO1 0x100801b0 // STUB: LEGO1 0x100801b0

View File

@ -77,7 +77,7 @@ void LegoPalettePresenter::ReadyTickle()
if (chunk) { if (chunk) {
if (chunk->GetTime() <= m_action->GetElapsedTime()) { if (chunk->GetTime() <= m_action->GetElapsedTime()) {
ParseExtra(); ParseExtra();
ProgressTickleState(TickleState_Starting); ProgressTickleState(e_starting);
chunk = m_subscriber->NextChunk(); chunk = m_subscriber->NextChunk();
MxResult result = ParsePalette(chunk); MxResult result = ParsePalette(chunk);

View File

@ -28,7 +28,7 @@ MxResult LegoTexturePresenter::PutData()
void LegoTexturePresenter::DoneTickle() void LegoTexturePresenter::DoneTickle()
{ {
if (this->m_compositePresenter && !this->m_compositePresenter->VTable0x64(2)) { if (this->m_compositePresenter && !this->m_compositePresenter->VTable0x64(2)) {
SetTickleState(TickleState_Idle); SetTickleState(e_idle);
return; return;
} }

View File

@ -488,7 +488,7 @@ void MxTransitionManager::SetWaitIndicator(MxVideoPresenter* p_waitIndicator)
LegoVideoManager* videoManager = VideoManager(); LegoVideoManager* videoManager = VideoManager();
videoManager->UnregisterPresenter(*m_waitIndicator); videoManager->UnregisterPresenter(*m_waitIndicator);
if (m_waitIndicator->GetCurrentTickleState() < MxPresenter::TickleState_Streaming) { if (m_waitIndicator->GetCurrentTickleState() < MxPresenter::e_streaming) {
m_waitIndicator->Tickle(); m_waitIndicator->Tickle();
} }
} }
@ -542,7 +542,7 @@ void MxTransitionManager::SetupCopyRect(LPDDSURFACEDESC p_ddsc)
m_waitIndicator->Tickle(); m_waitIndicator->Tickle();
// Check if wait indicator has started // Check if wait indicator has started
if (m_waitIndicator->GetCurrentTickleState() >= MxPresenter::TickleState_Streaming) { if (m_waitIndicator->GetCurrentTickleState() >= MxPresenter::e_streaming) {
// Setup the copy rect // Setup the copy rect
MxU32 copyPitch = (p_ddsc->ddpfPixelFormat.dwRGBBitCount / 8) * MxU32 copyPitch = (p_ddsc->ddpfPixelFormat.dwRGBBitCount / 8) *
(m_copyRect.right - m_copyRect.left + 1); // This uses m_copyRect, seemingly erroneously (m_copyRect.right - m_copyRect.left + 1); // This uses m_copyRect, seemingly erroneously

View File

@ -17,13 +17,13 @@ class MxEntity;
class MxPresenter : public MxCore { class MxPresenter : public MxCore {
public: public:
enum TickleState { enum TickleState {
TickleState_Idle = 0, e_idle = 0,
TickleState_Ready, e_ready,
TickleState_Starting, e_starting,
TickleState_Streaming, e_streaming,
TickleState_Repeating, e_repeating,
TickleState_unk5, e_unk5,
TickleState_Done, e_done,
}; };
MxPresenter() { Init(); } MxPresenter() { Init(); }
@ -57,27 +57,27 @@ class MxPresenter : public MxCore {
virtual void ReadyTickle() virtual void ReadyTickle()
{ {
ParseExtra(); ParseExtra();
ProgressTickleState(TickleState_Starting); ProgressTickleState(e_starting);
} // vtable+0x18 } // vtable+0x18
// FUNCTION: LEGO1 0x1000be60 // FUNCTION: LEGO1 0x1000be60
virtual void StartingTickle() { ProgressTickleState(TickleState_Streaming); } // vtable+0x1c virtual void StartingTickle() { ProgressTickleState(e_streaming); } // vtable+0x1c
// FUNCTION: LEGO1 0x1000be80 // FUNCTION: LEGO1 0x1000be80
virtual void StreamingTickle() { ProgressTickleState(TickleState_Repeating); }; // vtable+0x20 virtual void StreamingTickle() { ProgressTickleState(e_repeating); }; // vtable+0x20
// FUNCTION: LEGO1 0x1000bea0 // FUNCTION: LEGO1 0x1000bea0
virtual void RepeatingTickle() { ProgressTickleState(TickleState_unk5); }; // vtable+0x24 virtual void RepeatingTickle() { ProgressTickleState(e_unk5); }; // vtable+0x24
// FUNCTION: LEGO1 0x1000bec0 // FUNCTION: LEGO1 0x1000bec0
virtual void Unk5Tickle() { ProgressTickleState(TickleState_Done); }; // vtable+0x28 virtual void Unk5Tickle() { ProgressTickleState(e_done); }; // vtable+0x28
protected: protected:
#ifdef ISLE_APP #ifdef ISLE_APP
__declspec(dllexport) virtual void DoneTickle(); // vtable+0x2c __declspec(dllexport) virtual void DoneTickle(); // vtable+0x2c
#else #else
// FUNCTION: LEGO1 0x1000bee0 // FUNCTION: LEGO1 0x1000bee0
__declspec(dllexport) virtual void DoneTickle() { ProgressTickleState(TickleState_Idle); }; // vtable+0x2c __declspec(dllexport) virtual void DoneTickle() { ProgressTickleState(e_idle); }; // vtable+0x2c
#endif #endif
__declspec(dllexport) virtual void ParseExtra(); // vtable+0x30 __declspec(dllexport) virtual void ParseExtra(); // vtable+0x30

View File

@ -21,7 +21,7 @@ void MxLoopingMIDIPresenter::StreamingTickle()
} }
if (m_chunk->GetTime() + m_action->GetDuration() <= m_action->GetElapsedTime()) if (m_chunk->GetTime() + m_action->GetDuration() <= m_action->GetElapsedTime())
ProgressTickleState(TickleState_Done); ProgressTickleState(e_done);
} }
// FUNCTION: LEGO1 0x100c2ae0 // FUNCTION: LEGO1 0x100c2ae0
@ -38,7 +38,7 @@ MxResult MxLoopingMIDIPresenter::PutData()
{ {
m_criticalSection.Enter(); m_criticalSection.Enter();
if (m_currentTickleState == TickleState_Streaming && m_chunk && !MusicManager()->GetMIDIInitialized()) { if (m_currentTickleState == e_streaming && m_chunk && !MusicManager()->GetMIDIInitialized()) {
SetVolume(((MxDSSound*) m_action)->GetVolume()); SetVolume(((MxDSSound*) m_action)->GetVolume());
MusicManager()->FUN_100c09c0(m_chunk->GetData(), !m_action->GetLoopCount() ? -1 : m_action->GetLoopCount()); MusicManager()->FUN_100c09c0(m_chunk->GetData(), !m_action->GetLoopCount() ? -1 : m_action->GetLoopCount());
} }

View File

@ -52,7 +52,7 @@ void MxMIDIPresenter::ReadyTickle()
if (chunk) { if (chunk) {
m_subscriber->DestroyChunk(chunk); m_subscriber->DestroyChunk(chunk);
ParseExtra(); ParseExtra();
ProgressTickleState(TickleState_Starting); ProgressTickleState(e_starting);
} }
} }
@ -62,14 +62,14 @@ void MxMIDIPresenter::StartingTickle()
MxStreamChunk* chunk = CurrentChunk(); MxStreamChunk* chunk = CurrentChunk();
if (chunk && m_action->GetElapsedTime() >= chunk->GetTime()) if (chunk && m_action->GetElapsedTime() >= chunk->GetTime())
ProgressTickleState(TickleState_Streaming); ProgressTickleState(e_streaming);
} }
// FUNCTION: LEGO1 0x100c2910 // FUNCTION: LEGO1 0x100c2910
void MxMIDIPresenter::StreamingTickle() void MxMIDIPresenter::StreamingTickle()
{ {
if (m_chunk) if (m_chunk)
ProgressTickleState(TickleState_Done); ProgressTickleState(e_done);
else else
m_chunk = NextChunk(); m_chunk = NextChunk();
} }
@ -92,7 +92,7 @@ MxResult MxMIDIPresenter::PutData()
{ {
m_criticalSection.Enter(); m_criticalSection.Enter();
if (m_currentTickleState == TickleState_Streaming && m_chunk && !MusicManager()->GetMIDIInitialized()) { if (m_currentTickleState == e_streaming && m_chunk && !MusicManager()->GetMIDIInitialized()) {
SetVolume(((MxDSSound*) m_action)->GetVolume()); SetVolume(((MxDSSound*) m_action)->GetVolume());
if (MusicManager()->FUN_100c09c0(m_chunk->GetData(), 1)) if (MusicManager()->FUN_100c09c0(m_chunk->GetData(), 1))

View File

@ -118,7 +118,7 @@ void MxWavePresenter::ReadyTickle()
memcpy(m_waveFormat, chunk->GetData(), chunk->GetLength()); memcpy(m_waveFormat, chunk->GetData(), chunk->GetLength());
m_subscriber->DestroyChunk(chunk); m_subscriber->DestroyChunk(chunk);
ParseExtra(); ParseExtra();
ProgressTickleState(TickleState_Starting); ProgressTickleState(e_starting);
} }
} }
@ -169,7 +169,7 @@ void MxWavePresenter::StartingTickle()
} }
else { else {
SetVolume(((MxDSSound*) m_action)->GetVolume()); SetVolume(((MxDSSound*) m_action)->GetVolume());
ProgressTickleState(TickleState_Streaming); ProgressTickleState(e_streaming);
} }
} }
} }
@ -231,7 +231,7 @@ MxResult MxWavePresenter::PutData()
if (IsEnabled()) { if (IsEnabled()) {
switch (m_currentTickleState) { switch (m_currentTickleState) {
case TickleState_Streaming: case e_streaming:
if (m_currentChunk && FUN_100b1ba0()) { if (m_currentChunk && FUN_100b1ba0()) {
WriteToSoundBuffer(m_currentChunk->GetData(), m_currentChunk->GetLength()); WriteToSoundBuffer(m_currentChunk->GetData(), m_currentChunk->GetLength());
m_subscriber->DestroyChunk(m_currentChunk); m_subscriber->DestroyChunk(m_currentChunk);
@ -245,7 +245,7 @@ MxResult MxWavePresenter::PutData()
m_started = TRUE; m_started = TRUE;
} }
break; break;
case TickleState_Repeating: case e_repeating:
if (m_started) if (m_started)
break; break;
@ -339,13 +339,13 @@ void MxWavePresenter::Resume()
if (m_paused) { if (m_paused) {
if (m_dsBuffer && m_started) { if (m_dsBuffer && m_started) {
switch (m_currentTickleState) { switch (m_currentTickleState) {
case TickleState_Streaming: case e_streaming:
m_dsBuffer->Play(0, 0, DSBPLAY_LOOPING); m_dsBuffer->Play(0, 0, DSBPLAY_LOOPING);
break; break;
case TickleState_Repeating: case e_repeating:
m_dsBuffer->Play(0, 0, m_action->GetLoopCount() > 1); m_dsBuffer->Play(0, 0, m_action->GetLoopCount() > 1);
break; break;
case TickleState_Done: case e_done:
m_dsBuffer->Play(0, 0, 0); m_dsBuffer->Play(0, 0, 0);
} }
} }

View File

@ -155,8 +155,8 @@ void MxCompositePresenter::VTable0x58(MxEndActionNotificationParam& p_param)
else { else {
if (m_action->IsA("MxDSSerialAction") && it != m_list.end()) { if (m_action->IsA("MxDSSerialAction") && it != m_list.end()) {
MxPresenter* presenter = *it; MxPresenter* presenter = *it;
if (presenter->GetCurrentTickleState() == TickleState_Idle) if (presenter->GetCurrentTickleState() == e_idle)
presenter->SetTickleState(TickleState_Ready); presenter->SetTickleState(e_ready);
} }
} }
} }
@ -171,8 +171,8 @@ void MxCompositePresenter::VTable0x5c(MxNotificationParam& p_param)
if (*it == presenter) { if (*it == presenter) {
m_list.erase(it++); m_list.erase(it++);
if (presenter->GetCurrentTickleState() == TickleState_Idle) if (presenter->GetCurrentTickleState() == e_idle)
presenter->SetTickleState(TickleState_Ready); presenter->SetTickleState(e_ready);
MxDSActionList* actions = ((MxDSMultiAction*) m_action)->GetActionList(); MxDSActionList* actions = ((MxDSMultiAction*) m_action)->GetActionList();
MxDSActionListCursor cursor(actions); MxDSActionListCursor cursor(actions);
@ -186,8 +186,8 @@ void MxCompositePresenter::VTable0x5c(MxNotificationParam& p_param)
else { else {
if (m_action->IsA("MxDSSerialAction")) { if (m_action->IsA("MxDSSerialAction")) {
MxPresenter* presenter = *it; MxPresenter* presenter = *it;
if (presenter->GetCurrentTickleState() == TickleState_Idle) if (presenter->GetCurrentTickleState() == e_idle)
presenter->SetTickleState(TickleState_Ready); presenter->SetTickleState(e_ready);
} }
} }
@ -210,8 +210,8 @@ void MxCompositePresenter::VTable0x60(MxPresenter* p_presenter)
} }
else if (m_action->IsA("MxDSSerialAction")) { else if (m_action->IsA("MxDSSerialAction")) {
MxPresenter* presenter = *it; MxPresenter* presenter = *it;
if (presenter->GetCurrentTickleState() == TickleState_Idle) if (presenter->GetCurrentTickleState() == e_idle)
presenter->SetTickleState(TickleState_Ready); presenter->SetTickleState(e_ready);
} }
return; return;
} }
@ -227,7 +227,7 @@ void MxCompositePresenter::SetTickleState(TickleState p_tickleState)
MxPresenter* presenter = *it; MxPresenter* presenter = *it;
presenter->SetTickleState(p_tickleState); presenter->SetTickleState(p_tickleState);
if (m_action->IsA("MxDSSerialAction") && p_tickleState == TickleState_Ready) if (m_action->IsA("MxDSSerialAction") && p_tickleState == e_ready)
return; return;
} }
} }

View File

@ -65,7 +65,7 @@ MxStreamChunk* MxMediaPresenter::CurrentChunk()
m_subscriber->NextChunk(); m_subscriber->NextChunk();
m_subscriber->DestroyChunk(chunk); m_subscriber->DestroyChunk(chunk);
chunk = NULL; chunk = NULL;
ProgressTickleState(TickleState_Done); ProgressTickleState(e_done);
} }
} }
@ -84,7 +84,7 @@ MxStreamChunk* MxMediaPresenter::NextChunk()
m_action->SetFlags(m_action->GetFlags() | MxDSAction::Flag_Bit7); m_action->SetFlags(m_action->GetFlags() | MxDSAction::Flag_Bit7);
m_subscriber->DestroyChunk(chunk); m_subscriber->DestroyChunk(chunk);
chunk = NULL; chunk = NULL;
ProgressTickleState(TickleState_Done); ProgressTickleState(e_done);
} }
} }
@ -134,7 +134,7 @@ void MxMediaPresenter::EndAction()
if (m_action->GetFlags() & MxDSAction::Flag_World && if (m_action->GetFlags() & MxDSAction::Flag_World &&
(!m_compositePresenter || !m_compositePresenter->VTable0x64(2))) { (!m_compositePresenter || !m_compositePresenter->VTable0x64(2))) {
MxPresenter::Enable(FALSE); MxPresenter::Enable(FALSE);
SetTickleState(TickleState_Idle); SetTickleState(e_idle);
} }
else { else {
MxDSAction* action = m_action; MxDSAction* action = m_action;
@ -181,7 +181,7 @@ void MxMediaPresenter::StreamingTickle()
if (m_currentChunk->GetFlags() & MxDSChunk::Flag_End) { if (m_currentChunk->GetFlags() & MxDSChunk::Flag_End) {
m_subscriber->DestroyChunk(m_currentChunk); m_subscriber->DestroyChunk(m_currentChunk);
m_currentChunk = NULL; m_currentChunk = NULL;
ProgressTickleState(TickleState_Repeating); ProgressTickleState(e_repeating);
} }
else if (m_action->GetFlags() & MxDSAction::Flag_Looping) { else if (m_action->GetFlags() & MxDSAction::Flag_Looping) {
LoopChunk(m_currentChunk); LoopChunk(m_currentChunk);
@ -206,11 +206,11 @@ void MxMediaPresenter::RepeatingTickle()
if (m_currentChunk) { if (m_currentChunk) {
MxLong time = m_currentChunk->GetTime(); MxLong time = m_currentChunk->GetTime();
if (time <= m_action->GetElapsedTime() % m_action->GetLoopCount()) if (time <= m_action->GetElapsedTime() % m_action->GetLoopCount())
ProgressTickleState(TickleState_unk5); ProgressTickleState(e_unk5);
} }
else { else {
if (m_action->GetElapsedTime() >= m_action->GetStartTime() + m_action->GetDuration()) if (m_action->GetElapsedTime() >= m_action->GetStartTime() + m_action->GetDuration())
ProgressTickleState(TickleState_unk5); ProgressTickleState(e_unk5);
} }
} }
} }
@ -219,7 +219,7 @@ void MxMediaPresenter::RepeatingTickle()
void MxMediaPresenter::DoneTickle() void MxMediaPresenter::DoneTickle()
{ {
m_previousTickleStates |= 1 << m_currentTickleState; m_previousTickleStates |= 1 << m_currentTickleState;
m_currentTickleState = TickleState_Idle; m_currentTickleState = e_idle;
EndAction(); EndAction();
} }
@ -246,13 +246,13 @@ void MxMediaPresenter::Enable(MxBool p_enable)
if (p_enable) { if (p_enable) {
MxLong time = Timer()->GetTime(); MxLong time = Timer()->GetTime();
m_action->SetUnknown90(time); m_action->SetUnknown90(time);
SetTickleState(TickleState_Repeating); SetTickleState(e_repeating);
} }
else { else {
if (m_loopingChunkCursor) if (m_loopingChunkCursor)
m_loopingChunkCursor->Reset(); m_loopingChunkCursor->Reset();
m_currentChunk = NULL; m_currentChunk = NULL;
SetTickleState(TickleState_Done); SetTickleState(e_done);
} }
} }
} }

View File

@ -21,7 +21,7 @@ DECOMP_SIZE_ASSERT(MxPresenter, 0x40);
// FUNCTION: LEGO1 0x100b4d50 // FUNCTION: LEGO1 0x100b4d50
void MxPresenter::Init() void MxPresenter::Init()
{ {
m_currentTickleState = TickleState_Idle; m_currentTickleState = e_idle;
m_action = NULL; m_action = NULL;
m_location = MxPoint32(0, 0); m_location = MxPoint32(0, 0);
m_displayZ = 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_location = MxPoint32(this->m_action->GetLocation()[0], this->m_action->GetLocation()[1]);
this->m_displayZ = this->m_action->GetLocation()[2]; this->m_displayZ = this->m_action->GetLocation()[2];
ProgressTickleState(TickleState_Ready); ProgressTickleState(e_ready);
return SUCCESS; return SUCCESS;
} }
@ -70,7 +70,7 @@ void MxPresenter::EndAction()
this->m_action = NULL; this->m_action = NULL;
MxS32 previousTickleState = 1 << m_currentTickleState; MxS32 previousTickleState = 1 << m_currentTickleState;
this->m_previousTickleStates |= previousTickleState; this->m_previousTickleStates |= previousTickleState;
this->m_currentTickleState = TickleState_Idle; this->m_currentTickleState = e_idle;
} }
// FUNCTION: LEGO1 0x100b4fc0 // FUNCTION: LEGO1 0x100b4fc0
@ -130,32 +130,32 @@ MxResult MxPresenter::Tickle()
MxAutoLocker lock(&this->m_criticalSection); MxAutoLocker lock(&this->m_criticalSection);
switch (this->m_currentTickleState) { switch (this->m_currentTickleState) {
case TickleState_Ready: case e_ready:
this->ReadyTickle(); this->ReadyTickle();
if (m_currentTickleState != TickleState_Starting) if (m_currentTickleState != e_starting)
break; break;
case TickleState_Starting: case e_starting:
this->StartingTickle(); this->StartingTickle();
if (m_currentTickleState != TickleState_Streaming) if (m_currentTickleState != e_streaming)
break; break;
case TickleState_Streaming: case e_streaming:
this->StreamingTickle(); this->StreamingTickle();
if (m_currentTickleState != TickleState_Repeating) if (m_currentTickleState != e_repeating)
break; break;
case TickleState_Repeating: case e_repeating:
this->RepeatingTickle(); this->RepeatingTickle();
if (m_currentTickleState != TickleState_unk5) if (m_currentTickleState != e_unk5)
break; break;
case TickleState_unk5: case e_unk5:
this->Unk5Tickle(); this->Unk5Tickle();
if (m_currentTickleState != TickleState_Done) if (m_currentTickleState != e_done)
break; break;
case TickleState_Done: case e_done:
this->DoneTickle(); this->DoneTickle();
default: default:
break; break;

View File

@ -71,7 +71,7 @@ void MxEventPresenter::ReadyTickle()
CopyData(chunk); CopyData(chunk);
m_subscriber->DestroyChunk(chunk); m_subscriber->DestroyChunk(chunk);
ParseExtra(); ParseExtra();
ProgressTickleState(TickleState_Starting); ProgressTickleState(e_starting);
} }
} }
@ -81,7 +81,7 @@ void MxEventPresenter::StartingTickle()
MxStreamChunk* chunk = CurrentChunk(); MxStreamChunk* chunk = CurrentChunk();
if (chunk && m_action->GetElapsedTime() >= chunk->GetTime()) if (chunk && m_action->GetElapsedTime() >= chunk->GetTime())
ProgressTickleState(TickleState_Streaming); ProgressTickleState(e_streaming);
} }
// FUNCTION: LEGO1 0x100c2ef0 // FUNCTION: LEGO1 0x100c2ef0
@ -90,8 +90,8 @@ MxResult MxEventPresenter::PutData()
MxAutoLocker lock(&m_criticalSection); MxAutoLocker lock(&m_criticalSection);
if (IsEnabled()) { if (IsEnabled()) {
if (m_currentTickleState >= TickleState_Streaming && if (m_currentTickleState >= e_streaming &&
(m_currentTickleState <= TickleState_Repeating || m_currentTickleState == TickleState_Done)) { (m_currentTickleState <= e_repeating || m_currentTickleState == e_done)) {
if (m_currentChunk && m_currentChunk->GetLength()) { if (m_currentChunk && m_currentChunk->GetLength()) {
if (m_data[12] == 2) { if (m_data[12] == 2) {
const char* data = (const char*) m_currentChunk->GetData(); const char* data = (const char*) m_currentChunk->GetData();
@ -103,7 +103,7 @@ MxResult MxEventPresenter::PutData()
variableTable->SetVariable(key, value); variableTable->SetVariable(key, value);
} }
if (m_currentTickleState == TickleState_Streaming) if (m_currentTickleState == e_streaming)
m_subscriber->DestroyChunk(m_currentChunk); m_subscriber->DestroyChunk(m_currentChunk);
m_currentChunk = NULL; m_currentChunk = NULL;
} }

View File

@ -41,7 +41,7 @@ void MxLoopingFlcPresenter::NextFrame()
MxStreamChunk* chunk = NextChunk(); MxStreamChunk* chunk = NextChunk();
if (chunk->GetFlags() & MxDSChunk::Flag_End) if (chunk->GetFlags() & MxDSChunk::Flag_End)
ProgressTickleState(TickleState_Repeating); ProgressTickleState(e_repeating);
else { else {
LoadFrame(chunk); LoadFrame(chunk);
LoopChunk(chunk); LoopChunk(chunk);

View File

@ -52,7 +52,7 @@ void MxLoopingSmkPresenter::NextFrame()
MxStreamChunk* chunk = NextChunk(); MxStreamChunk* chunk = NextChunk();
if (chunk->GetFlags() & MxDSChunk::Flag_End) if (chunk->GetFlags() & MxDSChunk::Flag_End)
ProgressTickleState(TickleState_Repeating); ProgressTickleState(e_repeating);
else { else {
LoadFrame(chunk); LoadFrame(chunk);
LoopChunk(chunk); LoopChunk(chunk);
@ -66,7 +66,7 @@ void MxLoopingSmkPresenter::NextFrame()
void MxLoopingSmkPresenter::VTable0x8c() void MxLoopingSmkPresenter::VTable0x8c()
{ {
if (m_action->GetDuration() < m_elapsedDuration) if (m_action->GetDuration() < m_elapsedDuration)
ProgressTickleState(TickleState_unk5); ProgressTickleState(e_unk5);
else { else {
MxStreamChunk* chunk; MxStreamChunk* chunk;
m_loopingChunkCursor->Current(chunk); m_loopingChunkCursor->Current(chunk);
@ -108,7 +108,7 @@ void MxLoopingSmkPresenter::RepeatingTickle()
m_loopingChunkCursor->Next(chunk); m_loopingChunkCursor->Next(chunk);
if (m_currentTickleState != TickleState_Repeating) if (m_currentTickleState != e_repeating)
break; break;
} }
} }

View File

@ -109,7 +109,7 @@ void MxStillPresenter::StartingTickle()
{ {
MxVideoPresenter::StartingTickle(); MxVideoPresenter::StartingTickle();
if (m_currentTickleState == TickleState_Streaming && ((MxDSMediaAction*) m_action)->GetPaletteManagement()) if (m_currentTickleState == e_streaming && ((MxDSMediaAction*) m_action)->GetPaletteManagement())
RealizePalette(); RealizePalette();
} }
@ -121,7 +121,7 @@ void MxStillPresenter::StreamingTickle()
if (chunk && m_action->GetElapsedTime() >= chunk->GetTime()) { if (chunk && m_action->GetElapsedTime() >= chunk->GetTime()) {
m_chunkTime = chunk->GetTime(); m_chunkTime = chunk->GetTime();
NextFrame(); NextFrame();
ProgressTickleState(TickleState_Repeating); ProgressTickleState(e_repeating);
if (m_action->GetDuration() == -1 && m_compositePresenter) if (m_action->GetDuration() == -1 && m_compositePresenter)
m_compositePresenter->VTable0x60(this); m_compositePresenter->VTable0x60(this);
@ -133,7 +133,7 @@ void MxStillPresenter::RepeatingTickle()
{ {
if (m_action->GetDuration() != -1) { if (m_action->GetDuration() != -1) {
if (m_action->GetElapsedTime() >= m_action->GetStartTime() + m_action->GetDuration()) if (m_action->GetElapsedTime() >= m_action->GetStartTime() + m_action->GetDuration())
ProgressTickleState(TickleState_unk5); ProgressTickleState(e_unk5);
} }
} }

View File

@ -170,7 +170,7 @@ void MxVideoPresenter::NextFrame()
if (chunk->GetFlags() & MxDSChunk::Flag_End) { if (chunk->GetFlags() & MxDSChunk::Flag_End) {
m_subscriber->DestroyChunk(chunk); m_subscriber->DestroyChunk(chunk);
ProgressTickleState(TickleState_Repeating); ProgressTickleState(e_repeating);
} }
else { else {
LoadFrame(chunk); LoadFrame(chunk);
@ -387,7 +387,7 @@ void MxVideoPresenter::ReadyTickle()
LoadHeader(chunk); LoadHeader(chunk);
m_subscriber->DestroyChunk(chunk); m_subscriber->DestroyChunk(chunk);
ParseExtra(); ParseExtra();
ProgressTickleState(TickleState_Starting); ProgressTickleState(e_starting);
} }
} }
@ -398,7 +398,7 @@ void MxVideoPresenter::StartingTickle()
if (chunk && m_action->GetElapsedTime() >= chunk->GetTime()) { if (chunk && m_action->GetElapsedTime() >= chunk->GetTime()) {
CreateBitmap(); CreateBitmap();
ProgressTickleState(TickleState_Streaming); ProgressTickleState(e_streaming);
} }
} }
@ -431,7 +431,7 @@ void MxVideoPresenter::StreamingTickle()
m_currentChunk = NULL; m_currentChunk = NULL;
m_flags |= Flag_Bit1; m_flags |= Flag_Bit1;
if (m_currentTickleState != TickleState_Streaming) if (m_currentTickleState != e_streaming)
break; break;
} }
@ -469,7 +469,7 @@ void MxVideoPresenter::RepeatingTickle()
m_currentChunk = NULL; m_currentChunk = NULL;
m_flags |= Flag_Bit1; m_flags |= Flag_Bit1;
if (m_currentTickleState != TickleState_Repeating) if (m_currentTickleState != e_repeating)
break; break;
} }
@ -490,10 +490,10 @@ void MxVideoPresenter::Unk5Tickle()
m_unk0x60 = m_action->GetElapsedTime(); m_unk0x60 = m_action->GetElapsedTime();
if (m_action->GetElapsedTime() >= m_unk0x60 + ((MxDSMediaAction*) m_action)->GetSustainTime()) if (m_action->GetElapsedTime() >= m_unk0x60 + ((MxDSMediaAction*) m_action)->GetSustainTime())
ProgressTickleState(TickleState_Done); ProgressTickleState(e_done);
} }
else else
ProgressTickleState(TickleState_Done); ProgressTickleState(e_done);
} }
} }
@ -535,7 +535,7 @@ MxResult MxVideoPresenter::PutData()
{ {
MxAutoLocker lock(&m_criticalSection); MxAutoLocker lock(&m_criticalSection);
if (IsEnabled() && m_currentTickleState >= TickleState_Streaming && m_currentTickleState <= TickleState_unk5) if (IsEnabled() && m_currentTickleState >= e_streaming && m_currentTickleState <= e_unk5)
PutFrame(); PutFrame();
return SUCCESS; return SUCCESS;