Implement/match LegoAnimMMPresenter::FUN_1004b450 (#827)

This commit is contained in:
Christian Semmler 2024-04-20 11:18:19 -04:00 committed by GitHub
parent c617139d5b
commit 91d043a9ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 149 additions and 23 deletions

View file

@ -11,6 +11,17 @@ struct LegoTranInfo;
// SIZE 0x74
class LegoAnimMMPresenter : public MxCompositePresenter {
public:
enum {
e_unk0,
e_unk1,
e_unk2,
e_unk3,
e_unk4,
e_unk5,
e_unk6,
e_unk7
};
LegoAnimMMPresenter();
MxLong Notify(MxParam& p_param) override; // vtable+0x04
@ -45,11 +56,19 @@ class LegoAnimMMPresenter : public MxCompositePresenter {
private:
MxBool FUN_1004b450();
MxBool FUN_1004b530(MxLong p_time);
MxBool FUN_1004b570(MxLong p_time);
MxBool FUN_1004b580(MxLong p_time);
MxBool FUN_1004b5b0(MxLong p_time);
MxBool FUN_1004b600(MxLong p_time);
MxBool FUN_1004b610(MxLong p_time);
MxBool FUN_1004b6b0(MxLong p_time);
MxBool FUN_1004b6d0(MxLong p_time);
LegoAnimPresenter* m_unk0x4c; // 0x4c
undefined4 m_unk0x50; // 0x50
MxLong m_unk0x50; // 0x50
undefined4 m_unk0x54; // 0x54
undefined m_unk0x58; // 0x58
MxU8 m_unk0x58; // 0x58
MxBool m_unk0x59; // 0x59
MxU32 m_animmanId; // 0x5c
LegoTranInfo* m_tranInfo; // 0x60

View file

@ -30,7 +30,7 @@ LegoAnimMMPresenter::LegoAnimMMPresenter()
m_unk0x68 = 0;
m_unk0x6c = 0;
m_unk0x70 = 0;
m_unk0x58 = 0;
m_unk0x58 = e_unk0;
}
// FUNCTION: LEGO1 0x1004aaf0
@ -174,15 +174,15 @@ void LegoAnimMMPresenter::StreamingTickle()
void LegoAnimMMPresenter::RepeatingTickle()
{
if (m_unk0x4c == NULL) {
ProgressTickleState(e_unk5);
ProgressTickleState(e_freezing);
}
else if (m_list.size() <= 1) {
if (m_list.front() == m_unk0x4c) {
m_unk0x4c->SetTickleState(e_done);
ProgressTickleState(e_unk5);
ProgressTickleState(e_freezing);
}
else {
ProgressTickleState(e_unk5);
ProgressTickleState(e_freezing);
}
}
}
@ -244,12 +244,119 @@ void LegoAnimMMPresenter::ParseExtra()
}
}
// STUB: LEGO1 0x1004b450
// FUNCTION: LEGO1 0x1004b450
// FUNCTION: BETA10 0x1004c71d
MxBool LegoAnimMMPresenter::FUN_1004b450()
{
MxBool result = FALSE;
MxLong time = Timer()->GetTime() - m_unk0x50;
switch (m_unk0x58) {
case e_unk0:
if (!FUN_1004b530(time)) {
break;
}
m_unk0x58 = e_unk1;
case e_unk1:
if (!FUN_1004b570(time)) {
break;
}
m_unk0x58 = e_unk2;
case e_unk2:
if (!FUN_1004b580(time)) {
break;
}
m_unk0x58 = e_unk3;
case e_unk3:
if (!FUN_1004b5b0(time)) {
break;
}
m_unk0x58 = e_unk4;
case e_unk4:
if (!FUN_1004b600(time)) {
break;
}
m_unk0x58 = e_unk5;
case e_unk5:
if (!FUN_1004b610(time)) {
break;
}
m_unk0x58 = e_unk6;
case e_unk6:
if (!FUN_1004b6b0(time)) {
break;
}
m_unk0x58 = e_unk7;
case e_unk7:
FUN_1004b6d0(time);
result = TRUE;
}
return result;
}
// STUB: LEGO1 0x1004b530
// FUNCTION: BETA10 0x1004c8c4
MxBool LegoAnimMMPresenter::FUN_1004b530(MxLong p_time)
{
// TODO
return TRUE;
return FALSE;
}
// STUB: LEGO1 0x1004b570
// FUNCTION: BETA10 0x1004c9cc
MxBool LegoAnimMMPresenter::FUN_1004b570(MxLong p_time)
{
// TODO
return FALSE;
}
// STUB: LEGO1 0x1004b580
// FUNCTION: BETA10 0x1004ca3f
MxBool LegoAnimMMPresenter::FUN_1004b580(MxLong p_time)
{
// TODO
return FALSE;
}
// STUB: LEGO1 0x1004b5b0
// FUNCTION: BETA10 0x1004cb09
MxBool LegoAnimMMPresenter::FUN_1004b5b0(MxLong p_time)
{
// TODO
return FALSE;
}
// STUB: LEGO1 0x1004b600
// FUNCTION: BETA10 0x1004cbfb
MxBool LegoAnimMMPresenter::FUN_1004b600(MxLong p_time)
{
// TODO
return FALSE;
}
// STUB: LEGO1 0x1004b610
// FUNCTION: BETA10 0x1004cc6e
MxBool LegoAnimMMPresenter::FUN_1004b610(MxLong p_time)
{
// TODO
return FALSE;
}
// STUB: LEGO1 0x1004b6b0
// FUNCTION: BETA10 0x1004cdc5
MxBool LegoAnimMMPresenter::FUN_1004b6b0(MxLong p_time)
{
// TODO
return FALSE;
}
// STUB: LEGO1 0x1004b6d0
// FUNCTION: BETA10 0x1004ce18
MxBool LegoAnimMMPresenter::FUN_1004b6d0(MxLong p_time)
{
// TODO
return FALSE;
}
// FUNCTION: LEGO1 0x1004b8b0

