push changes

This commit is contained in:
Misha 2024-01-14 16:04:48 -05:00
parent 7f7e6e37dd
commit e6d01ad012
No known key found for this signature in database
GPG Key ID: 8441D12AEF33FED8
3 changed files with 278 additions and 3 deletions

View File

@ -1,12 +1,16 @@
#ifndef LEGOANIMPRESENTER_H
#define LEGOANIMPRESENTER_H
#include "mxgeometry/mxgeometry3d.h"
#include "mxvideopresenter.h"
class LegoWorld;
// VTABLE: LEGO1 0x100d90c8
class LegoAnimPresenter : public MxVideoPresenter {
public:
LegoAnimPresenter();
virtual ~LegoAnimPresenter() override;
// FUNCTION: LEGO1 0x10068530
inline virtual const char* ClassName() const override // vtable+0x0c
@ -21,8 +25,71 @@ class LegoAnimPresenter : public MxVideoPresenter {
return !strcmp(p_name, LegoAnimPresenter::ClassName()) || MxVideoPresenter::IsA(p_name);
}
virtual void ReadyTickle() override; // vtable+0x18
virtual void StartingTickle() override; // vtable+0x1c
virtual void StreamingTickle() override; // vtable+0x20
virtual void ParseExtra() override; // vtable+0x30
virtual void Destroy() override; // vtable+0x38
virtual MxResult StartAction(MxStreamController*, MxDSAction*) override; // vtable+0x3c
virtual void EndAction() override; // vtable+0x40
virtual void PutFrame(); // vtable+0x6c
virtual MxS32 VTable0x88(MxStreamChunk* p_chunk); // vtable+0x88
private:
void Init();
void Destroy(MxBool p_fromDestructor);
LegoAnimClass* m_unk0x64; // 0x64
undefined4 m_unk0x68; // 0x68
undefined4 m_unk0x6c; // 0x6c
undefined4 m_unk0x70; // 0x70
undefined4 m_unk0x74; // 0x74
undefined4 m_unk0x78; // 0x78
undefined4 m_unk0x7c; // 0x7c
LegoWorld* m_currentWorld; // 0x80
MxAtomId m_animAtom; // 0x84
undefined4 m_unk0x88; // 0x88
undefined4 m_unk0x8c; // 0x8c
undefined4 m_unk0x90; // 0x90
undefined m_unk0x94; // 0x94
undefined m_unk0x95; // 0x95
undefined m_unk0x96; // 0x96
undefined m_unk0x97; // 0x97
undefined4 m_unk0x98; // 0x98
MxS16 m_unk0x9c; // 0x9f
undefined4 m_unk0xa0; // 0xa0
undefined4 m_unk0xa4; // 0xa4
Mx3DPointFloat m_vec; // 0xa8
undefined4 m_unk0xbc; // 0xbc
};
// VTALBE: LEGO1 0x100db768
class LegoAnimClassBase {
public:
LegoAnimClassBase();
virtual ~LegoAnimClassBase();
virtual void VTable0x4();
virtual void VTable0x8();
virtual void VTable0xc();
undefined4 m_unk0x4;
};
// VTALBE: LEGO1 0x100db8d8
class LegoAnimClass {
public:
LegoAnimClass();
virtual ~LegoAnimClass() override;
virtual void VTable0x8() override;
virtual void VTable0xc() override;
virtual MxResult VTable0x10() override;
undefined4 m_unk0x8;
undefined4 m_unk0xc;
undefined4 m_unk0x10;
undefined4 m_unk0x14;
};
#endif // LEGOANIMPRESENTER_H

View File

