Progress on LegoCarBuildAnimPresenter (#1103)

* Progress on `LegoCarBuildAnimPresenter`

* Rename argument

* fix copy-paste error

* Address review comments

* Remove obsolete comment

---------

Co-authored-by: jonschz <jonschz@users.noreply.github.com>
This commit is contained in:
jonschz
2024-09-12 21:51:33 +02:00
committed by GitHub
parent 5d19b6afe3
commit 7a6935a165
10 changed files with 152 additions and 27 deletions

View File

@@ -30,6 +30,7 @@ typedef map<const char*, LegoAnimStruct, LegoAnimStructComparator> LegoAnimStruc
typedef map<const char*, const char*, LegoAnimSubstComparator> LegoAnimSubstMap;
// VTABLE: LEGO1 0x100d90c8
// VTABLE: BETA10 0x101baf90
// SIZE 0xbc
class LegoAnimPresenter : public MxVideoPresenter {
public:

View File

@@ -5,9 +5,17 @@
#include "legoanimpresenter.h"
// VTABLE: LEGO1 0x100d99e0
// VTABLE: BETA10 0x101bb988
// SIZE 0x150
class LegoCarBuildAnimPresenter : public LegoAnimPresenter {
public:
// SIZE 0x0c
struct UnknownListEntry {
LegoChar* m_unk0x00; // 0x00
LegoChar* m_unk0x04; // 0x04
undefined m_unk0x08[4]; // 0x08
};
LegoCarBuildAnimPresenter();
~LegoCarBuildAnimPresenter() override; // vtable+0x00
@@ -39,27 +47,35 @@ public:
void FUN_10079920(float p_param1);
MxBool FUN_10079ca0(const char* p_param1);
MxBool FUN_10079cf0(const LegoChar* p_name);
// FUNCTION: BETA10 0x10070180
void SetUnknown0xbc(undefined2 p_unk0xbc) { m_unk0xbc = p_unk0xbc; }
MxBool StringEndsOnYOrN(const LegoChar* p_string);
const BoundingSphere& FUN_10079e20();
// SYNTHETIC: LEGO1 0x10078660
// LegoCarBuildAnimPresenter::`scalar deleting destructor'
private:
undefined2 m_unk0xbc; // 0xbc
undefined2 m_unk0xbe; // 0xbe
undefined2 m_unk0xc0; // 0xc0
undefined4 m_unk0xc4; // 0xc4
LegoAnim m_unk0xc8; // 0xc8
MxMatrix m_unk0xe0; // 0xe0
undefined4 m_unk0x128; // 0x128
undefined4 m_unk0x12c; // 0x12c
undefined4 m_unk0x130; // 0x130
undefined4 m_unk0x134; // 0x134
undefined4 m_unk0x138; // 0x138
undefined4 m_unk0x13c; // 0x13c
undefined4 m_unk0x140; // 0x140
MxS32 m_unk0x144; // 0x144
MxS32 m_unk0x148; // 0x148
undefined4 m_unk0x14c; // 0x14c
undefined2 m_unk0xbc; // 0xbc
MxS16 m_unk0xbe; // 0xbe
MxS16 m_unk0xc0; // 0xc0
undefined4 m_unk0xc4; // 0xc4
LegoAnim m_unk0xc8; // 0xc8
MxMatrix m_unk0xe0; // 0xe0
UnknownListEntry* m_unk0x128; // 0x128
undefined4 m_unk0x12c; // 0x12c
undefined4 m_unk0x130; // 0x130
undefined4 m_unk0x134; // 0x134
undefined4 m_unk0x138; // 0x138
undefined4 m_unk0x13c; // 0x13c
LegoEntity* m_unk0x140; // 0x140
MxS32 m_unk0x144; // 0x144
MxS32 m_unk0x148; // 0x148
undefined* m_unk0x14c; // 0x14c
};
#endif // LEGOCARBUILDPRESENTER_H

View File

@@ -1,23 +1,55 @@
#include "legocarbuildpresenter.h"
#include "legoentity.h"
#include "mxautolock.h"
DECOMP_SIZE_ASSERT(LegoCarBuildAnimPresenter::UnknownListEntry, 0x0c)
DECOMP_SIZE_ASSERT(LegoCarBuildAnimPresenter, 0x150)
// STUB: LEGO1 0x10078400
// FUNCTION: LEGO1 0x10078400
// FUNCTION: BETA10 0x100707c0
LegoCarBuildAnimPresenter::LegoCarBuildAnimPresenter()
{
// TODO
m_unk0xbc = 0;
m_unk0xbe = 0;
m_unk0xc0 = 0;
m_unk0x128 = NULL;
m_unk0xc4 = 0;
m_unk0x130 = 0;
m_unk0x12c = 0;
m_unk0x134 = 0;
m_unk0x138 = 0;
m_unk0x13c = 0;
m_unk0x140 = NULL;
m_unk0x144 = -1;
m_unk0x148 = -1;
m_unk0x14c = NULL;
}
// STUB: LEGO1 0x10078500
// FUNCTION: LEGO1 0x10078500
void LegoCarBuildAnimPresenter::RepeatingTickle()
{
// TODO
// empty
}
// STUB: LEGO1 0x10078680
// FUNCTION: LEGO1 0x10078680
// FUNCTION: BETA10 0x1007091e
LegoCarBuildAnimPresenter::~LegoCarBuildAnimPresenter()
{
// TODO
if (m_unk0x128) {
for (MxS16 i = 0; i < m_unk0xbe; i++) {
delete m_unk0x128[i].m_unk0x00;
delete m_unk0x128[i].m_unk0x04;
}
delete[] m_unk0x128;
}
m_unk0xc8.GetRoot()->SetNumChildren(0);
*m_unk0xc8.GetRoot()->GetChildren() = NULL;
if (m_unk0x14c) {
delete m_unk0x14c;
}
}
// STUB: LEGO1 0x10078790
@@ -27,21 +59,28 @@ void LegoCarBuildAnimPresenter::PutFrame()
}
// STUB: LEGO1 0x100788c0
// STUB: BETA10 0x10070b56
void LegoCarBuildAnimPresenter::ReadyTickle()
{
// TODO
}
// STUB: LEGO1 0x100789e0
// STUB: BETA10 0x10070cdd
void LegoCarBuildAnimPresenter::StreamingTickle()
{
// TODO
}
// STUB: LEGO1 0x10078db0
// FUNCTION: LEGO1 0x10078db0
// FUNCTION: BETA10 0x100712f3
void LegoCarBuildAnimPresenter::EndAction()
{
// TODO
if (m_action) {
AUTOLOCK(m_criticalSection);
MxVideoPresenter::EndAction();
m_unk0xbc = 0;
}
}
// STUB: LEGO1 0x10079920
@@ -51,10 +90,37 @@ void LegoCarBuildAnimPresenter::FUN_10079920(float p_param1)
// TODO
}
// STUB: LEGO1 0x10079ca0
// STUB: BETA10 0x10072740
// FUNCTION: LEGO1 0x10079b80
// FUNCTION: BETA10 0x1007258f
MxBool LegoCarBuildAnimPresenter::StringEndsOnYOrN(const LegoChar* p_string)
{
return (p_string[strlen(p_string) - 2] == 'N') || (p_string[strlen(p_string) - 2] == 'n') ||
(p_string[strlen(p_string) - 2] == 'Y') || (p_string[strlen(p_string) - 2] == 'y');
}
// FUNCTION: LEGO1 0x10079ca0
// FUNCTION: BETA10 0x10072740
MxBool LegoCarBuildAnimPresenter::FUN_10079ca0(const char* p_param1)
{
// TODO; pretty short
for (MxS16 i = 0; i < m_unk0xc0; i++) {
if (strcmpi(p_param1, m_unk0x128[i].m_unk0x00) == 0) {
return TRUE;
}
}
return FALSE;
}
// FUNCTION: LEGO1 0x10079cf0
// FUNCTION: BETA10 0x100727b3
MxBool LegoCarBuildAnimPresenter::FUN_10079cf0(const LegoChar* p_string)
{
return (p_string[strlen(p_string) - 2] == 'Y') || (p_string[strlen(p_string) - 2] == 'y');
}
// FUNCTION: LEGO1 0x10079e20
const BoundingSphere& LegoCarBuildAnimPresenter::FUN_10079e20()
{
LegoROI* roi = m_unk0x140->GetROI();
return roi->FindChildROI(m_unk0x128[m_unk0xc0].m_unk0x04, roi)->GetWorldBoundingSphere();
}

View File

@@ -29,6 +29,7 @@
DECOMP_SIZE_ASSERT(LegoAnimPresenter, 0xbc)
// FUNCTION: LEGO1 0x10068420
// FUNCTION: BETA10 0x1004e5f0
LegoAnimPresenter::LegoAnimPresenter()
{
Init();