mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-24 17:04:17 +00:00
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:
committed by
GitHub
parent
75f7791d6f
commit
516e16faf6
@@ -19,8 +19,7 @@ void LegoActionControlPresenter::ReadyTickle()
|
||||
|
||||
if (chunk) {
|
||||
ParseExtra();
|
||||
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
|
||||
m_currentTickleState = TickleState_Starting;
|
||||
ProgressTickleState(TickleState_Starting);
|
||||
|
||||
m_subscriber->DestroyChunk(chunk);
|
||||
if (m_compositePresenter) {
|
||||
@@ -47,8 +46,7 @@ void LegoActionControlPresenter::RepeatingTickle()
|
||||
#else
|
||||
InvokeAction(m_unk0x50, MxAtomId(m_unk0x54.GetData(), LookupMode_LowerCase2), m_unk0x64, NULL);
|
||||
#endif
|
||||
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
|
||||
m_currentTickleState = TickleState_Done;
|
||||
ProgressTickleState(TickleState_Done);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -123,8 +123,7 @@ void MxCompositeMediaPresenter::StartingTickle()
|
||||
}
|
||||
|
||||
if (!m_unk0x4c) {
|
||||
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
|
||||
m_currentTickleState = TickleState_Streaming;
|
||||
ProgressTickleState(TickleState_Streaming);
|
||||
MxLong time = Timer()->GetTime();
|
||||
m_action->SetUnknown90(time);
|
||||
}
|
||||
@@ -138,8 +137,7 @@ MxResult MxCompositeMediaPresenter::Tickle()
|
||||
|
||||
switch (m_currentTickleState) {
|
||||
case TickleState_Ready:
|
||||
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
|
||||
m_currentTickleState = TickleState_Starting;
|
||||
ProgressTickleState(TickleState_Starting);
|
||||
case TickleState_Starting:
|
||||
StartingTickle();
|
||||
break;
|
||||
|
||||
111
LEGO1/lego/legoomni/src/control/mxcontrolpresenter.cpp
Normal file
111
LEGO1/lego/legoomni/src/control/mxcontrolpresenter.cpp
Normal file
@@ -0,0 +1,111 @@
|
||||
#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);
|
||||
ProgressTickleState(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;
|
||||
}
|
||||
@@ -69,8 +69,7 @@ void LegoEntityPresenter::ReadyTickle()
|
||||
m_objectBackend->SetLocation(m_action->GetLocation(), m_action->GetDirection(), m_action->GetUp(), TRUE);
|
||||
ParseExtra();
|
||||
}
|
||||
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
|
||||
m_currentTickleState = TickleState_Starting;
|
||||
ProgressTickleState(TickleState_Starting);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -95,8 +95,7 @@ void LegoWorldPresenter::ReadyTickle()
|
||||
}
|
||||
|
||||
ParseExtra();
|
||||
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
|
||||
m_currentTickleState = TickleState_Starting;
|
||||
ProgressTickleState(TickleState_Starting);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10066ac0
|
||||
@@ -116,8 +115,7 @@ void LegoWorldPresenter::StartingTickle()
|
||||
}
|
||||
}
|
||||
|
||||
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
|
||||
m_currentTickleState = TickleState_Streaming;
|
||||
ProgressTickleState(TickleState_Streaming);
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10067a70
|
||||
|
||||
@@ -241,6 +241,20 @@ void SetIsWorldActive(MxBool p_isWorldActive)
|
||||
g_isWorldActive = p_isWorldActive;
|
||||
}
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1001a700
|
||||
void FUN_1001a700()
|
||||
{
|
||||
@@ -685,9 +699,3 @@ void LegoOmni::StopTimer()
|
||||
MxOmni::StopTimer();
|
||||
SetAppCursor(0);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100acf50
|
||||
MxResult Start(MxDSAction* p_dsAction)
|
||||
{
|
||||
return MxOmni::GetInstance()->Start(p_dsAction);
|
||||
}
|
||||
|
||||
@@ -76,8 +76,8 @@ void LegoPalettePresenter::ReadyTickle()
|
||||
if (chunk) {
|
||||
if (chunk->GetTime() <= m_action->GetElapsedTime()) {
|
||||
ParseExtra();
|
||||
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
|
||||
m_currentTickleState = TickleState_Starting;
|
||||
ProgressTickleState(TickleState_Starting);
|
||||
|
||||
chunk = m_subscriber->NextChunk();
|
||||
MxResult result = ParsePalette(chunk);
|
||||
m_subscriber->DestroyChunk(chunk);
|
||||
|
||||
Reference in New Issue
Block a user