implement LegoWorldPresenter deconstructor (#425)

* Implement LegoWorldPresenter::~LegoWorldPresenter

* Rename incorrect function name

* fixes

* Rename functions

* fix format
This commit is contained in:
Misha
2024-01-12 17:27:07 -05:00
committed by GitHub
parent 602ba30fae
commit 3c0bf7191c
15 changed files with 75 additions and 20 deletions

View File

@@ -26,3 +26,9 @@ void LegoBuildingManager::Init()
{
// TODO
}
// STUB: LEGO1 0x1002fa00
void LegoBuildingManager::FUN_1002fa00()
{
// TODO
}

View File

@@ -18,6 +18,12 @@ void LegoPlantManager::Init()
// TODO
}
// STUB: LEGO1 0x10026360
void LegoPlantManager::FUN_10026360(undefined4 p_world)
{
// TODO
}
// STUB: LEGO1 0x10026e00
MxResult LegoPlantManager::Tickle()
{

View File

@@ -15,7 +15,7 @@ DECOMP_SIZE_ASSERT(LegoWorld, 0xf8);
LegoWorld::LegoWorld() : m_list0x68(TRUE)
{
// TODO
m_unk0xf6 = FALSE;
m_worldStarted = FALSE;
m_unk0xf4 = 4;
NotificationManager()->Register(this);
}
@@ -101,12 +101,12 @@ void LegoWorld::VTable0x68(MxBool p_add)
// FUNCTION: LEGO1 0x10022080
MxResult LegoWorld::Tickle()
{
if (!m_unk0xf6) {
if (!m_worldStarted) {
switch (m_unk0xf4) {
case 0:
m_unk0xf6 = TRUE;
m_worldStarted = TRUE;
SetAppCursor(0);
Stop();
VTable0x50();
return TRUE;
case 2:
if (FUN_100220e0() == 1)
@@ -121,11 +121,11 @@ MxResult LegoWorld::Tickle()
// STUB: LEGO1 0x100220e0
undefined LegoWorld::FUN_100220e0()
{
return TRUE;
return 0;
}
// FUNCTION: LEGO1 0x10022340
void LegoWorld::Stop()
void LegoWorld::VTable0x50()
{
TickleManager()->UnregisterClient(this);
}

View File

@@ -1,12 +1,17 @@
#include "legoworldpresenter.h"
#include "legoanimationmanager.h"
#include "legobuildingmanager.h"
#include "legoentity.h"
#include "legoomni.h"
#include "legoplantmanager.h"
#include "legovideomanager.h"
#include "legoworld.h"
#include "mxactionnotificationparam.h"
#include "mxautolocker.h"
#include "mxdsactionlist.h"
#include "mxdsmultiaction.h"
#include "mxnotificationmanager.h"
#include "mxobjectfactory.h"
#include "mxpresenter.h"
#include "mxstl/stlcompat.h"
@@ -26,10 +31,32 @@ LegoWorldPresenter::LegoWorldPresenter()
m_unk0x50 = 50000;
}
// STUB: LEGO1 0x10066770
// FUNCTION: LEGO1 0x10066770
LegoWorldPresenter::~LegoWorldPresenter()
{
// TODO
MxBool result = FALSE;
if (m_objectBackend) {
undefined4 world = ((LegoWorld*) m_objectBackend)->GetUnknown0xec();
PlantManager()->FUN_10026360(world);
AnimationManager()->FUN_1005f720(world);
BuildingManager()->FUN_1002fa00();
result = ((LegoWorld*) m_objectBackend)->VTable0x5c();
}
if (result == FALSE) {
FUN_10015820(0, 7);
}
if (m_objectBackend) {
#ifdef COMPAT_MODE
{
MxNotificationParam param(c_notificationNewPresenter, NULL);
NotificationManager()->Send(m_objectBackend, &param);
}
#else
NotificationManager()->Send(m_objectBackend, &MxNotificationParam(c_notificationNewPresenter, NULL));
#endif
}
}
// FUNCTION: LEGO1 0x10066870

View File

@@ -26,7 +26,7 @@ MxLong Infocenter::Notify(MxParam& p_param)
}
// STUB: LEGO1 0x1006f4e0
void Infocenter::Stop()
void Infocenter::VTable0x50()
{
// TODO
}

View File

@@ -76,7 +76,7 @@ MxLong Score::Notify(MxParam& p_param)
{
MxLong ret = 0;
LegoWorld::Notify(p_param);
if (m_unk0xf6) {
if (m_worldStarted) {
switch (((MxNotificationParam&) p_param).GetNotification()) {
case c_notificationStartAction:
ret = 1;
@@ -128,9 +128,9 @@ MxLong Score::FUN_10001510(MxEndActionNotificationParam& p_param)
}
// FUNCTION: LEGO1 0x10001580
void Score::Stop()
void Score::VTable0x50()
{
LegoWorld::Stop();
LegoWorld::VTable0x50();
MxDSAction action;
action.SetObjectId(0x1f4);

View File

@@ -99,7 +99,7 @@ MxLong Isle::Notify(MxParam& p_param)
MxLong result = 0;
LegoWorld::Notify(p_param);
if (m_unk0xf6) {
if (m_worldStarted) {
switch (((MxNotificationParam&) p_param).GetNotification()) {
case c_notificationEndAction:
result = StopAction(p_param);
@@ -153,7 +153,7 @@ MxLong Isle::StopAction(MxParam& p_param)
}
// STUB: LEGO1 0x10030fc0
void Isle::Stop()
void Isle::VTable0x50()
{
// TODO
}

View File

@@ -33,6 +33,12 @@ void LegoAnimationManager::FUN_1005f6d0(MxBool)
// TODO
}
// STUB: LEGO1 0x1005f720
void LegoAnimationManager::FUN_1005f720(undefined4)
{
// TODO
}
// STUB: LEGO1 0x100619f0
MxLong LegoAnimationManager::Notify(MxParam& p_param)
{