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

@@ -5,12 +5,6 @@ DECOMP_SIZE_ASSERT(MxAudioManager, 0x30);
// GLOBAL: LEGO1 0x10102108
MxS32 MxAudioManager::g_count = 0;
// FUNCTION: LEGO1 0x10029910
MxS32 MxAudioManager::GetVolume()
{
return this->m_volume;
}
// FUNCTION: LEGO1 0x100b8d00
MxAudioManager::MxAudioManager()
{

View File

@@ -3,15 +3,3 @@
#include "decomp.h"
DECOMP_SIZE_ASSERT(MxAudioPresenter, 0x54);
// FUNCTION: LEGO1 0x1000d260
MxS32 MxAudioPresenter::GetVolume()
{
return m_volume;
}
// FUNCTION: LEGO1 0x1000d270
void MxAudioPresenter::SetVolume(MxS32 p_volume)
{
m_volume = p_volume;
}

View File

@@ -20,10 +20,8 @@ void MxLoopingMIDIPresenter::StreamingTickle()
return;
}
if (m_chunk->GetTime() + m_action->GetDuration() <= m_action->GetElapsedTime()) {
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Done;
}
if (m_chunk->GetTime() + m_action->GetDuration() <= m_action->GetElapsedTime())
ProgressTickleState(TickleState_Done);
}
// FUNCTION: LEGO1 0x100c2ae0

View File

@@ -52,8 +52,7 @@ void MxMIDIPresenter::ReadyTickle()
if (chunk) {
m_subscriber->DestroyChunk(chunk);
ParseExtra();
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Starting;
ProgressTickleState(TickleState_Starting);
}
}
@@ -62,19 +61,15 @@ void MxMIDIPresenter::StartingTickle()
{
MxStreamChunk* chunk = CurrentChunk();
if (chunk && m_action->GetElapsedTime() >= chunk->GetTime()) {
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Streaming;
}
if (chunk && m_action->GetElapsedTime() >= chunk->GetTime())
ProgressTickleState(TickleState_Streaming);
}
// FUNCTION: LEGO1 0x100c2910
void MxMIDIPresenter::StreamingTickle()
{
if (m_chunk) {
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Done;
}
if (m_chunk)
ProgressTickleState(TickleState_Done);
else
m_chunk = NextChunk();
}

View File

@@ -5,18 +5,6 @@
DECOMP_SIZE_ASSERT(MxSoundPresenter, 0x54)
// FUNCTION: LEGO1 0x1000d430
MxSoundPresenter::~MxSoundPresenter()
{
Destroy(TRUE);
}
// FUNCTION: LEGO1 0x1000d490
void MxSoundPresenter::Destroy()
{
Destroy(FALSE);
}
// FUNCTION: LEGO1 0x100b1a50
void MxSoundPresenter::Destroy(MxBool p_fromDestructor)
{

View File

@@ -11,24 +11,6 @@
DECOMP_SIZE_ASSERT(MxWavePresenter, 0x6c);
DECOMP_SIZE_ASSERT(MxWavePresenter::WaveFormat, 0x1c);
// FUNCTION: LEGO1 0x1000d640
MxWavePresenter::~MxWavePresenter()
{
Destroy(TRUE);
}
// FUNCTION: LEGO1 0x1000d6a0
void MxWavePresenter::Destroy()
{
Destroy(FALSE);
}
// FUNCTION: LEGO1 0x1000d6b0
MxBool MxWavePresenter::IsPaused()
{
return m_paused;
}
// FUNCTION: LEGO1 0x100b1ad0
void MxWavePresenter::Init()
{
@@ -136,8 +118,7 @@ void MxWavePresenter::ReadyTickle()
memcpy(m_waveFormat, chunk->GetData(), chunk->GetLength());
m_subscriber->DestroyChunk(chunk);
ParseExtra();
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Starting;
ProgressTickleState(TickleState_Starting);
}
}
@@ -188,8 +169,7 @@ void MxWavePresenter::StartingTickle()
}
else {
SetVolume(((MxDSSound*) m_action)->GetVolume());
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Streaming;
ProgressTickleState(TickleState_Streaming);
}
}
}

View File

