TowTrack and LegoAct2 destructors (#1005)

* Add some missing dtors

* Add missing 'override'
This commit is contained in:
MS 2024-06-08 19:17:33 -04:00 committed by GitHub
parent efdbbeecc0
commit 88805f9fcb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 51 additions and 0 deletions

View file

@ -43,6 +43,8 @@ class LegoAct2State : public LegoState {
// SIZE 0x1154 // SIZE 0x1154
class LegoAct2 : public LegoWorld { class LegoAct2 : public LegoWorld {
public: public:
~LegoAct2() override;
MxLong Notify(MxParam& p_param) override; // vtable+0x04 MxLong Notify(MxParam& p_param) override; // vtable+0x04
MxResult Tickle() override; // vtable+0x08 MxResult Tickle() override; // vtable+0x08
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18 MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
@ -58,6 +60,8 @@ class LegoAct2 : public LegoWorld {
// LegoAct2::`scalar deleting destructor' // LegoAct2::`scalar deleting destructor'
private: private:
void FUN_10051900();
Act2Brick m_bricks[10]; // 0x00f8 Act2Brick m_bricks[10]; // 0x00f8
undefined m_unk0x10c0; // 0x10c0 undefined m_unk0x10c0; // 0x10c0
undefined m_unk0x10c1; // 0x10c1 undefined m_unk0x10c1; // 0x10c1

View file

@ -67,6 +67,7 @@ class TowTrackMissionState : public LegoState {
class TowTrack : public IslePathActor { class TowTrack : public IslePathActor {
public: public:
TowTrack(); TowTrack();
~TowTrack() override;
// FUNCTION: LEGO1 0x1004c7c0 // FUNCTION: LEGO1 0x1004c7c0
inline const char* ClassName() const override // vtable+0x0c inline const char* ClassName() const override // vtable+0x0c

View file

@ -1,5 +1,6 @@
#include "towtrack.h" #include "towtrack.h"
#include "legocontrolmanager.h"
#include "legogamestate.h" #include "legogamestate.h"
#include "legovariables.h" #include "legovariables.h"
#include "legoworld.h" #include "legoworld.h"
@ -25,6 +26,12 @@ TowTrack::TowTrack()
m_unk0x178 = 1.0; m_unk0x178 = 1.0;
} }
// FUNCTION: LEGO1 0x1004c970
TowTrack::~TowTrack()
{
ControlManager()->Unregister(this);
}
// FUNCTION: LEGO1 0x1004c9e0 // FUNCTION: LEGO1 0x1004c9e0
// FUNCTION: BETA10 0x100f6bf1 // FUNCTION: BETA10 0x100f6bf1
MxResult TowTrack::Create(MxDSAction& p_dsAction) MxResult TowTrack::Create(MxDSAction& p_dsAction)

View file

@ -477,6 +477,7 @@ void LegoWorld::Add(MxCore* p_object)
} }
// FUNCTION: LEGO1 0x10020f10 // FUNCTION: LEGO1 0x10020f10
// FUNCTION: BETA10 0x100dad2a
void LegoWorld::Remove(MxCore* p_object) void LegoWorld::Remove(MxCore* p_object)
{ {
if (p_object) { if (p_object) {

View file

@ -1,5 +1,12 @@
#include "legoact2.h" #include "legoact2.h"
#include "legoanimationmanager.h"
#include "legoinputmanager.h"
#include "misc.h"
#include "mxmisc.h"
#include "mxnotificationmanager.h"
#include "mxticklemanager.h"
DECOMP_SIZE_ASSERT(LegoAct2, 0x1154) DECOMP_SIZE_ASSERT(LegoAct2, 0x1154)
DECOMP_SIZE_ASSERT(LegoAct2State, 0x10) DECOMP_SIZE_ASSERT(LegoAct2State, 0x10)
@ -9,6 +16,23 @@ MxBool LegoAct2::VTable0x5c()
return TRUE; return TRUE;
} }
// FUNCTION: LEGO1 0x1004fe40
// FUNCTION: BETA10 0x1003a6f0
LegoAct2::~LegoAct2()
{
if (m_unk0x10c2) {
TickleManager()->UnregisterClient(this);
}
FUN_10051900();
InputManager()->UnRegister(this);
if (CurrentActor()) {
Remove(CurrentActor());
}
NotificationManager()->Unregister(this);
}
// STUB: LEGO1 0x1004ff20 // STUB: LEGO1 0x1004ff20
MxResult LegoAct2::Create(MxDSAction& p_dsAction) MxResult LegoAct2::Create(MxDSAction& p_dsAction)
{ {
@ -42,6 +66,20 @@ void LegoAct2::Enable(MxBool p_enable)
// TODO // TODO
} }
// FUNCTION: LEGO1 0x10051900
// FUNCTION: BETA10 0x1003bed1
void LegoAct2::FUN_10051900()
{
if (AnimationManager()) {
AnimationManager()->Suspend();
AnimationManager()->Resume();
AnimationManager()->FUN_10060540(FALSE);
AnimationManager()->FUN_100604d0(FALSE);
AnimationManager()->EnableCamAnims(FALSE);
AnimationManager()->FUN_1005f6d0(FALSE);
}
}
// STUB: LEGO1 0x100519c0 // STUB: LEGO1 0x100519c0
void LegoAct2::VTable0x60() void LegoAct2::VTable0x60()
{ {