Imlpement/match LegoAnimMMPresenter::ParseExtra and related (#822)

* Imlpement/match LegoAnimMMPresenter::ParseExtra and related

* sort
This commit is contained in:
Christian Semmler 2024-04-20 09:32:10 -04:00 committed by GitHub
parent 2ce9ff06fc
commit 5021f66de2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 114 additions and 36 deletions

View file

@ -87,6 +87,7 @@ class LegoAnimationManager : public MxCore {
); );
void FUN_10061010(undefined4); void FUN_10061010(undefined4);
void FUN_100617c0(MxS32, MxU16&, MxU32&); void FUN_100617c0(MxS32, MxU16&, MxU32&);
LegoTranInfo* GetTranInfo(MxU32 p_index);
MxS8 FUN_10062360(char*); MxS8 FUN_10062360(char*);
void FUN_10062770(); void FUN_10062770();
void FUN_100627d0(MxBool); void FUN_100627d0(MxBool);

View file

@ -4,6 +4,7 @@
#include "mxcompositepresenter.h" #include "mxcompositepresenter.h"
class LegoWorld; class LegoWorld;
struct LegoTranInfo;
// VTABLE: LEGO1 0x100d7de8 // VTABLE: LEGO1 0x100d7de8
// SIZE 0x74 // SIZE 0x74
@ -42,17 +43,17 @@ class LegoAnimMMPresenter : public MxCompositePresenter {
MxBool FUN_1004b8b0(); MxBool FUN_1004b8b0();
private: private:
MxPresenter* m_unk0x4c; // 0x4c MxPresenter* m_unk0x4c; // 0x4c
undefined4 m_unk0x50; // 0x50 undefined4 m_unk0x50; // 0x50
undefined4 m_unk0x54; // 0x54 undefined4 m_unk0x54; // 0x54
undefined m_unk0x58; // 0x58 undefined m_unk0x58; // 0x58
undefined m_unk0x59; // 0x59 MxBool m_unk0x59; // 0x59
undefined4 m_unk0x5c; // 0x5c MxU32 m_animmanId; // 0x5c
undefined4 m_unk0x60; // 0x60 LegoTranInfo* m_tranInfo; // 0x60
LegoWorld* m_unk0x64; // 0x64 LegoWorld* m_unk0x64; // 0x64
undefined4 m_unk0x68; // 0x68 undefined4 m_unk0x68; // 0x68
undefined4 m_unk0x6c; // 0x6c undefined4 m_unk0x6c; // 0x6c
undefined4 m_unk0x70; // 0x70 undefined4 m_unk0x70; // 0x70
}; };
#endif // LEGOANIMMMPRESENTER_H #endif // LEGOANIMMMPRESENTER_H

View file

