mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 16:34:06 +00:00
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:
@@ -60,12 +60,12 @@ MxStreamChunk* MxMediaPresenter::CurrentChunk()
|
||||
if (m_subscriber) {
|
||||
chunk = m_subscriber->CurrentChunk();
|
||||
|
||||
if (chunk && chunk->GetFlags() & MxDSChunk::Flag_Bit3) {
|
||||
m_action->SetFlags(m_action->GetFlags() | MxDSAction::Flag_Bit7);
|
||||
if (chunk && chunk->GetFlags() & MxDSChunk::c_bit3) {
|
||||
m_action->SetFlags(m_action->GetFlags() | MxDSAction::c_bit7);
|
||||
m_subscriber->NextChunk();
|
||||
m_subscriber->DestroyChunk(chunk);
|
||||
chunk = NULL;
|
||||
ProgressTickleState(TickleState_Done);
|
||||
ProgressTickleState(e_done);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,11 +80,11 @@ MxStreamChunk* MxMediaPresenter::NextChunk()
|
||||
if (m_subscriber) {
|
||||
chunk = m_subscriber->NextChunk();
|
||||
|
||||
if (chunk && chunk->GetFlags() & MxDSChunk::Flag_Bit3) {
|
||||
m_action->SetFlags(m_action->GetFlags() | MxDSAction::Flag_Bit7);
|
||||
if (chunk && chunk->GetFlags() & MxDSChunk::c_bit3) {
|
||||
m_action->SetFlags(m_action->GetFlags() | MxDSAction::c_bit7);
|
||||
m_subscriber->DestroyChunk(chunk);
|
||||
chunk = NULL;
|
||||
ProgressTickleState(TickleState_Done);
|
||||
ProgressTickleState(e_done);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ MxResult MxMediaPresenter::StartAction(MxStreamController* p_controller, MxDSAct
|
||||
MxAutoLocker lock(&m_criticalSection);
|
||||
|
||||
if (MxPresenter::StartAction(p_controller, p_action) == SUCCESS) {
|
||||
if (m_action->GetFlags() & MxDSAction::Flag_Looping) {
|
||||
if (m_action->GetFlags() & MxDSAction::c_looping) {
|
||||
m_loopingChunks = new MxStreamChunkList;
|
||||
m_loopingChunkCursor = new MxStreamChunkListCursor(m_loopingChunks);
|
||||
|
||||
@@ -131,10 +131,9 @@ void MxMediaPresenter::EndAction()
|
||||
|
||||
m_currentChunk = NULL;
|
||||
|
||||
if (m_action->GetFlags() & MxDSAction::Flag_World &&
|
||||
(!m_compositePresenter || !m_compositePresenter->VTable0x64(2))) {
|
||||
if (m_action->GetFlags() & MxDSAction::c_world && (!m_compositePresenter || !m_compositePresenter->VTable0x64(2))) {
|
||||
MxPresenter::Enable(FALSE);
|
||||
SetTickleState(TickleState_Idle);
|
||||
SetTickleState(e_idle);
|
||||
}
|
||||
else {
|
||||
MxDSAction* action = m_action;
|
||||
@@ -178,12 +177,12 @@ void MxMediaPresenter::StreamingTickle()
|
||||
m_currentChunk = NextChunk();
|
||||
|
||||
if (m_currentChunk) {
|
||||
if (m_currentChunk->GetFlags() & MxDSChunk::Flag_End) {
|
||||
if (m_currentChunk->GetFlags() & MxDSChunk::c_end) {
|
||||
m_subscriber->DestroyChunk(m_currentChunk);
|
||||
m_currentChunk = NULL;
|
||||
ProgressTickleState(TickleState_Repeating);
|
||||
ProgressTickleState(e_repeating);
|
||||
}
|
||||
else if (m_action->GetFlags() & MxDSAction::Flag_Looping) {
|
||||
else if (m_action->GetFlags() & MxDSAction::c_looping) {
|
||||
LoopChunk(m_currentChunk);
|
||||
|
||||
if (!IsEnabled()) {
|
||||
@@ -206,11 +205,11 @@ void MxMediaPresenter::RepeatingTickle()
|
||||
if (m_currentChunk) {
|
||||
MxLong time = m_currentChunk->GetTime();
|
||||
if (time <= m_action->GetElapsedTime() % m_action->GetLoopCount())
|
||||
ProgressTickleState(TickleState_unk5);
|
||||
ProgressTickleState(e_unk5);
|
||||
}
|
||||
else {
|
||||
if (m_action->GetElapsedTime() >= m_action->GetStartTime() + m_action->GetDuration())
|
||||
ProgressTickleState(TickleState_unk5);
|
||||
ProgressTickleState(e_unk5);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -219,7 +218,7 @@ void MxMediaPresenter::RepeatingTickle()
|
||||
void MxMediaPresenter::DoneTickle()
|
||||
{
|
||||
m_previousTickleStates |= 1 << m_currentTickleState;
|
||||
m_currentTickleState = TickleState_Idle;
|
||||
m_currentTickleState = e_idle;
|
||||
EndAction();
|
||||
}
|
||||
|
||||
@@ -246,13 +245,13 @@ void MxMediaPresenter::Enable(MxBool p_enable)
|
||||
if (p_enable) {
|
||||
MxLong time = Timer()->GetTime();
|
||||
m_action->SetUnknown90(time);
|
||||
SetTickleState(TickleState_Repeating);
|
||||
SetTickleState(e_repeating);
|
||||
}
|
||||
else {
|
||||
if (m_loopingChunkCursor)
|
||||
m_loopingChunkCursor->Reset();
|
||||
m_currentChunk = NULL;
|
||||
SetTickleState(TickleState_Done);
|
||||
SetTickleState(e_done);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user