@@ -8,14 +8,6 @@
DECOMP_SIZE_ASSERT(MxCompositePresenter, 0x4c);
// FUNCTION: LEGO1 0x1000caf0
MxBool MxCompositePresenter::VTable0x64(undefined4 p_undefined)
{
if (m_compositePresenter)
return m_compositePresenter->VTable0x64(p_undefined);
return TRUE;
}
// FUNCTION: LEGO1 0x100b60b0
MxCompositePresenter::MxCompositePresenter()
{
@@ -229,8 +221,7 @@ void MxCompositePresenter::VTable0x60(MxPresenter* p_presenter)
// FUNCTION: LEGO1 0x100b6bc0
void MxCompositePresenter::SetTickleState(TickleState p_tickleState)
{
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = p_tickleState;
ProgressTickleState(p_tickleState);
for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++) {
MxPresenter* presenter = *it;

View File

@@ -2,12 +2,6 @@
#include "define.h"
// FUNCTION: LEGO1 0x10001f70
MxResult MxCore::Tickle()
{
return SUCCESS;
}
// FUNCTION: LEGO1 0x100ae1a0
MxCore::MxCore()
{

View File

@@ -11,18 +11,6 @@ DECOMP_SIZE_ASSERT(MxMediaPresenter, 0x50);
DECOMP_SIZE_ASSERT(MxStreamChunkList, 0x18);
DECOMP_SIZE_ASSERT(MxStreamChunkListCursor, 0x10);
// FUNCTION: LEGO1 0x1000c550
MxMediaPresenter::~MxMediaPresenter()
{
Destroy(TRUE);
}
// FUNCTION: LEGO1 0x1000c5b0
void MxMediaPresenter::Destroy()
{
Destroy(FALSE);
}
// FUNCTION: LEGO1 0x100b54e0
void MxMediaPresenter::Init()
{
@@ -77,8 +65,7 @@ MxStreamChunk* MxMediaPresenter::CurrentChunk()
m_subscriber->NextChunk();
m_subscriber->DestroyChunk(chunk);
chunk = NULL;
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Done;
ProgressTickleState(TickleState_Done);
}
}
@@ -97,8 +84,7 @@ MxStreamChunk* MxMediaPresenter::NextChunk()
m_action->SetFlags(m_action->GetFlags() | MxDSAction::Flag_Bit7);
m_subscriber->DestroyChunk(chunk);
chunk = NULL;
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Done;
ProgressTickleState(TickleState_Done);
}
}
@@ -195,8 +181,7 @@ void MxMediaPresenter::StreamingTickle()
if (m_currentChunk->GetFlags() & MxDSChunk::Flag_End) {
m_subscriber->DestroyChunk(m_currentChunk);
m_currentChunk = NULL;
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Repeating;
ProgressTickleState(TickleState_Repeating);
}
else if (m_action->GetFlags() & MxDSAction::Flag_Looping) {
LoopChunk(m_currentChunk);
@@ -220,16 +205,12 @@ void MxMediaPresenter::RepeatingTickle()
if (m_currentChunk) {
MxLong time = m_currentChunk->GetTime();
if (time <= m_action->GetElapsedTime() % m_action->GetLoopCount()) {
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_unk5;
}
if (time <= m_action->GetElapsedTime() % m_action->GetLoopCount())
ProgressTickleState(TickleState_unk5);
}
else {
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

@@ -18,96 +18,11 @@
DECOMP_SIZE_ASSERT(MxPresenter, 0x40);
// FUNCTION: LEGO1 0x1000be30
void MxPresenter::VTable0x14()
{
}
// FUNCTION: LEGO1 0x1000be40
void MxPresenter::ReadyTickle()
{
ParseExtra();
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Starting;
}
// FUNCTION: LEGO1 0x1000be60
void MxPresenter::StartingTickle()
{
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Streaming;
}
// FUNCTION: LEGO1 0x1000be80
void MxPresenter::StreamingTickle()
{
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Repeating;
}
// FUNCTION: LEGO1 0x1000bea0
void MxPresenter::RepeatingTickle()
{
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_unk5;
}
// FUNCTION: LEGO1 0x1000bec0
void MxPresenter::Unk5Tickle()
{
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Done;
}
// FUNCTION: LEGO1 0x1000bee0
void MxPresenter::DoneTickle()
{
m_previousTickleStates |= 1 << m_currentTickleState;
m_currentTickleState = TickleState_Idle;
}
// FUNCTION: LEGO1 0x1000bf00
#ifdef COMPAT_MODE
MxPresenter::~MxPresenter()
{
}
// FUNCTION: LEGO1 0x1000bf70
MxResult MxPresenter::AddToManager()
{
return SUCCESS;
}
// FUNCTION: LEGO1 0x1000bf80
void MxPresenter::Destroy()
{
Init();
}
// FUNCTION: LEGO1 0x1000bf90
void MxPresenter::SetTickleState(TickleState p_tickleState)
{
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = p_tickleState;
}
// FUNCTION: LEGO1 0x1000bfb0
MxBool MxPresenter::HasTickleStatePassed(TickleState p_tickleState)
{
return m_previousTickleStates & (1 << (unsigned char) p_tickleState);
}
// FUNCTION: LEGO1 0x1000bfc0
MxResult MxPresenter::PutData()
{
return SUCCESS;
}
// FUNCTION: LEGO1 0x1000bfd0
MxBool MxPresenter::IsHit(MxS32 p_x, MxS32 p_y)
{
return FALSE;
}
#endif
// FUNCTION: LEGO1 0x100b4d50
void MxPresenter::Init()
@@ -132,8 +47,7 @@ MxResult MxPresenter::StartAction(MxStreamController*, MxDSAction* p_action)
this->m_location = MxPoint32(this->m_action->GetLocation()[0], this->m_action->GetLocation()[1]);
this->m_displayZ = this->m_action->GetLocation()[2];
this->m_previousTickleStates |= 1 << (unsigned char) previousTickleState;
this->m_currentTickleState = TickleState_Ready;
ProgressTickleState(TickleState_Ready);
return SUCCESS;
}

View File

@@ -4,21 +4,3 @@
#include "mxstring.h"
DECOMP_SIZE_ASSERT(MxVariable, 0x24)
// FUNCTION: LEGO1 0x1003bea0
MxString* MxVariable::GetValue()
{
return &m_value;
}
// FUNCTION: LEGO1 0x1003beb0
void MxVariable::SetValue(const char* p_value)
{
m_value = p_value;
}
// FUNCTION: LEGO1 0x1003bec0
void MxVariable::Destroy()
{
delete this;
}

View File

@@ -1,113 +0,0 @@
#include "mxcontrolpresenter.h"
#include "mxticklemanager.h"
DECOMP_SIZE_ASSERT(MxControlPresenter, 0x5c)
// FUNCTION: LEGO1 0x10043f50
MxControlPresenter::MxControlPresenter()
{
this->m_unk0x4c = 0;
this->m_unk0x4e = -1;
this->m_unk0x50 = FALSE;
this->m_unk0x52 = 0;
this->m_unk0x58 = 0;
this->m_unk0x54 = 0;
}
// FUNCTION: LEGO1 0x10043fd0
void MxControlPresenter::RepeatingTickle()
{
// empty
}
// FUNCTION: LEGO1 0x10043fe0
MxBool MxControlPresenter::VTable0x64(undefined4 p_undefined)
{
return m_unk0x50;
}
// FUNCTION: LEGO1 0x10043ff0
void MxControlPresenter::VTable0x68(MxBool p_undefined)
{
m_unk0x50 = p_undefined;
}
// FUNCTION: LEGO1 0x10044110
MxControlPresenter::~MxControlPresenter()
{
if (m_unk0x58)
delete m_unk0x58;
}
// FUNCTION: LEGO1 0x10044180
MxResult MxControlPresenter::AddToManager()
{
m_unk0x4e = 0;
return SUCCESS;
}
// STUB: LEGO1 0x10044190
MxResult MxControlPresenter::StartAction(MxStreamController*, MxDSAction*)
{
// TODO
return SUCCESS;
}
// FUNCTION: LEGO1 0x10044260
void MxControlPresenter::EndAction()
{
if (m_action) {
m_unk0x50 = TRUE;
MxCompositePresenter::EndAction();
}
}
// STUB: LEGO1 0x10044270
MxBool MxControlPresenter::FUN_10044270(undefined4, undefined4, undefined4*)
{
// TODO
return TRUE;
}
// STUB: LEGO1 0x10044480
MxBool MxControlPresenter::FUN_10044480(undefined4, undefined4*)
{
// TODO
return TRUE;
}
// STUB: LEGO1 0x10044540
void MxControlPresenter::FUN_10044540(undefined2)
{
// TODO
}
// FUNCTION: LEGO1 0x10044610
void MxControlPresenter::ReadyTickle()
{
MxPresenter::ParseExtra();
TickleManager()->UnregisterClient(this);
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Repeating;
}
// STUB: LEGO1 0x10044640
void MxControlPresenter::ParseExtra()
{
// TODO
}
// STUB: LEGO1 0x10044820
void MxControlPresenter::Enable(MxBool p_enable)
{
// TODO
}
// STUB: LEGO1 0x100448a0
MxBool MxControlPresenter::HasTickleStatePassed(TickleState p_tickleState)
{
// TODO
return TRUE;
}

View File

@@ -1,22 +1,3 @@
#include "mxentity.h"
DECOMP_SIZE_ASSERT(MxEntity, 0x10)
// FUNCTION: LEGO1 0x10001070
MxResult MxEntity::Create(MxS32 p_id, const MxAtomId& p_atom)
{
this->m_mxEntityId = p_id;
this->m_atom = p_atom;
return SUCCESS;
}
// FUNCTION: LEGO1 0x1000c110
MxEntity::~MxEntity()
{
}
// FUNCTION: LEGO1 0x1001d190
MxEntity::MxEntity()
{
this->m_mxEntityId = -1;
}

View File

@@ -71,8 +71,7 @@ void MxEventPresenter::ReadyTickle()
CopyData(chunk);
m_subscriber->DestroyChunk(chunk);
ParseExtra();
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Starting;
ProgressTickleState(TickleState_Starting);
}
}
@@ -81,10 +80,8 @@ void MxEventPresenter::StartingTickle()
{
MxStreamChunk* chunk = NextChunk();
if (chunk && m_action->GetElapsedTime() >= chunk->GetTime()) {
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Streaming;
}
if (chunk && m_action->GetElapsedTime() >= chunk->GetTime())
ProgressTickleState(TickleState_Streaming);
}
// FUNCTION: LEGO1 0x100c2ef0

