Further clean up Omni/LegoOmni separation (#423)

* Fix inline functions

* Whitespace

* Try this

* Fix MxEntity

* Further fixes

* Move main out

* Replace tickle code
This commit is contained in:
Christian Semmler
2024-01-11 10:02:55 -05:00
committed by GitHub
parent 75f7791d6f
commit 516e16faf6
48 changed files with 285 additions and 485 deletions

View File

@@ -10,12 +10,6 @@ DECOMP_SIZE_ASSERT(MxBITMAPINFO, 0x428);
// (1998) GLOBAL: LEGO1 0x10102184
MxU16 g_bitmapSignature = TWOCC('B', 'M');
// FUNCTION: LEGO1 0x1004e0d0
int MxBitmap::VTable0x28(int)
{
return -1;
}
// FUNCTION: LEGO1 0x100bc980
MxBitmap::MxBitmap()
{

View File

@@ -40,10 +40,8 @@ void MxLoopingFlcPresenter::NextFrame()
{
MxStreamChunk* chunk = NextChunk();
if (chunk->GetFlags() & MxDSChunk::Flag_End) {
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Repeating;
}
if (chunk->GetFlags() & MxDSChunk::Flag_End)
ProgressTickleState(TickleState_Repeating);
else {
LoadFrame(chunk);
LoopChunk(chunk);

View File

@@ -51,10 +51,8 @@ void MxLoopingSmkPresenter::NextFrame()
{
MxStreamChunk* chunk = NextChunk();
if (chunk->GetFlags() & MxDSChunk::Flag_End) {
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Repeating;
}
if (chunk->GetFlags() & MxDSChunk::Flag_End)
ProgressTickleState(TickleState_Repeating);
else {
LoadFrame(chunk);
LoopChunk(chunk);
@@ -67,10 +65,8 @@ void MxLoopingSmkPresenter::NextFrame()
// FUNCTION: LEGO1 0x100b4a90
void MxLoopingSmkPresenter::VTable0x8c()
{
if (m_action->GetDuration() < m_elapsedDuration) {
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_unk5;
}
if (m_action->GetDuration() < m_elapsedDuration)
ProgressTickleState(TickleState_unk5);
else {
MxStreamChunk* chunk;
m_loopingChunkCursor->Current(chunk);

View File

@@ -13,12 +13,6 @@ DECOMP_SIZE_ASSERT(MxStillPresenter, 0x6c);
// GLOBAL: LEGO1 0x10101eb0
const char* g_strBmpIsmap = "BMP_ISMAP";
// FUNCTION: LEGO1 0x100435b0
void MxStillPresenter::Destroy()
{
Destroy(FALSE);
}
// FUNCTION: LEGO1 0x100b9c70
void MxStillPresenter::Destroy(MxBool p_fromDestructor)
{
@@ -127,8 +121,7 @@ void MxStillPresenter::StreamingTickle()
if (chunk && m_action->GetElapsedTime() >= chunk->GetTime()) {
m_chunkTime = chunk->GetTime();
NextFrame();
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Repeating;
ProgressTickleState(TickleState_Repeating);
if (m_action->GetDuration() == -1 && m_compositePresenter)
m_compositePresenter->VTable0x60(this);
@@ -139,10 +132,8 @@ void MxStillPresenter::StreamingTickle()
void MxStillPresenter::RepeatingTickle()
{
if (m_action->GetDuration() != -1) {
if (m_action->GetElapsedTime() >= m_action->GetStartTime() + m_action->GetDuration()) {
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_unk5;
}
if (m_action->GetElapsedTime() >= m_action->GetStartTime() + m_action->GetDuration())
ProgressTickleState(TickleState_unk5);
}
}

View File

@@ -8,66 +8,6 @@
DECOMP_SIZE_ASSERT(MxVideoPresenter, 0x64);
DECOMP_SIZE_ASSERT(MxVideoPresenter::AlphaMask, 0xc);
// FUNCTION: LEGO1 0x1000c700
void MxVideoPresenter::LoadHeader(MxStreamChunk* p_chunk)
{
// Empty
}
// FUNCTION: LEGO1 0x1000c710
void MxVideoPresenter::CreateBitmap()
{
// Empty
}
// FUNCTION: LEGO1 0x1000c720
void MxVideoPresenter::LoadFrame(MxStreamChunk* p_chunk)
{
// Empty
}
// FUNCTION: LEGO1 0x1000c730
void MxVideoPresenter::RealizePalette()
{
// Empty
}
// FUNCTION: LEGO1 0x1000c740
MxVideoPresenter::~MxVideoPresenter()
{
Destroy(TRUE);
}
// FUNCTION: LEGO1 0x1000c7a0
void MxVideoPresenter::Destroy()
{
Destroy(FALSE);
}
// FUNCTION: LEGO1 0x1000c7b0
LPDIRECTDRAWSURFACE MxVideoPresenter::VTable0x78()
{
return m_unk0x58;
}
// FUNCTION: LEGO1 0x1000c7c0
MxBool MxVideoPresenter::VTable0x7c()
{
return (m_bitmap != NULL) || (m_alpha != NULL);
}
// FUNCTION: LEGO1 0x1000c7e0
MxS32 MxVideoPresenter::GetWidth()
{
return m_alpha ? m_alpha->m_width : m_bitmap->GetBmiWidth();
}
// FUNCTION: LEGO1 0x1000c800
MxS32 MxVideoPresenter::GetHeight()
{
return m_alpha ? m_alpha->m_height : m_bitmap->GetBmiHeightAbs();
}
// FUNCTION: LEGO1 0x100b24f0
MxVideoPresenter::AlphaMask::AlphaMask(const MxBitmap& p_bitmap)
{
@@ -242,8 +182,7 @@ void MxVideoPresenter::NextFrame()
if (chunk->GetFlags() & MxDSChunk::Flag_End) {
m_subscriber->DestroyChunk(chunk);
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Repeating;
ProgressTickleState(TickleState_Repeating);
}
else {
LoadFrame(chunk);
@@ -460,8 +399,7 @@ void MxVideoPresenter::ReadyTickle()
LoadHeader(chunk);
m_subscriber->DestroyChunk(chunk);
ParseExtra();
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Starting;
ProgressTickleState(TickleState_Starting);
}
}
@@ -472,8 +410,7 @@ void MxVideoPresenter::StartingTickle()
if (chunk && m_action->GetElapsedTime() >= chunk->GetTime()) {
CreateBitmap();
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Streaming;
ProgressTickleState(TickleState_Streaming);
}
}
@@ -564,15 +501,11 @@ void MxVideoPresenter::Unk5Tickle()
if (m_unk0x60 == -1)
m_unk0x60 = m_action->GetElapsedTime();
if (m_action->GetElapsedTime() >= m_unk0x60 + ((MxDSMediaAction*) m_action)->GetSustainTime()) {
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Done;
}
}
else {
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Done;
if (m_action->GetElapsedTime() >= m_unk0x60 + ((MxDSMediaAction*) m_action)->GetSustainTime())
ProgressTickleState(TickleState_Done);
}
else
ProgressTickleState(TickleState_Done);
}
}