mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-24 17:04:17 +00:00
Implement/match LegoWorld::Destroy (and destructor) (#492)
* Implement/match LegoWorld::Destroy * Match * Match
This commit is contained in:
committed by
GitHub
parent
4df7dee037
commit
883f3429a7
7
LEGO1/lego/legoomni/src/audio/legounknown100d6b4c.cpp
Normal file
7
LEGO1/lego/legoomni/src/audio/legounknown100d6b4c.cpp
Normal file
@@ -0,0 +1,7 @@
|
||||
#include "legounknown100d6b4c.h"
|
||||
|
||||
// STUB: LEGO1 0x1003dc40
|
||||
void LegoUnknown100d6b4c::FUN_1003dc40(LegoCacheSound** p_und)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
@@ -33,6 +33,12 @@ void LegoBuildingManager::FUN_1002fa00()
|
||||
// TODO
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1002fb30
|
||||
void LegoBuildingManager::FUN_1002fb30()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10030220
|
||||
MxResult LegoBuildingManager::Tickle()
|
||||
{
|
||||
|
||||
@@ -24,6 +24,12 @@ void LegoPlantManager::FUN_10026360(undefined4 p_world)
|
||||
// TODO
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100263a0
|
||||
void LegoPlantManager::FUN_100263a0(undefined4 p_und)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10026e00
|
||||
MxResult LegoPlantManager::Tickle()
|
||||
{
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
#include "legoworld.h"
|
||||
|
||||
#include "legoanimpresenter.h"
|
||||
#include "legobuildingmanager.h"
|
||||
#include "legocontrolmanager.h"
|
||||
#include "legoinputmanager.h"
|
||||
#include "legolocomotionanimpresenter.h"
|
||||
#include "legoomni.h"
|
||||
#include "legoplantmanager.h"
|
||||
#include "legosoundmanager.h"
|
||||
#include "legoutil.h"
|
||||
#include "legovideomanager.h"
|
||||
#include "mxactionnotificationparam.h"
|
||||
@@ -26,7 +30,7 @@ LegoWorld::LegoWorld() : m_list0x68(TRUE)
|
||||
m_cameraController = NULL;
|
||||
m_entityList = NULL;
|
||||
m_cacheSoundList = NULL;
|
||||
m_unk0xa4 = 0; // MxBool?
|
||||
m_destroyed = FALSE;
|
||||
m_hideAnimPresenter = NULL;
|
||||
m_worldStarted = FALSE;
|
||||
|
||||
@@ -45,10 +49,13 @@ MxBool LegoWorld::VTable0x64()
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1001dfa0
|
||||
// FUNCTION: LEGO1 0x1001dfa0
|
||||
LegoWorld::~LegoWorld()
|
||||
{
|
||||
// TODO
|
||||
Destroy(TRUE);
|
||||
|
||||
TickleManager()->UnregisterClient(this);
|
||||
NotificationManager()->Unregister(this);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1001e0b0
|
||||
@@ -84,10 +91,118 @@ MxResult LegoWorld::Create(MxDSAction& p_dsAction)
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1001e9d0
|
||||
// FUNCTION: LEGO1 0x1001e9d0
|
||||
void LegoWorld::Destroy(MxBool p_fromDestructor)
|
||||
{
|
||||
// TODO
|
||||
m_destroyed = TRUE;
|
||||
|
||||
if (GetCurrentWorld() == this) {
|
||||
ControlManager()->FUN_10028df0(NULL);
|
||||
SetCurrentWorld(NULL);
|
||||
}
|
||||
|
||||
m_list0x68.DeleteAll();
|
||||
|
||||
if (m_cameraController) {
|
||||
delete m_cameraController;
|
||||
m_cameraController = NULL;
|
||||
}
|
||||
|
||||
MxPresenterListCursor animPresenterCursor(&m_animPresenters);
|
||||
MxPresenter* presenter;
|
||||
|
||||
while (animPresenterCursor.First(presenter)) {
|
||||
animPresenterCursor.Detach();
|
||||
|
||||
MxDSAction* action = presenter->GetAction();
|
||||
if (action) {
|
||||
if (presenter->IsA("LegoLocomotionAnimPresenter")) {
|
||||
LegoLocomotionAnimPresenter* animPresenter = (LegoLocomotionAnimPresenter*) presenter;
|
||||
|
||||
animPresenter->DecrementUnknown0xd4();
|
||||
if (animPresenter->GetUnknown0xd4() == 0) {
|
||||
FUN_100b7220(action, MxDSAction::c_world, FALSE);
|
||||
presenter->EndAction();
|
||||
}
|
||||
}
|
||||
else {
|
||||
FUN_100b7220(action, MxDSAction::c_world, FALSE);
|
||||
presenter->EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
while (!m_set0xa8.empty()) {
|
||||
MxCoreSet::iterator it = m_set0xa8.begin();
|
||||
MxCore* object = *it;
|
||||
m_set0xa8.erase(it);
|
||||
|
||||
if (object->IsA("MxPresenter")) {
|
||||
MxPresenter* presenter = (MxPresenter*) object;
|
||||
MxDSAction* action = presenter->GetAction();
|
||||
|
||||
if (action) {
|
||||
FUN_100b7220(action, MxDSAction::c_world, FALSE);
|
||||
presenter->EndAction();
|
||||
}
|
||||
}
|
||||
else
|
||||
delete object;
|
||||
}
|
||||
|
||||
MxPresenterListCursor controlPresenterCursor(&m_controlPresenters);
|
||||
|
||||
while (controlPresenterCursor.First(presenter)) {
|
||||
controlPresenterCursor.Detach();
|
||||
|
||||
MxDSAction* action = presenter->GetAction();
|
||||
if (action) {
|
||||
FUN_100b7220(action, MxDSAction::c_world, FALSE);
|
||||
presenter->EndAction();
|
||||
}
|
||||
}
|
||||
|
||||
if (m_unk0xec != -1 && m_set0xd0.empty()) {
|
||||
PlantManager()->FUN_100263a0(m_unk0xec);
|
||||
BuildingManager()->FUN_1002fb30();
|
||||
}
|
||||
|
||||
if (m_entityList) {
|
||||
LegoEntityListCursor cursor(m_entityList);
|
||||
LegoEntity* entity;
|
||||
|
||||
while (cursor.First(entity)) {
|
||||
cursor.Detach();
|
||||
|
||||
if (!(entity->GetFlags() & LegoEntity::c_bit2))
|
||||
delete entity;
|
||||
}
|
||||
|
||||
delete m_entityList;
|
||||
m_entityList = NULL;
|
||||
}
|
||||
|
||||
if (m_cacheSoundList) {
|
||||
LegoCacheSoundListCursor cursor(m_cacheSoundList);
|
||||
LegoCacheSound* sound;
|
||||
|
||||
while (cursor.First(sound)) {
|
||||
cursor.Detach();
|
||||
SoundManager()->GetUnknown0x40()->FUN_1003dc40(&sound);
|
||||
}
|
||||
|
||||
delete m_cacheSoundList;
|
||||
m_cacheSoundList = NULL;
|
||||
}
|
||||
|
||||
while (!m_list0xe0.empty()) {
|
||||
AutoROI* roi = m_list0xe0.front();
|
||||
m_list0xe0.pop_front();
|
||||
delete roi;
|
||||
}
|
||||
|
||||
if (!p_fromDestructor)
|
||||
LegoEntity::Destroy(FALSE);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1001f5e0
|
||||
|
||||
Reference in New Issue
Block a user