@ -4,6 +4,8 @@
#include "decomp.h" #include "decomp.h"
#include "mxgeometry/mxmatrix.h" #include "mxgeometry/mxmatrix.h"
class LegoAnimMMPresenter;
// SIZE 0x78 // SIZE 0x78
struct LegoTranInfo { struct LegoTranInfo {
enum { enum {
@ -20,7 +22,7 @@ struct LegoTranInfo {
m_unk0x14 = FALSE; m_unk0x14 = FALSE;
m_unk0x1c = NULL; m_unk0x1c = NULL;
m_unk0x20 = NULL; m_unk0x20 = NULL;
m_unk0x24 = 0; m_presenter = NULL;
m_unk0x15 = TRUE; m_unk0x15 = TRUE;
m_unk0x28 = TRUE; m_unk0x28 = TRUE;
m_unk0x29 = TRUE; m_unk0x29 = TRUE;
@ -28,22 +30,22 @@ struct LegoTranInfo {
m_unk0x2c.SetIdentity(); m_unk0x2c.SetIdentity();
} }
undefined4 m_unk0x00; // 0x00 undefined4 m_unk0x00; // 0x00
MxU32 m_index; // 0x04 MxU32 m_index; // 0x04
undefined4 m_unk0x08; // 0x08 undefined4 m_unk0x08; // 0x08
MxMatrix* m_unk0x0c; // 0x0c MxMatrix* m_unk0x0c; // 0x0c
MxBool m_unk0x10; // 0x10 MxBool m_unk0x10; // 0x10
MxS16 m_unk0x12; // 0x12 MxS16 m_unk0x12; // 0x12
MxBool m_unk0x14; // 0x14 MxBool m_unk0x14; // 0x14
MxBool m_unk0x15; // 0x15 MxBool m_unk0x15; // 0x15
MxU32 m_objectId; // 0x18 MxU32 m_objectId; // 0x18
undefined4* m_unk0x1c; // 0x1c undefined4* m_unk0x1c; // 0x1c
undefined4* m_unk0x20; // 0x20 undefined4* m_unk0x20; // 0x20
undefined4 m_unk0x24; // 0x24 LegoAnimMMPresenter* m_presenter; // 0x24
MxBool m_unk0x28; // 0x28 MxBool m_unk0x28; // 0x28
MxBool m_unk0x29; // 0x29 MxBool m_unk0x29; // 0x29
MxMatrix m_unk0x2c; // 0x2c MxMatrix m_unk0x2c; // 0x2c
MxU32 m_flags; // 0x74 MxU32 m_flags; // 0x74
}; };
#endif // LEGOTRANINFO_H #endif // LEGOTRANINFO_H

View file

@ -21,6 +21,19 @@ class LegoTranInfoList : public MxPtrList<LegoTranInfo> {
LegoTranInfoList() : MxPtrList<LegoTranInfo>(FALSE) {} LegoTranInfoList() : MxPtrList<LegoTranInfo>(FALSE) {}
}; };
// VTABLE: LEGO1 0x100d8cf0
// class MxListCursor<LegoTranInfo *>
// VTABLE: LEGO1 0x100d8d08
// class MxPtrListCursor<LegoTranInfo>
// VTABLE: LEGO1 0x100d8d20
// SIZE 0x10
class LegoTranInfoListCursor : public MxPtrListCursor<LegoTranInfo> {
public:
LegoTranInfoListCursor(LegoTranInfoList* p_list) : MxPtrListCursor<LegoTranInfo>(p_list) {}
};
// TEMPLATE: LEGO1 0x1005fdf0 // TEMPLATE: LEGO1 0x1005fdf0
// MxCollection<LegoTranInfo *>::Compare // MxCollection<LegoTranInfo *>::Compare
@ -48,4 +61,22 @@ class LegoTranInfoList : public MxPtrList<LegoTranInfo> {
// SYNTHETIC: LEGO1 0x100600d0 // SYNTHETIC: LEGO1 0x100600d0
// MxPtrList<LegoTranInfo>::`scalar deleting destructor' // MxPtrList<LegoTranInfo>::`scalar deleting destructor'
// SYNTHETIC: LEGO1 0x100612f0
// LegoTranInfoListCursor::`scalar deleting destructor'
// FUNCTION: LEGO1 0x10061360
// MxPtrListCursor<LegoTranInfo>::~MxPtrListCursor<LegoTranInfo>
// SYNTHETIC: LEGO1 0x100613b0
// MxListCursor<LegoTranInfo *>::`scalar deleting destructor'
// SYNTHETIC: LEGO1 0x10061420
// MxPtrListCursor<LegoTranInfo>::`scalar deleting destructor'
// FUNCTION: LEGO1 0x10061490
// MxListCursor<LegoTranInfo *>::~MxListCursor<LegoTranInfo *>
// FUNCTION: LEGO1 0x100614e0
// LegoTranInfoListCursor::~LegoTranInfoListCursor
#endif // LEGOTRANINFOLIST_H #endif // LEGOTRANINFOLIST_H

View file

@ -564,6 +564,24 @@ void LegoAnimationManager::FUN_100617c0(MxS32, MxU16&, MxU32&)
// TODO // TODO
} }
// FUNCTION: LEGO1 0x100618f0
// FUNCTION: BETA10 0x100425f0
LegoTranInfo* LegoAnimationManager::GetTranInfo(MxU32 p_index)
{
if (m_tranInfoList != NULL) {
LegoTranInfoListCursor cursor(m_tranInfoList);
LegoTranInfo* tranInfo;
while (cursor.Next(tranInfo)) {
if (tranInfo->m_index == p_index) {
return tranInfo;
}
}
}
return NULL;
}
// STUB: LEGO1 0x100619f0 // STUB: LEGO1 0x100619f0
MxLong LegoAnimationManager::Notify(MxParam& p_param) MxLong LegoAnimationManager::Notify(MxParam& p_param)
{ {

View file

@ -1,6 +1,9 @@
#include "legoanimmmpresenter.h" #include "legoanimmmpresenter.h"
#include "decomp.h" #include "decomp.h"
#include "define.h"
#include "legoanimationmanager.h"
#include "legotraninfo.h"
#include "legovideomanager.h" #include "legovideomanager.h"
#include "legoworld.h" #include "legoworld.h"
#include "misc.h" #include "misc.h"
@ -9,6 +12,7 @@
#include "mxmisc.h" #include "mxmisc.h"
#include "mxnotificationmanager.h" #include "mxnotificationmanager.h"
#include "mxobjectfactory.h" #include "mxobjectfactory.h"
#include "mxutilities.h"
DECOMP_SIZE_ASSERT(LegoAnimMMPresenter, 0x74) DECOMP_SIZE_ASSERT(LegoAnimMMPresenter, 0x74)
@ -16,9 +20,9 @@ DECOMP_SIZE_ASSERT(LegoAnimMMPresenter, 0x74)
LegoAnimMMPresenter::LegoAnimMMPresenter() LegoAnimMMPresenter::LegoAnimMMPresenter()
{ {
m_unk0x4c = NULL; m_unk0x4c = NULL;
m_unk0x5c = 0; m_animmanId = 0;
m_unk0x59 = 0; m_unk0x59 = FALSE;
m_unk0x60 = 0; m_tranInfo = NULL;
m_unk0x54 = 0; m_unk0x54 = 0;
m_unk0x64 = NULL; m_unk0x64 = NULL;
m_unk0x68 = 0; m_unk0x68 = 0;
@ -143,15 +147,36 @@ void LegoAnimMMPresenter::VTable0x60(MxPresenter* p_presenter)
} }
} }
// STUB: LEGO1 0x1004b390 // FUNCTION: LEGO1 0x1004b390
// FUNCTION: BETA10 0x1004c5be
void LegoAnimMMPresenter::ParseExtra() void LegoAnimMMPresenter::ParseExtra()
{ {
// TODO MxU16 extraLength;
char* extraData;
m_action->GetExtra(extraLength, extraData);
if (extraLength & MAXWORD) {
char extraCopy[1024];
memcpy(extraCopy, extraData, extraLength & MAXWORD);
extraCopy[extraLength & MAXWORD] = '\0';
char output[1024];
if (KeyValueStringParse(output, g_strANIMMAN_ID, extraCopy)) {
char* token = strtok(output, g_parseExtraTokens);
m_animmanId = atoi(token);
m_tranInfo = AnimationManager()->GetTranInfo(m_animmanId);
if (m_tranInfo != NULL) {
m_unk0x59 = m_tranInfo->m_unk0x10;
m_tranInfo->m_presenter = this;
}
}
}
} }
// STUB: LEGO1 0x1004b8b0 // FUNCTION: LEGO1 0x1004b8b0
// FUNCTION: BETA10 0x1004d104
MxBool LegoAnimMMPresenter::FUN_1004b8b0() MxBool LegoAnimMMPresenter::FUN_1004b8b0()
{ {
// TODO return m_tranInfo != NULL ? m_tranInfo->m_unk0x28 : TRUE;
return FALSE;
} }