diff --git a/LEGO1/lego/legoomni/include/legoanimpresenter.h b/LEGO1/lego/legoomni/include/legoanimpresenter.h index f289fe1d..30da04ff 100644 --- a/LEGO1/lego/legoomni/include/legoanimpresenter.h +++ b/LEGO1/lego/legoomni/include/legoanimpresenter.h @@ -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: diff --git a/LEGO1/lego/legoomni/include/legocarbuildpresenter.h b/LEGO1/lego/legoomni/include/legocarbuildpresenter.h index 8c97666c..2dbfd20f 100644 --- a/LEGO1/lego/legoomni/include/legocarbuildpresenter.h +++ b/LEGO1/lego/legoomni/include/legocarbuildpresenter.h @@ -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 diff --git a/LEGO1/lego/legoomni/src/build/legocarbuildpresenter.cpp b/LEGO1/lego/legoomni/src/build/legocarbuildpresenter.cpp index d143e670..12944337 100644 --- a/LEGO1/lego/legoomni/src/build/legocarbuildpresenter.cpp +++ b/LEGO1/lego/legoomni/src/build/legocarbuildpresenter.cpp @@ -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(); +} diff --git a/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp b/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp index 2ddf10e7..4537418a 100644 --- a/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp @@ -29,6 +29,7 @@ DECOMP_SIZE_ASSERT(LegoAnimPresenter, 0xbc) // FUNCTION: LEGO1 0x10068420 +// FUNCTION: BETA10 0x1004e5f0 LegoAnimPresenter::LegoAnimPresenter() { Init(); diff --git a/LEGO1/lego/sources/misc/legotree.h b/LEGO1/lego/sources/misc/legotree.h index 9d4aec69..fb97a612 100644 --- a/LEGO1/lego/sources/misc/legotree.h +++ b/LEGO1/lego/sources/misc/legotree.h @@ -35,10 +35,16 @@ public: LegoTreeNodeData* GetData() { return m_data; } void SetData(LegoTreeNodeData* p_data) { m_data = p_data; } LegoU32 GetNumChildren() { return m_numChildren; } + + // FUNCTION: BETA10 0x10073370 void SetNumChildren(LegoU32 p_numChildren) { m_numChildren = p_numChildren; } + LegoTreeNode* GetChild(LegoU32 p_i) { return m_children[p_i]; } void SetChild(LegoU32 p_i, LegoTreeNode* p_child) { m_children[p_i] = p_child; } + + // FUNCTION: BETA10 0x100733a0 LegoTreeNode** GetChildren() { return m_children; } + void SetChildren(LegoTreeNode** p_children) { m_children = p_children; } // SYNTHETIC: LEGO1 0x10099d80 @@ -56,7 +62,10 @@ class LegoTree { public: LegoTree(); virtual ~LegoTree(); + + // FUNCTION: BETA10 0x100121b0 LegoTreeNode* GetRoot() { return m_root; } + void SetRoot(LegoTreeNode* p_root) { m_root = p_root; } virtual LegoResult Read(LegoStorage* p_storage); // vtable+0x04 virtual LegoResult Write(LegoStorage* p_storage); // vtable+0x08 diff --git a/LEGO1/library_msvc.h b/LEGO1/library_msvc.h index b81e2f0b..157b7acd 100644 --- a/LEGO1/library_msvc.h +++ b/LEGO1/library_msvc.h @@ -675,4 +675,31 @@ // LIBRARY: BETA10 0x100f9a50 // _sin +// LIBRARY: BETA10 0x100f95d0 +// _sqrt + +// LIBRARY: BETA10 0x100f9780 +// strlen + +// LIBRARY: BETA10 0x100f8a88 +// operator new + +// LIBRARY: BETA10 0x100f9420 +// memcpy + +// LIBRARY: BETA10 0x100fb080 +// _stricmp + +// LIBRARY: BETA10 0x100fb050 +// fopen + +// LIBRARY: BETA10 0x100fae70 +// fprintf + +// LIBRARY: BETA10 0x100fad10 +// fclose + +// LIBRARY: BETA10 0x100fe5a0 +// abort + #endif diff --git a/LEGO1/mxgeometry/mxgeometry3d.h b/LEGO1/mxgeometry/mxgeometry3d.h index 4a01d955..f5e2c083 100644 --- a/LEGO1/mxgeometry/mxgeometry3d.h +++ b/LEGO1/mxgeometry/mxgeometry3d.h @@ -52,6 +52,7 @@ public: // FUNCTION: LEGO1 0x10048290 Mx4DPointFloat() : Vector4(m_elements) {} + // FUNCTION: BETA10 0x10073bb0 Mx4DPointFloat(float p_x, float p_y, float p_z, float p_a) : Vector4(m_elements) { m_elements[0] = p_x; diff --git a/LEGO1/omni/src/system/mxautolock.cpp b/LEGO1/omni/src/system/mxautolock.cpp index 5ab2e4bb..4508663e 100644 --- a/LEGO1/omni/src/system/mxautolock.cpp +++ b/LEGO1/omni/src/system/mxautolock.cpp @@ -3,6 +3,7 @@ #include "mxcriticalsection.h" // FUNCTION: LEGO1 0x100b8ed0 +// FUNCTION: BETA10 0x101386f0 MxAutoLock::MxAutoLock(MxCriticalSection* p_criticalSection) { m_criticalSection = p_criticalSection; @@ -13,6 +14,7 @@ MxAutoLock::MxAutoLock(MxCriticalSection* p_criticalSection) } // FUNCTION: LEGO1 0x100b8ef0 +// FUNCTION: BETA10 0x10138744 MxAutoLock::~MxAutoLock() { if (m_criticalSection != NULL) { diff --git a/LEGO1/omni/src/system/mxcriticalsection.cpp b/LEGO1/omni/src/system/mxcriticalsection.cpp index f0adc551..5c1ca9bf 100644 --- a/LEGO1/omni/src/system/mxcriticalsection.cpp +++ b/LEGO1/omni/src/system/mxcriticalsection.cpp @@ -36,6 +36,7 @@ MxCriticalSection::~MxCriticalSection() } // FUNCTION: LEGO1 0x100b6d80 +// FUNCTION: BETA10 0x1013c725 void MxCriticalSection::Enter() { DWORD result; diff --git a/LEGO1/omni/src/video/mxvideopresenter.cpp b/LEGO1/omni/src/video/mxvideopresenter.cpp index c94e656c..b9fc6b0d 100644 --- a/LEGO1/omni/src/video/mxvideopresenter.cpp +++ b/LEGO1/omni/src/video/mxvideopresenter.cpp @@ -542,6 +542,7 @@ MxResult MxVideoPresenter::AddToManager() } // FUNCTION: LEGO1 0x100b31d0 +// FUNCTION: BETA10 0x101396d9 void MxVideoPresenter::EndAction() { if (m_action) {