2023-06-29 04:10:08 -04:00
|
|
|
#include "mxloopingflcpresenter.h"
|
|
|
|
|
2023-07-02 03:00:28 -04:00
|
|
|
#include "decomp.h"
|
|
|
|
|
|
|
|
DECOMP_SIZE_ASSERT(MxLoopingFlcPresenter, 0x6c);
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100b4310
|
2023-06-29 04:10:08 -04:00
|
|
|
MxLoopingFlcPresenter::MxLoopingFlcPresenter()
|
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
Init();
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100b43b0
|
2023-06-29 04:10:08 -04:00
|
|
|
MxLoopingFlcPresenter::~MxLoopingFlcPresenter()
|
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
Destroy(TRUE);
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100b4410
|
2023-06-29 04:10:08 -04:00
|
|
|
void MxLoopingFlcPresenter::Init()
|
|
|
|
{
|
2023-12-13 05:48:14 -05:00
|
|
|
this->m_unk0x68 = 0;
|
2023-12-22 13:57:23 -05:00
|
|
|
this->m_flags &= ~Flag_Bit2;
|
|
|
|
this->m_flags &= ~Flag_Bit3;
|
2023-10-03 17:38:03 -04:00
|
|
|
}
|
|
|
|
|
2023-12-28 13:55:03 -05:00
|
|
|
// FUNCTION: LEGO1 0x100b4430
|
2023-10-13 12:43:45 -04:00
|
|
|
void MxLoopingFlcPresenter::Destroy(MxBool p_fromDestructor)
|
2023-10-03 17:38:03 -04:00
|
|
|
{
|
2023-12-28 13:55:03 -05:00
|
|
|
m_criticalSection.Enter();
|
|
|
|
Init();
|
|
|
|
m_criticalSection.Leave();
|
|
|
|
|
|
|
|
if (!p_fromDestructor)
|
|
|
|
MxFlcPresenter::Destroy(FALSE);
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
2023-11-29 07:35:32 -05:00
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100b4470
|
2023-11-29 07:35:32 -05:00
|
|
|
void MxLoopingFlcPresenter::NextFrame()
|
|
|
|
{
|
|
|
|
MxStreamChunk* chunk = NextChunk();
|
|
|
|
|
2024-01-02 13:32:01 -05:00
|
|
|
if (chunk->GetFlags() & MxDSChunk::Flag_End) {
|
2023-11-29 07:35:32 -05:00
|
|
|
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
|
|
|
|
m_currentTickleState = TickleState_Repeating;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
LoadFrame(chunk);
|
|
|
|
AppendChunk(chunk);
|
2023-12-13 05:48:14 -05:00
|
|
|
m_unk0x68 += m_flicHeader->speed;
|
2023-11-29 07:35:32 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
m_subscriber->FUN_100b8390(chunk);
|
|
|
|
}
|