Add another function that makes use of the FLIC header

This commit is contained in:
Christian Semmler 2023-11-29 07:25:54 -05:00
parent 0e6b084b81
commit 4e85f5d395
4 changed files with 40 additions and 13 deletions

View File

@ -11,7 +11,7 @@ DECOMP_SIZE_ASSERT(MxFlcPresenter, 0x68);
// OFFSET: LEGO1 0x100b3310 // OFFSET: LEGO1 0x100b3310
MxFlcPresenter::MxFlcPresenter() MxFlcPresenter::MxFlcPresenter()
{ {
this->m_unk64 = 0; this->m_flicHeader = NULL;
this->m_flags &= 0xfd; this->m_flags &= 0xfd;
this->m_flags &= 0xfb; this->m_flags &= 0xfb;
} }
@ -19,20 +19,26 @@ MxFlcPresenter::MxFlcPresenter()
// OFFSET: LEGO1 0x100b3420 // OFFSET: LEGO1 0x100b3420
MxFlcPresenter::~MxFlcPresenter() MxFlcPresenter::~MxFlcPresenter()
{ {
if (this->m_unk64) { if (this->m_flicHeader) {
delete this->m_unk64; delete this->m_flicHeader;
} }
} }
// OFFSET: LEGO1 0x100b34d0 // OFFSET: LEGO1 0x100b3490
void MxFlcPresenter::vtable60() void MxFlcPresenter::LoadHeader(MxStreamChunk* p_chunk)
{ {
if(m_bitmap) m_flicHeader = (FLIC_HEADER*) new MxU8[p_chunk->GetLength()];
memcpy(m_flicHeader, p_chunk->GetData(), p_chunk->GetLength());
}
// OFFSET: LEGO1 0x100b34d0
void MxFlcPresenter::CreateBitmap()
{
if (m_bitmap)
delete m_bitmap; delete m_bitmap;
m_bitmap = new MxBitmap; m_bitmap = new MxBitmap;
m_bitmap->SetSize(m_flicHeader->width, m_flicHeader->height, NULL, FALSE);
m_bitmap->SetSize(m_unk64->width, m_unk64->height, NULL, FALSE);
} }
// OFFSET: LEGO1 0x100b3620 // OFFSET: LEGO1 0x100b3620

View File

@ -2,11 +2,10 @@
#define MXFLCPRESENTER_H #define MXFLCPRESENTER_H
#include "decomp.h" #include "decomp.h"
#include "mxvideopresenter.h"
#include <flic.h> #include <flic.h>
#include "mxvideopresenter.h"
// VTABLE 0x100dc2c0 // VTABLE 0x100dc2c0
// SIZE 0x68 // SIZE 0x68
class MxFlcPresenter : public MxVideoPresenter { class MxFlcPresenter : public MxVideoPresenter {
@ -27,10 +26,12 @@ class MxFlcPresenter : public MxVideoPresenter {
return "MxFlcPresenter"; return "MxFlcPresenter";
} }
virtual void vtable60() override; // vtable+0x60 virtual void LoadHeader(MxStreamChunk* p_chunk) override; // vtable+0x5c
virtual void VTable0x70() override; // vtable+0x70 virtual void CreateBitmap() override; // vtable+0x60
virtual void VTable0x70() override; // vtable+0x70
FLIC_HEADER* m_unk64; // 0x64 - what we believe so far. Could be another custom structure like MxSmack. protected:
FLIC_HEADER* m_flicHeader;
}; };
#endif // MXFLCPRESENTER_H #endif // MXFLCPRESENTER_H

View File

@ -29,3 +29,21 @@ void MxLoopingFlcPresenter::Destroy(MxBool p_fromDestructor)
{ {
// TODO // TODO
} }
// OFFSET: LEGO1 0x100b4470
void MxLoopingFlcPresenter::NextFrame()
{
MxStreamChunk* chunk = NextChunk();
if (chunk->GetFlags() & MxStreamChunk::Flag_Bit2) {
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Repeating;
}
else {
LoadFrame(chunk);
AppendChunk(chunk);
m_unk68 += m_flicHeader->speed;
}
m_subscriber->FUN_100b8390(chunk);
}

View File

@ -18,6 +18,8 @@ class MxLoopingFlcPresenter : public MxFlcPresenter {
return "MxLoopingFlcPresenter"; return "MxLoopingFlcPresenter";
} }
virtual void NextFrame() override; // vtable+0x64
private: private:
void Init(); void Init();
void Destroy(MxBool p_fromDestructor); void Destroy(MxBool p_fromDestructor);