@ -1,13 +1,217 @@
#include "legoanimpresenter.h"
// STUB: LEGO1 0x10068420
#include "legoomni.h"
#include "legostream.h"
#include "legoworld.h"
#include "mxdsanim.h"
#include "mxstreamchunk.h"
DECOMP_SIZE_ASSERT(LegoAnimPresenter, 0xc0);
// FUNCTION: LEGO1 0x10068420
LegoAnimPresenter::LegoAnimPresenter()
{
Init();
}
// FUNCTION: LEGO1 0x10068670
LegoAnimPresenter::~LegoAnimPresenter()
{
Destroy(TRUE);
}
// FUNCTION: LEGO1 0x100686f0
void LegoAnimPresenter::Init()
{
m_unk0x64 = NULL;
m_unk0x68 = 0;
m_unk0x6c = 0;
m_unk0x74 = 0;
m_unk0x70 = 0;
m_unk0x78 = 0;
m_unk0x7c = 0;
m_vec.Clear();
m_unk0xa4 = 0;
m_currentWorld = NULL;
m_unk0x95 = 0;
m_unk0x88 = -1;
m_unk0x98 = 0;
m_animAtom.Clear();
m_unk0x9c = 0;
m_unk0x8c = 0;
m_unk0x90 = 0;
m_unk0x94 = 0;
m_unk0x96 = 1;
m_unk0xa0 = 0;
}
// STUB: LEGO1 0x10068770
void LegoAnimPresenter::Destroy(MxBool p_fromDestructor)
{
// TODO
return MxVideoPresenter::Destroy(p_fromDestructor);
}
// FUNCTION: LEGO1 0x1006b550
void LegoAnimPresenter::ReadyTickle()
{
m_currentWorld = GetCurrentWorld();
if (m_currentWorld) {
MxStreamChunk* chunk = m_subscriber->CurrentChunk();
if (chunk) {
if (chunk->GetTime() + m_action->GetStartTime() <= m_action->GetElapsedTime()) {
chunk = m_subscriber->NextChunk();
MxU32 result = VTable0x88(chunk);
m_subscriber->DestroyChunk(chunk);
if (result == 0) {
ProgressTickleState(TickleState_Starting);
ParseExtra();
}
else {
EndAction();
}
}
}
}
}
// STUB: LEGO1 0x1006c620
MxResult LegoAnimPresenter::StartAction(MxStreamController* p_controller, MxDSAction* p_action)
{
// TODO
return MxVideoPresenter::StartAction(p_controller, p_action);
}
// STUB: LEGO1 0x1006b5e0
void LegoAnimPresenter::StartingTickle()
{
// TODO
}
// STUB: LEGO1 0x100686f0
void LegoAnimPresenter::Init()
// STUB: LEGO1 0x1006b840
void LegoAnimPresenter::StreamingTickle()
{
// TODO
}
// STUB: LEGO1 0x1006bac0
void LegoAnimPresenter::ParseExtra()
{
// TODO
}
// FUNCTION: LEGO1 0x1006b8e0
void LegoAnimPresenter::Destroy()
{
Destroy(FALSE);
}
// STUB: LEGO1 0x1006c640
void LegoAnimPresenter::EndAction()
{
// TODO
}
// STUB: LEGO1 0x1006ad30
void LegoAnimPresenter::PutFrame()
{
// TODO
}
// STUB: LEGO1 0x10068fb0
MxS32 LegoAnimPresenter::VTable0x88(MxStreamChunk* p_chunk)
{
LegoMemoryStream stream((char*) p_chunk->GetData());
MxS32 val = 0;
MxS32 val2 = 0;
MxS32 result = -1;
if (stream.Read(&val, sizeof(MxS32)) == SUCCESS && val == 0x11) {
if (stream.Read(&m_unk0xa4, sizeof(MxU32)) == SUCCESS) {
if (stream.Read(m_vec.GetX(), sizeof(float)) == SUCCESS) {
if (stream.Read(m_vec.GetY(), sizeof(float)) == SUCCESS) {
if (stream.Read(m_vec.GetZ(), sizeof(float)) == SUCCESS) {
if (stream.Read(&val2, sizeof(MxS32)) == SUCCESS) {
MxS32 val3;
if (stream.Read(&val3, sizeof(MxS32)) == SUCCESS) {
m_unk0x64 = new LegoAnimClass();
if (m_unk0x64) {
if (m_unk0x64->VTable0x10() == SUCCESS) {
result = SUCCESS;
}
}
}
}
}
}
}
}
}
if (result != 0) {
delete m_unk0x64;
Init();
}
return result;
}
// FUNCTION: LEGO1 0x10099dd0
LegoAnimClassBase::LegoAnimClassBase()
{
m_unk0x4 = 0;
}
// STUB: LEGO1 0x10099e00
LegoAnimClassBase::~LegoAnimClassBase()
{
// TODO
}
// STUB: LEGO1 0x10099e20
void LegoAnimClassBase::VTable0x4()
{
}
// STUB: LEGO1 0x10099e40
void LegoAnimClassBase::VTable0x8()
{
}
// STUB: LEGO1 0x10099f70
void LegoAnimClassBase::VTable0xc()
{
}
// FUNCTION: LEGO1 0x100a0b30
LegoAnimClass::LegoAnimClass()
{
m_unk0x8 = 0;
m_unk0xc = 0;
m_unk0x10 = 0;
m_unk0x14 = 0;
}
// STUB: LEGO1 0x100a0bc0
LegoAnimClass::~LegoAnimClass()
{
// TODO
}
// STUB: LEGO1 0x100a0e30
void LegoAnimClass::VTable0x8()
{
}
// STUB: LEGO1 0x100a1040
void LegoAnimClass::VTable0xc()
{
}
// STUB: LEGO1 0x100a0c70
MxResult LegoAnimClass::VTable0x10()
{
return SUCCESS;
}

View File

@ -31,6 +31,10 @@ class Mx3DPointFloat : public Vector3 {
inline void EqualsCross(Mx3DPointFloat& p_a, Mx3DPointFloat& p_b) { EqualsCrossImpl(p_a.m_data, p_b.m_data); }
inline float* GetX() { return &m_elements[0]; }
inline float* GetY() { return &m_elements[1]; }
inline float* GetZ() { return &m_elements[2]; }
private:
float m_elements[3];
};