View file

@ -152,7 +152,7 @@ MxResult MxCompositeMediaPresenter::Tickle()
break;
case e_streaming:
case e_repeating:
case e_unk5:
case e_freezing:
case e_done: {
for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++) {
(*it)->Tickle();

View file

@ -21,7 +21,7 @@ class MxPresenter : public MxCore {
e_starting,
e_streaming,
e_repeating,
e_unk5,
e_freezing,
e_done,
};
@ -62,10 +62,10 @@ class MxPresenter : public MxCore {
virtual void StreamingTickle() { ProgressTickleState(e_repeating); } // vtable+0x20
// FUNCTION: LEGO1 0x1000bea0
virtual void RepeatingTickle() { ProgressTickleState(e_unk5); } // vtable+0x24
virtual void RepeatingTickle() { ProgressTickleState(e_freezing); } // vtable+0x24
// FUNCTION: LEGO1 0x1000bec0
virtual void Unk5Tickle() { ProgressTickleState(e_done); } // vtable+0x28
virtual void FreezingTickle() { ProgressTickleState(e_done); } // vtable+0x28
protected:
// FUNCTION: LEGO1 0x1000bee0

View file

@ -32,7 +32,7 @@ class MxVideoPresenter : public MxMediaPresenter {
void StartingTickle() override; // vtable+0x1c
void StreamingTickle() override; // vtable+0x20
void RepeatingTickle() override; // vtable+0x24
void Unk5Tickle() override; // vtable+0x28
void FreezingTickle() override; // vtable+0x28
MxResult AddToManager() override; // vtable+0x34
// FUNCTION: LEGO1 0x1000c7a0

View file

@ -216,12 +216,12 @@ void MxMediaPresenter::RepeatingTickle()
if (m_currentChunk) {
MxLong time = m_currentChunk->GetTime();
if (time <= m_action->GetElapsedTime() % m_action->GetLoopCount()) {
ProgressTickleState(e_unk5);
ProgressTickleState(e_freezing);
}
}
else {
if (m_action->GetElapsedTime() >= m_action->GetStartTime() + m_action->GetDuration()) {
ProgressTickleState(e_unk5);
ProgressTickleState(e_freezing);
}
}
}

View file

@ -156,11 +156,11 @@ MxResult MxPresenter::Tickle()
case e_repeating:
this->RepeatingTickle();
if (m_currentTickleState != e_unk5) {
if (m_currentTickleState != e_freezing) {
break;
}
case e_unk5:
this->Unk5Tickle();
case e_freezing:
this->FreezingTickle();
if (m_currentTickleState != e_done) {
break;

View file

@ -57,7 +57,7 @@ void MxLoopingFlcPresenter::NextFrame()
void MxLoopingFlcPresenter::VTable0x88()
{
if (m_action->GetDuration() < m_elapsedDuration) {
ProgressTickleState(e_unk5);
ProgressTickleState(e_freezing);
}
else {
MxStreamChunk* chunk;

View file

@ -68,7 +68,7 @@ void MxLoopingSmkPresenter::NextFrame()
void MxLoopingSmkPresenter::VTable0x8c()
{
if (m_action->GetDuration() < m_elapsedDuration) {
ProgressTickleState(e_unk5);
ProgressTickleState(e_freezing);
}
else {
MxStreamChunk* chunk;

View file

@ -143,7 +143,7 @@ void MxStillPresenter::RepeatingTickle()
{
if (m_action->GetDuration() != -1) {
if (m_action->GetElapsedTime() >= m_action->GetStartTime() + m_action->GetDuration()) {
ProgressTickleState(e_unk5);
ProgressTickleState(e_freezing);
}
}
}

View file

@ -506,7 +506,7 @@ void MxVideoPresenter::RepeatingTickle()
}
// FUNCTION: LEGO1 0x100b3130
void MxVideoPresenter::Unk5Tickle()
void MxVideoPresenter::FreezingTickle()
{
MxLong sustainTime = ((MxDSMediaAction*) m_action)->GetSustainTime();
@ -564,7 +564,7 @@ MxResult MxVideoPresenter::PutData()
{
AUTOLOCK(m_criticalSection);
if (IsEnabled() && m_currentTickleState >= e_streaming && m_currentTickleState <= e_unk5) {
if (IsEnabled() && m_currentTickleState >= e_streaming && m_currentTickleState <= e_freezing) {
PutFrame();
}