Implement/match LegoAnimPresenter::StartingTickle (#601)

* Implement/match LegoAnimPresenter::StartingTickle

* Fix vtable

* Fix vtable
This commit is contained in:
Christian Semmler 2024-02-27 11:49:31 -05:00 committed by GitHub
parent 68893d67ed
commit c0a988b0fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 165 additions and 15 deletions

View file

@ -36,6 +36,8 @@ public:
// SYNTHETIC: LEGO1 0x1004aa40
// LegoAnimMMPresenter::`scalar deleting destructor'
MxBool FUN_1004b8b0();
};
#endif // LEGOANIMMMPRESENTER_H

View file

@ -13,6 +13,10 @@ class LegoAnimClass;
// SIZE 0xc0
class LegoAnimPresenter : public MxVideoPresenter {
public:
enum {
c_bit2 = 0x02
};
LegoAnimPresenter();
~LegoAnimPresenter() override;
@ -40,6 +44,15 @@ public:
void EndAction() override; // vtable+0x40
void PutFrame() override; // vtable+0x6c
virtual MxResult CreateAnim(MxStreamChunk* p_chunk); // vtable+0x88
virtual void VTable0x8c(); // vtable+0x8c
virtual void VTable0x90(); // vtable+0x90
virtual void VTable0x94(); // vtable+0x94
virtual void VTable0x98(); // vtable+0x98
// STUB: LEGO1 0x1000c990
virtual void VTable0x9c() {} // vtable+0x9c
virtual void VTable0xa0(); // vtable+0xa0
inline LegoAnim* GetAnimation() { return m_anim; }
@ -53,13 +66,18 @@ protected:
void FUN_100695c0();
LegoChar* FUN_100697c0(const LegoChar* p_und1, const LegoChar* p_und2);
LegoBool FUN_100698b0(const CompoundObject& p_und1, const LegoChar* p_und2);
void FUN_10069b10();
LegoBool FUN_1006aba0();
LegoBool FUN_1006abb0(LegoTreeNode*, undefined4);
void FUN_1006ac90();
void FUN_1006c8a0(LegoBool);
LegoAnim* m_anim; // 0x64
undefined4 m_unk0x68; // 0x68
undefined4* m_unk0x68; // 0x68
undefined4 m_unk0x6c; // 0x6c
LegoROIList* m_unk0x70; // 0x70
LegoROIList* m_unk0x74; // 0x74
undefined4 m_unk0x78; // 0x78
MxMatrix* m_unk0x78; // 0x78
undefined4 m_unk0x7c; // 0x7c
LegoWorld* m_currentWorld; // 0x80
MxAtomId m_animAtom; // 0x84
@ -68,7 +86,7 @@ protected:
undefined4 m_unk0x90; // 0x90
undefined m_unk0x94; // 0x94
undefined m_unk0x95; // 0x95
undefined m_unk0x96; // 0x96
MxBool m_unk0x96; // 0x96
undefined m_unk0x97; // 0x97
undefined4 m_unk0x98; // 0x98
MxS16 m_unk0x9c; // 0x9c

View file

@ -30,6 +30,8 @@ public:
void Destroy() override; // vtable+0x38
void EndAction() override; // vtable+0x40
void PutFrame() override; // vtable+0x6c
void VTable0x8c() override; // vtable+0x8c
void VTable0x90() override; // vtable+0x90
private:
void Init();

View file

@ -67,3 +67,10 @@ void LegoAnimMMPresenter::ParseExtra()
{
// TODO
}
// STUB: LEGO1 0x1004b8b0
MxBool LegoAnimMMPresenter::FUN_1004b8b0()
{
// TODO
return FALSE;
}

View file

@ -1,5 +1,6 @@
#include "legoanimpresenter.h"
#include "legoanimmmpresenter.h"
#include "legoomni.h"
#include "legounksavedatawriter.h"
#include "legovideomanager.h"
@ -7,6 +8,7 @@
#include "mxcompositepresenter.h"
#include "mxdsanim.h"
#include "mxstreamchunk.h"
#include "mxtimer.h"
#include "mxvideomanager.h"
DECOMP_SIZE_ASSERT(LegoAnimPresenter, 0xc0)
@ -27,11 +29,11 @@ LegoAnimPresenter::~LegoAnimPresenter()
void LegoAnimPresenter::Init()
{
m_anim = NULL;
m_unk0x68 = 0;
m_unk0x68 = NULL;
m_unk0x6c = 0;
m_unk0x74 = NULL;
m_unk0x70 = NULL;
m_unk0x78 = 0;
m_unk0x78 = NULL;
m_unk0x7c = 0;
m_unk0xa8.Clear();
m_unk0xa4 = 0;
@ -44,7 +46,7 @@ void LegoAnimPresenter::Init()
m_unk0x8c = 0;
m_unk0x90 = 0;
m_unk0x94 = 0;
m_unk0x96 = 1;
m_unk0x96 = TRUE;
m_unk0xa0 = 0;
}
@ -302,6 +304,31 @@ LegoBool LegoAnimPresenter::FUN_100698b0(const CompoundObject& p_und1, const Leg
return result;
}
// STUB: LEGO1 0x10069b10
void LegoAnimPresenter::FUN_10069b10()
{
// TODO
}
// FUNCTION: LEGO1 0x1006aba0
LegoBool LegoAnimPresenter::FUN_1006aba0()
{
return FUN_1006abb0(m_anim->GetRoot(), 0);
}
// STUB: LEGO1 0x1006abb0
LegoBool LegoAnimPresenter::FUN_1006abb0(LegoTreeNode*, undefined4)
{
// TODO
return FALSE;
}
// STUB: LEGO1 0x1006ac90
void LegoAnimPresenter::FUN_1006ac90()
{
// TODO
}
// STUB: LEGO1 0x1006ad30
void LegoAnimPresenter::PutFrame()
{
@ -332,12 +359,57 @@ void LegoAnimPresenter::ReadyTickle()
}
}
// STUB: LEGO1 0x1006b5e0
// FUNCTION: LEGO1 0x1006b5e0
void LegoAnimPresenter::StartingTickle()
{
// TODO
ProgressTickleState(e_streaming);
EndAction(); // Allow game to start
FUN_1006ac90();
FUN_100692b0();
FUN_100695c0();
if ((m_unk0x7c & c_bit2) == 0 || FUN_1006aba0()) {
FUN_10069b10();
FUN_1006c8a0(TRUE);
if (m_unk0x78 == NULL) {
if (fabs(m_action->GetDirection().GetX()) >= 0.00000047683716F ||
fabs(m_action->GetDirection().GetY()) >= 0.00000047683716F ||
fabs(m_action->GetDirection().GetZ()) >= 0.00000047683716F) {
m_unk0x78 = new MxMatrix();
CalcLocalTransform(m_action->GetLocation(), m_action->GetDirection(), m_action->GetUp(), *m_unk0x78);
}
else if (m_unk0x68) {
MxU8* und = (MxU8*) m_unk0x68[1];
if (und) {
MxMatrix mat;
mat = *(Matrix4*) (und + 0x10);
m_unk0x78 = new MxMatrix(mat);
}
}
}
if ((m_action->GetDuration() == -1 || ((MxDSMediaAction*) m_action)->GetSustainTime() == -1) &&
m_compositePresenter) {
m_compositePresenter->VTable0x60(this);
}
else {
m_action->SetUnknown90(Timer()->GetTime());
}
ProgressTickleState(e_streaming);
if (m_compositePresenter && m_compositePresenter->IsA("LegoAnimMMPresenter")) {
m_unk0x96 = ((LegoAnimMMPresenter*) m_compositePresenter)->FUN_1004b8b0();
m_compositePresenter->VTable0x60(this);
}
VTable0x8c();
}
if (m_unk0x70 != NULL) {
delete m_unk0x70;
m_unk0x70 = NULL;
}
}
// FUNCTION: LEGO1 0x1006b840
@ -393,6 +465,12 @@ void LegoAnimPresenter::ParseExtra()
// TODO
}
// STUB: LEGO1 0x1006c570
void LegoAnimPresenter::VTable0xa0()
{
// TODO
}
// FUNCTION: LEGO1 0x1006c620
MxResult LegoAnimPresenter::StartAction(MxStreamController* p_controller, MxDSAction* p_action)
{
@ -407,3 +485,33 @@ void LegoAnimPresenter::EndAction()
// TODO
MxVideoPresenter::EndAction();
}
// STUB: LEGO1 0x1006c7d0
void LegoAnimPresenter::VTable0x8c()
{
// TODO
}
// STUB: LEGO1 0x1006c860
void LegoAnimPresenter::VTable0x90()
{
// TODO
}
// STUB: LEGO1 0x1006c8a0
void LegoAnimPresenter::FUN_1006c8a0(LegoBool)
{
// TODO
}
// STUB: LEGO1 0x1006c8f0
void LegoAnimPresenter::VTable0x94()
{
// TODO
}
// STUB: LEGO1 0x1006ca50
void LegoAnimPresenter::VTable0x98()
{
// TODO
}