View File

@@ -1,7 +0,0 @@
#include <windows.h>
// FUNCTION: LEGO1 0x10091ee0
__declspec(dllexport) BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
return TRUE;
}

View File

@@ -27,26 +27,6 @@ MxBool g_use3dSound;
// GLOBAL: LEGO1 0x101015b0
MxOmni* MxOmni::g_instance = NULL;
// FUNCTION: LEGO1 0x100159e0
void DeleteObjects(MxAtomId* p_id, MxS32 p_first, MxS32 p_last)
{
MxDSAction action;
action.SetAtomId(*p_id);
action.SetUnknown24(-2);
for (MxS32 first = p_first, last = p_last; first <= last; first++) {
action.SetObjectId(first);
DeleteObject(action);
}
}
// FUNCTION: LEGO1 0x10058a90
MxBool MxOmni::IsTimerRunning()
{
return m_timerRunning;
}
// FUNCTION: LEGO1 0x100acea0
MxObjectFactory* ObjectFactory()
{
@@ -113,6 +93,12 @@ MxEventManager* EventManager()
return MxOmni::GetInstance()->GetEventManager();
}
// FUNCTION: LEGO1 0x100acf50
MxResult Start(MxDSAction* p_dsAction)
{
return MxOmni::GetInstance()->Start(p_dsAction);
}
// FUNCTION: LEGO1 0x100acf70
void DeleteObject(MxDSAction& p_dsAction)
{

View File

@@ -3,18 +3,6 @@
DECOMP_SIZE_ASSERT(MxActionNotificationParam, 0x14)
DECOMP_SIZE_ASSERT(MxEndActionNotificationParam, 0x14)
// FUNCTION: LEGO1 0x100510c0
MxNotificationParam* MxActionNotificationParam::Clone()
{
return new MxActionNotificationParam(this->m_type, this->m_sender, this->m_action, this->m_realloc);
}
// FUNCTION: LEGO1 0x10051270
MxNotificationParam* MxEndActionNotificationParam::Clone()
{
return new MxEndActionNotificationParam(c_notificationEndAction, this->m_sender, this->m_action, this->m_realloc);
}
// FUNCTION: LEGO1 0x100b0300
MxNotificationParam* MxStartActionNotificationParam::Clone()
{

View File

@@ -3,9 +3,3 @@
#include "decomp.h"
DECOMP_SIZE_ASSERT(MxNotificationParam, 0xc);
// FUNCTION: LEGO1 0x10010390
MxNotificationParam* MxNotificationParam::Clone()
{
return new MxNotificationParam(m_type, m_sender);
}

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);
}
}