mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 08:24:16 +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:
@@ -117,16 +117,16 @@ void MxVideoPresenter::Init()
|
||||
m_unk0x5c = 1;
|
||||
m_unk0x58 = NULL;
|
||||
m_unk0x60 = -1;
|
||||
m_flags &= ~Flag_Bit1;
|
||||
m_flags &= ~c_bit1;
|
||||
|
||||
if (MVideoManager() != NULL) {
|
||||
MVideoManager();
|
||||
m_flags |= Flag_Bit2;
|
||||
m_flags &= ~Flag_Bit3;
|
||||
m_flags |= c_bit2;
|
||||
m_flags &= ~c_bit3;
|
||||
}
|
||||
|
||||
m_flags &= ~Flag_Bit4;
|
||||
m_flags &= ~Flag_Bit5;
|
||||
m_flags &= ~c_bit4;
|
||||
m_flags &= ~c_bit5;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100b27b0
|
||||
@@ -138,8 +138,8 @@ void MxVideoPresenter::Destroy(MxBool p_fromDestructor)
|
||||
if (m_unk0x58) {
|
||||
m_unk0x58->Release();
|
||||
m_unk0x58 = NULL;
|
||||
m_flags &= ~Flag_Bit2;
|
||||
m_flags &= ~Flag_Bit3;
|
||||
m_flags &= ~c_bit2;
|
||||
m_flags &= ~c_bit3;
|
||||
}
|
||||
|
||||
if (MVideoManager() && (m_alpha || m_bitmap)) {
|
||||
@@ -168,9 +168,9 @@ void MxVideoPresenter::NextFrame()
|
||||
{
|
||||
MxStreamChunk* chunk = NextChunk();
|
||||
|
||||
if (chunk->GetFlags() & MxDSChunk::Flag_End) {
|
||||
if (chunk->GetFlags() & MxDSChunk::c_end) {
|
||||
m_subscriber->DestroyChunk(chunk);
|
||||
ProgressTickleState(TickleState_Repeating);
|
||||
ProgressTickleState(e_repeating);
|
||||
}
|
||||
else {
|
||||
LoadFrame(chunk);
|
||||
@@ -182,7 +182,7 @@ void MxVideoPresenter::NextFrame()
|
||||
MxBool MxVideoPresenter::IsHit(MxS32 p_x, MxS32 p_y)
|
||||
{
|
||||
MxDSAction* action = GetAction();
|
||||
if ((action == NULL) || (((action->GetFlags() & MxDSAction::Flag_Bit11) == 0) && !IsEnabled()) ||
|
||||
if ((action == NULL) || (((action->GetFlags() & MxDSAction::c_bit11) == 0) && !IsEnabled()) ||
|
||||
(!m_bitmap && !m_alpha))
|
||||
return FALSE;
|
||||
|
||||
@@ -234,7 +234,7 @@ MxBool MxVideoPresenter::IsHit(MxS32 p_x, MxS32 p_y)
|
||||
if (m_flags & 0x10)
|
||||
return (MxBool) *pixel;
|
||||
|
||||
if ((GetAction()->GetFlags() & MxDSAction::Flag_Bit4) && *pixel == 0)
|
||||
if ((GetAction()->GetFlags() & MxDSAction::c_bit4) && *pixel == 0)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
@@ -284,7 +284,7 @@ void MxVideoPresenter::PutFrame()
|
||||
LPDIRECTDRAWSURFACE ddSurface = displaySurface->GetDirectDrawSurface2();
|
||||
|
||||
MxRect32 rectSrc, rectDest;
|
||||
if (m_action->GetFlags() & MxDSAction::Flag_Bit5) {
|
||||
if (m_action->GetFlags() & MxDSAction::c_bit5) {
|
||||
if (m_unk0x58) {
|
||||
// TODO: Match
|
||||
rectSrc.SetPoint(MxPoint32(0, 0));
|
||||
@@ -340,7 +340,7 @@ void MxVideoPresenter::PutFrame()
|
||||
rectDest.SetBottom(rectDest.GetTop() + regionRect->GetHeight());
|
||||
}
|
||||
|
||||
if (m_action->GetFlags() & MxDSAction::Flag_Bit4) {
|
||||
if (m_action->GetFlags() & MxDSAction::c_bit4) {
|
||||
if (m_unk0x58) {
|
||||
if (PrepareRects(rectDest, rectSrc) >= 0)
|
||||
ddSurface->Blt((LPRECT) &rectDest, m_unk0x58, (LPRECT) &rectSrc, DDBLT_KEYSRC, NULL);
|
||||
@@ -387,7 +387,7 @@ void MxVideoPresenter::ReadyTickle()
|
||||
LoadHeader(chunk);
|
||||
m_subscriber->DestroyChunk(chunk);
|
||||
ParseExtra();
|
||||
ProgressTickleState(TickleState_Starting);
|
||||
ProgressTickleState(e_starting);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -398,14 +398,14 @@ void MxVideoPresenter::StartingTickle()
|
||||
|
||||
if (chunk && m_action->GetElapsedTime() >= chunk->GetTime()) {
|
||||
CreateBitmap();
|
||||
ProgressTickleState(TickleState_Streaming);
|
||||
ProgressTickleState(e_streaming);
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100b2fe0
|
||||
void MxVideoPresenter::StreamingTickle()
|
||||
{
|
||||
if (m_action->GetFlags() & MxDSAction::Flag_Bit10) {
|
||||
if (m_action->GetFlags() & MxDSAction::c_bit10) {
|
||||
if (!m_currentChunk)
|
||||
MxMediaPresenter::StreamingTickle();
|
||||
|
||||
@@ -429,13 +429,13 @@ void MxVideoPresenter::StreamingTickle()
|
||||
LoadFrame(m_currentChunk);
|
||||
m_subscriber->DestroyChunk(m_currentChunk);
|
||||
m_currentChunk = NULL;
|
||||
m_flags |= Flag_Bit1;
|
||||
m_flags |= c_bit1;
|
||||
|
||||
if (m_currentTickleState != TickleState_Streaming)
|
||||
if (m_currentTickleState != e_streaming)
|
||||
break;
|
||||
}
|
||||
|
||||
if (m_flags & Flag_Bit1)
|
||||
if (m_flags & c_bit1)
|
||||
m_unk0x5c = 5;
|
||||
}
|
||||
}
|
||||
@@ -444,7 +444,7 @@ void MxVideoPresenter::StreamingTickle()
|
||||
void MxVideoPresenter::RepeatingTickle()
|
||||
{
|
||||
if (IsEnabled()) {
|
||||
if (m_action->GetFlags() & MxDSAction::Flag_Bit10) {
|
||||
if (m_action->GetFlags() & MxDSAction::c_bit10) {
|
||||
if (!m_currentChunk)
|
||||
MxMediaPresenter::RepeatingTickle();
|
||||
|
||||
@@ -467,13 +467,13 @@ void MxVideoPresenter::RepeatingTickle()
|
||||
|
||||
LoadFrame(m_currentChunk);
|
||||
m_currentChunk = NULL;
|
||||
m_flags |= Flag_Bit1;
|
||||
m_flags |= c_bit1;
|
||||
|
||||
if (m_currentTickleState != TickleState_Repeating)
|
||||
if (m_currentTickleState != e_repeating)
|
||||
break;
|
||||
}
|
||||
|
||||
if (m_flags & Flag_Bit1)
|
||||
if (m_flags & c_bit1)
|
||||
m_unk0x5c = 5;
|
||||
}
|
||||
}
|
||||
@@ -490,10 +490,10 @@ void MxVideoPresenter::Unk5Tickle()
|
||||
m_unk0x60 = m_action->GetElapsedTime();
|
||||
|
||||
if (m_action->GetElapsedTime() >= m_unk0x60 + ((MxDSMediaAction*) m_action)->GetSustainTime())
|
||||
ProgressTickleState(TickleState_Done);
|
||||
ProgressTickleState(e_done);
|
||||
}
|
||||
else
|
||||
ProgressTickleState(TickleState_Done);
|
||||
ProgressTickleState(e_done);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -535,7 +535,7 @@ MxResult MxVideoPresenter::PutData()
|
||||
{
|
||||
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();
|
||||
|
||||
return SUCCESS;
|
||||
|
Reference in New Issue
Block a user