View file

@ -8,6 +8,18 @@ LegoHideAnimPresenter::LegoHideAnimPresenter()
Init();
}
// STUB: LEGO1 0x1006d860
void LegoHideAnimPresenter::VTable0x8c()
{
// TODO
}
// STUB: LEGO1 0x1006d870
void LegoHideAnimPresenter::VTable0x90()
{
// TODO
}
// FUNCTION: LEGO1 0x1006d9f0
LegoHideAnimPresenter::~LegoHideAnimPresenter()
{

View file

@ -41,7 +41,7 @@ void LegoLocomotionAnimPresenter::Destroy(MxBool p_fromDestructor)
delete m_unk0xc8;
}
m_unk0x68 = 0;
m_unk0x68 = NULL;
Init();
m_criticalSection.Leave();

View file

@ -43,7 +43,7 @@ public:
inline void EqualsCross(Mx3DPointFloat& p_a, Mx3DPointFloat& p_b) { EqualsCrossImpl(p_a.m_data, p_b.m_data); }
private:
float m_elements[3];
float m_elements[3]; // 0x08
};
// VTABLE: LEGO1 0x100d41e8

View file

@ -28,8 +28,9 @@ public:
// MxTimer::`scalar deleting destructor'
private:
MxLong m_startTime;
MxBool m_isRunning;
MxLong m_startTime; // 0x08
MxBool m_isRunning; // 0x0c
static MxLong g_lastTimeCalculated;
static MxLong g_lastTimeTimerStarted;
};

View file

@ -145,7 +145,7 @@ public:
inline const float& operator[](size_t idx) const { return m_data[idx]; }
protected:
float* m_data;
float* m_data; // 0x04
};
// VTABLE: LEGO1 0x100d4518