mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-26 09:54:18 +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:
@@ -34,7 +34,7 @@ void MxDisplaySurface::Init()
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100ba640
|
||||
void MxDisplaySurface::FUN_100ba640()
|
||||
void MxDisplaySurface::ClearScreen()
|
||||
{
|
||||
MxS32 backBuffers;
|
||||
DDSURFACEDESC desc;
|
||||
|
||||
@@ -12,8 +12,8 @@ DECOMP_SIZE_ASSERT(MxFlcPresenter, 0x68);
|
||||
MxFlcPresenter::MxFlcPresenter()
|
||||
{
|
||||
this->m_flicHeader = NULL;
|
||||
this->m_flags &= ~Flag_Bit2;
|
||||
this->m_flags &= ~Flag_Bit3;
|
||||
this->m_flags &= ~c_bit2;
|
||||
this->m_flags &= ~c_bit3;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100b3420
|
||||
|
||||
@@ -20,8 +20,8 @@ MxLoopingFlcPresenter::~MxLoopingFlcPresenter()
|
||||
void MxLoopingFlcPresenter::Init()
|
||||
{
|
||||
this->m_unk0x68 = 0;
|
||||
this->m_flags &= ~Flag_Bit2;
|
||||
this->m_flags &= ~Flag_Bit3;
|
||||
this->m_flags &= ~c_bit2;
|
||||
this->m_flags &= ~c_bit3;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100b4430
|
||||
@@ -40,8 +40,8 @@ void MxLoopingFlcPresenter::NextFrame()
|
||||
{
|
||||
MxStreamChunk* chunk = NextChunk();
|
||||
|
||||
if (chunk->GetFlags() & MxDSChunk::Flag_End)
|
||||
ProgressTickleState(TickleState_Repeating);
|
||||
if (chunk->GetFlags() & MxDSChunk::c_end)
|
||||
ProgressTickleState(e_repeating);
|
||||
else {
|
||||
LoadFrame(chunk);
|
||||
LoopChunk(chunk);
|
||||
|
||||
@@ -21,8 +21,8 @@ MxLoopingSmkPresenter::~MxLoopingSmkPresenter()
|
||||
void MxLoopingSmkPresenter::Init()
|
||||
{
|
||||
this->m_elapsedDuration = 0;
|
||||
this->m_flags &= ~Flag_Bit2;
|
||||
this->m_flags &= ~Flag_Bit3;
|
||||
this->m_flags &= ~c_bit2;
|
||||
this->m_flags &= ~c_bit3;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100b49d0
|
||||
@@ -51,8 +51,8 @@ void MxLoopingSmkPresenter::NextFrame()
|
||||
{
|
||||
MxStreamChunk* chunk = NextChunk();
|
||||
|
||||
if (chunk->GetFlags() & MxDSChunk::Flag_End)
|
||||
ProgressTickleState(TickleState_Repeating);
|
||||
if (chunk->GetFlags() & MxDSChunk::c_end)
|
||||
ProgressTickleState(e_repeating);
|
||||
else {
|
||||
LoadFrame(chunk);
|
||||
LoopChunk(chunk);
|
||||
@@ -66,7 +66,7 @@ void MxLoopingSmkPresenter::NextFrame()
|
||||
void MxLoopingSmkPresenter::VTable0x8c()
|
||||
{
|
||||
if (m_action->GetDuration() < m_elapsedDuration)
|
||||
ProgressTickleState(TickleState_unk5);
|
||||
ProgressTickleState(e_unk5);
|
||||
else {
|
||||
MxStreamChunk* chunk;
|
||||
m_loopingChunkCursor->Current(chunk);
|
||||
@@ -108,7 +108,7 @@ void MxLoopingSmkPresenter::RepeatingTickle()
|
||||
|
||||
m_loopingChunkCursor->Next(chunk);
|
||||
|
||||
if (m_currentTickleState != TickleState_Repeating)
|
||||
if (m_currentTickleState != e_repeating)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ void MxSmkPresenter::Init()
|
||||
{
|
||||
m_currentFrame = 0;
|
||||
memset(&m_mxSmack, 0, sizeof(m_mxSmack));
|
||||
m_flags &= ~Flag_Bit2;
|
||||
m_flags &= ~Flag_Bit3;
|
||||
m_flags &= ~c_bit2;
|
||||
m_flags &= ~c_bit3;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100b3900
|
||||
|
||||
@@ -75,13 +75,13 @@ void MxStillPresenter::LoadFrame(MxStreamChunk* p_chunk)
|
||||
MxRect32 rect(x, y, width + x, height + y);
|
||||
MVideoManager()->InvalidateRect(rect);
|
||||
|
||||
if (m_flags & Flag_Bit2) {
|
||||
if (m_flags & c_bit2) {
|
||||
undefined4 und = 0;
|
||||
m_unk0x58 = MxOmni::GetInstance()->GetVideoManager()->GetDisplaySurface()->VTable0x44(
|
||||
m_bitmap,
|
||||
&und,
|
||||
(m_flags & Flag_Bit4) / 8,
|
||||
m_action->GetFlags() & MxDSAction::Flag_Bit4
|
||||
(m_flags & c_bit4) / 8,
|
||||
m_action->GetFlags() & MxDSAction::c_bit4
|
||||
);
|
||||
|
||||
delete m_alpha;
|
||||
@@ -91,9 +91,9 @@ void MxStillPresenter::LoadFrame(MxStreamChunk* p_chunk)
|
||||
m_bitmap = NULL;
|
||||
|
||||
if (m_unk0x58 && und)
|
||||
m_flags |= Flag_Bit3;
|
||||
m_flags |= c_bit3;
|
||||
else
|
||||
m_flags &= ~Flag_Bit3;
|
||||
m_flags &= ~c_bit3;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ void MxStillPresenter::StartingTickle()
|
||||
{
|
||||
MxVideoPresenter::StartingTickle();
|
||||
|
||||
if (m_currentTickleState == TickleState_Streaming && ((MxDSMediaAction*) m_action)->GetPaletteManagement())
|
||||
if (m_currentTickleState == e_streaming && ((MxDSMediaAction*) m_action)->GetPaletteManagement())
|
||||
RealizePalette();
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ void MxStillPresenter::StreamingTickle()
|
||||
if (chunk && m_action->GetElapsedTime() >= chunk->GetTime()) {
|
||||
m_chunkTime = chunk->GetTime();
|
||||
NextFrame();
|
||||
ProgressTickleState(TickleState_Repeating);
|
||||
ProgressTickleState(e_repeating);
|
||||
|
||||
if (m_action->GetDuration() == -1 && m_compositePresenter)
|
||||
m_compositePresenter->VTable0x60(this);
|
||||
@@ -134,7 +134,7 @@ void MxStillPresenter::RepeatingTickle()
|
||||
{
|
||||
if (m_action->GetDuration() != -1) {
|
||||
if (m_action->GetElapsedTime() >= m_action->GetStartTime() + m_action->GetDuration())
|
||||
ProgressTickleState(TickleState_unk5);
|
||||
ProgressTickleState(e_unk5);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,8 +185,8 @@ void MxStillPresenter::ParseExtra()
|
||||
{
|
||||
MxPresenter::ParseExtra();
|
||||
|
||||
if (m_action->GetFlags() & MxDSAction::Flag_Bit5)
|
||||
m_flags |= Flag_Bit4;
|
||||
if (m_action->GetFlags() & MxDSAction::c_bit5)
|
||||
m_flags |= c_bit4;
|
||||
|
||||
MxU32 len = m_action->GetExtraLength();
|
||||
|
||||
@@ -207,9 +207,9 @@ void MxStillPresenter::ParseExtra()
|
||||
}
|
||||
|
||||
if (KeyValueStringParse(output, g_strBmpIsmap, buf)) {
|
||||
m_flags |= Flag_Bit5;
|
||||
m_flags &= ~Flag_Bit2;
|
||||
m_flags &= ~Flag_Bit3;
|
||||
m_flags |= c_bit5;
|
||||
m_flags &= ~c_bit2;
|
||||
m_flags &= ~c_bit3;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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