Implement/match LegoWorld::PresentersPending (#494)

* Implement/match LegoWorld::PresentersPending

* Rename functions
This commit is contained in:
Christian Semmler 2024-01-27 15:18:35 -05:00 committed by GitHub
parent fadf8e7fd5
commit 19c771b85d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 90 additions and 49 deletions

View file

@ -29,7 +29,7 @@ class Act3 : public LegoWorld {
virtual MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
virtual void Destroy(MxBool p_fromDestructor) override; // vtable+0x1c
virtual void VTable0x50() override; // vtable+0x50
virtual void ReadyWorld() override; // vtable+0x50
virtual MxBool VTable0x5c() override; // vtable+0x5c
virtual void VTable0x60() override; // vtable+0x60
virtual MxBool VTable0x64() override; // vtable+0x64

View file

@ -24,7 +24,7 @@ class CarRace : public LegoRace {
}
virtual MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
virtual void VTable0x50() override; // vtable+0x50
virtual void ReadyWorld() override; // vtable+0x50
virtual MxBool VTable0x64() override; // vtable+0x64
virtual undefined4 VTable0x6c(undefined4) override; // vtable+0x6c
virtual undefined4 VTable0x70(undefined4) override; // vtable+0x70

View file

@ -27,7 +27,7 @@ class ElevatorBottom : public LegoWorld {
}
virtual MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
virtual void VTable0x50() override; // vtable+0x50
virtual void ReadyWorld() override; // vtable+0x50
// FUNCTION: LEGO1 0x10017f10
virtual MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c

View file

@ -30,7 +30,7 @@ class GasStation : public LegoWorld {
}
virtual MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
virtual void VTable0x50() override; // vtable+0x50
virtual void ReadyWorld() override; // vtable+0x50
virtual MxBool VTable0x5c() override; // vtable+0x5c
virtual MxBool VTable0x64() override; // vtable+0x64
virtual void VTable0x68(MxBool p_add) override; // vtable+0x68

View file

@ -26,7 +26,7 @@ class HistoryBook : public LegoWorld {
}
virtual MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
virtual void VTable0x50() override; // vtable+0x50
virtual void ReadyWorld() override; // vtable+0x50
virtual MxBool VTable0x64() override; // vtable+0x64
// SYNTHETIC: LEGO1 0x100824b0

View file

@ -28,7 +28,7 @@ class Hospital : public LegoWorld {
}
virtual MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
virtual void VTable0x50() override; // vtable+0x50
virtual void ReadyWorld() override; // vtable+0x50
virtual MxBool VTable0x5c() override; // vtable+0x5c
virtual MxBool VTable0x64() override; // vtable+0x64
virtual void VTable0x68(MxBool p_add) override; // vtable+0x68

View file

@ -149,7 +149,7 @@ class Infocenter : public LegoWorld {
}
virtual MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
virtual void VTable0x50() override; // vtable+0x50
virtual void ReadyWorld() override; // vtable+0x50
virtual MxBool VTable0x5c() override; // vtable+0x5c
virtual MxBool VTable0x64() override; // vtable+0x64
virtual void VTable0x68(MxBool p_add) override; // vtable+0x68

View file

@ -26,7 +26,7 @@ class InfocenterDoor : public LegoWorld {
}
virtual MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
virtual void VTable0x50() override; // vtable+0x50
virtual void ReadyWorld() override; // vtable+0x50
// FUNCTION: LEGO1 0x100377a0
virtual MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c

View file

@ -40,7 +40,7 @@ class Isle : public LegoWorld {
}
virtual MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
virtual void VTable0x50() override; // vtable+50
virtual void ReadyWorld() override; // vtable+50
virtual void Add(MxCore* p_object) override; // vtable+58
// FUNCTION: LEGO1 0x10030900
virtual MxBool VTable0x5c() override { return TRUE; } // vtable+5c

View file

@ -27,7 +27,7 @@ class JukeBox : public LegoWorld {
}
virtual MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
virtual void VTable0x50() override; // vtable+0x50
virtual void ReadyWorld() override; // vtable+0x50
virtual MxBool VTable0x5c() override; // vtable+0x5c
virtual MxBool VTable0x64() override; // vtable+0x64
virtual void VTable0x68(MxBool p_add) override; // vtable+0x68

View file

@ -12,7 +12,7 @@ class LegoAct2 : public LegoWorld {
virtual MxLong Notify(MxParam& p_param) override; // vtable+0x04
virtual MxResult Tickle() override; // vtable+0x08
virtual MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
virtual void VTable0x50() override; // vtable+0x50
virtual void ReadyWorld() override; // vtable+0x50
virtual MxBool VTable0x5c() override; // vtable+0x5c
virtual void VTable0x60() override; // vtable+0x60
virtual MxBool VTable0x64() override; // vtable+0x64

View file

@ -27,7 +27,7 @@ class LegoCarBuild : public LegoWorld {
}
virtual MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
virtual void VTable0x50() override; // vtable+0x50
virtual void ReadyWorld() override; // vtable+0x50
virtual MxBool VTable0x5c() override; // vtable+0x5c
virtual MxBool VTable0x64() override; // vtable+0x64
virtual void VTable0x68(MxBool p_add) override; // vtable+0x68

View file

@ -24,6 +24,14 @@ typedef set<MxCore*, CoreSetCompare> MxCoreSet;
// SIZE 0xf8
class LegoWorld : public LegoEntity {
public:
enum StartupTicks {
e_start = 0,
e_one,
e_two,
e_three,
e_four
};
LegoWorld();
virtual ~LegoWorld() override; // vtable+0x0
@ -45,7 +53,7 @@ class LegoWorld : public LegoEntity {
virtual MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
virtual void Destroy(MxBool p_fromDestructor) override; // vtable+0x1c
virtual void VTable0x50(); // vtable+0x50
virtual void ReadyWorld(); // vtable+0x50
virtual LegoCameraController* VTable0x54(); // vtable+0x54
virtual void Add(MxCore* p_object); // vtable+0x58
virtual MxBool VTable0x5c(); // vtable+0x5c
@ -59,7 +67,7 @@ class LegoWorld : public LegoEntity {
inline LegoCameraController* GetCamera() { return m_cameraController; }
inline undefined4 GetUnknown0xec() { return m_unk0xec; }
undefined FUN_100220e0();
MxBool PresentersPending();
void Remove(MxCore* p_object);
void FUN_1001fc80(IslePathActor* p_actor);
MxS32 GetCurrPathInfo(LegoPathBoundary** p_path, MxS32& p_value);
@ -82,7 +90,7 @@ class LegoWorld : public LegoEntity {
list<AutoROI*> m_list0xe0; // 0xe0
undefined4 m_unk0xec; // 0xec
LegoHideAnimPresenter* m_hideAnimPresenter; // 0xf0
MxS16 m_unk0xf4; // 0xf4
MxS16 m_startupTicks; // 0xf4
MxBool m_worldStarted; // 0xf6
undefined m_unk0xf7; // 0xf7
};

View file

@ -31,7 +31,7 @@ class Police : public LegoWorld {
}
virtual MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
virtual void VTable0x50() override; // vtable+0x50
virtual void ReadyWorld() override; // vtable+0x50
virtual MxBool VTable0x5c() override; // vtable+0x5c
virtual MxBool VTable0x64() override; // vtable+0x64
virtual void VTable0x68(MxBool p_add) override; // vtable+0x68

View file

@ -27,7 +27,7 @@ class RegistrationBook : public LegoWorld {
}
virtual MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
virtual void VTable0x50() override; // vtable+0x50
virtual void ReadyWorld() override; // vtable+0x50
virtual MxBool VTable0x64() override; // vtable+0x64
virtual void VTable0x68(MxBool p_add) override; // vtable+0x68

View file

@ -32,7 +32,7 @@ class Score : public LegoWorld {
// Score::`scalar deleting destructor'
virtual MxResult Create(MxDSAction& p_dsAction) override; // vtable+18
virtual void VTable0x50() override; // vtable+50
virtual void ReadyWorld() override; // vtable+50
virtual MxBool VTable0x5c() override; // vtable+5c
virtual MxBool VTable0x64() override; // vtable+64
virtual void VTable0x68(MxBool p_add) override; // vtable+68

View file

@ -29,7 +29,7 @@ MxLong LegoAct2::Notify(MxParam& p_param)
}
// STUB: LEGO1 0x10050a80
void LegoAct2::VTable0x50()
void LegoAct2::ReadyWorld()
{
// TODO
}

View file

@ -54,7 +54,7 @@ MxLong Act3::Notify(MxParam& p_param)
}
// STUB: LEGO1 0x10073270
void Act3::VTable0x50()
void Act3::ReadyWorld()
{
// TODO
}

View file

@ -43,7 +43,7 @@ MxLong LegoCarBuild::Notify(MxParam& p_param)
}
// STUB: LEGO1 0x100242c0
void LegoCarBuild::VTable0x50()
void LegoCarBuild::ReadyWorld()
{
// TODO
}

View file

@ -26,7 +26,7 @@ DECOMP_SIZE_ASSERT(LegoCacheSoundListCursor, 0x10)
// FUNCTION: LEGO1 0x1001ca40
LegoWorld::LegoWorld() : m_list0x68(TRUE)
{
m_unk0xf4 = 4;
m_startupTicks = e_four;
m_cameraController = NULL;
m_entityList = NULL;
m_cacheSoundList = NULL;
@ -495,30 +495,63 @@ void LegoWorld::VTable0x68(MxBool p_add)
MxResult LegoWorld::Tickle()
{
if (!m_worldStarted) {
switch (m_unk0xf4) {
case 0:
switch (m_startupTicks) {
case e_start:
m_worldStarted = TRUE;
SetAppCursor(0);
VTable0x50();
ReadyWorld();
return TRUE;
case 2:
if (FUN_100220e0() == 1)
case e_two:
if (PresentersPending())
break;
default:
m_unk0xf4--;
m_startupTicks--;
}
}
return TRUE;
}
// STUB: LEGO1 0x100220e0
undefined LegoWorld::FUN_100220e0()
// FUNCTION: LEGO1 0x100220e0
MxBool LegoWorld::PresentersPending()
{
return 0;
MxPresenterListCursor controlPresenterCursor(&m_controlPresenters);
MxPresenter* presenter;
while (controlPresenterCursor.Next(presenter)) {
if (presenter->IsEnabled() && !presenter->HasTickleStatePassed(MxPresenter::e_starting))
return TRUE;
}
MxPresenterListCursor animPresenterCursor(&m_animPresenters);
while (animPresenterCursor.Next(presenter)) {
if (presenter->IsEnabled()) {
if (presenter->IsA("LegoLocomotionAnimPresenter")) {
if (!presenter->HasTickleStatePassed(MxPresenter::e_ready))
return TRUE;
}
else {
if (!presenter->HasTickleStatePassed(MxPresenter::e_starting))
return TRUE;
}
}
}
for (MxCoreSet::iterator it = m_set0xa8.begin(); it != m_set0xa8.end(); it++) {
if ((*it)->IsA("MxPresenter")) {
presenter = (MxPresenter*) *it;
if (presenter->IsEnabled() && !presenter->HasTickleStatePassed(MxPresenter::e_starting))
return TRUE;
}
}
return FALSE;
}
// FUNCTION: LEGO1 0x10022340
void LegoWorld::VTable0x50()
void LegoWorld::ReadyWorld()
{
TickleManager()->UnregisterClient(this);
}

View file

@ -48,7 +48,7 @@ MxLong GasStation::Notify(MxParam& p_param)
}
// STUB: LEGO1 0x10004b30
void GasStation::VTable0x50()
void GasStation::ReadyWorld()
{
// TODO
}

View file

@ -52,7 +52,7 @@ MxLong Hospital::Notify(MxParam& p_param)
}
// STUB: LEGO1 0x10074a60
void Hospital::VTable0x50()
void Hospital::ReadyWorld()
{
// TODO
}

View file

@ -65,9 +65,9 @@ MxLong ElevatorBottom::Notify(MxParam& p_param)
}
// FUNCTION: LEGO1 0x100181b0
void ElevatorBottom::VTable0x50()
void ElevatorBottom::ReadyWorld()
{
LegoWorld::VTable0x50();
LegoWorld::ReadyWorld();
PlayMusic(JukeBox::e_informationCenter);
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
}

View file

@ -298,7 +298,7 @@ MxLong Infocenter::HandleEndAction(MxParam& p_param)
}
// STUB: LEGO1 0x1006f4e0
void Infocenter::VTable0x50()
void Infocenter::ReadyWorld()
{
m_infoManDialogueTimer = 0;
m_bookAnimationTimer = 0;

View file

@ -53,9 +53,9 @@ MxLong InfocenterDoor::Notify(MxParam& p_param)
}
// FUNCTION: LEGO1 0x10037a70
void InfocenterDoor::VTable0x50()
void InfocenterDoor::ReadyWorld()
{
LegoWorld::VTable0x50();
LegoWorld::ReadyWorld();
PlayMusic(JukeBox::e_informationCenter);
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
}

View file

@ -29,7 +29,7 @@ MxLong RegistrationBook::Notify(MxParam& p_param)
}
// STUB: LEGO1 0x10077cc0
void RegistrationBook::VTable0x50()
void RegistrationBook::ReadyWorld()
{
// TODO
}

View file

@ -129,9 +129,9 @@ MxLong Score::FUN_10001510(MxEndActionNotificationParam& p_param)
}
// FUNCTION: LEGO1 0x10001580
void Score::VTable0x50()
void Score::ReadyWorld()
{
LegoWorld::VTable0x50();
LegoWorld::ReadyWorld();
MxDSAction action;
action.SetObjectId(0x1f4);

View file

@ -28,7 +28,7 @@ MxLong HistoryBook::Notify(MxParam& p_param)
}
// STUB: LEGO1 0x100826f0
void HistoryBook::VTable0x50()
void HistoryBook::ReadyWorld()
{
// TODO
}

View file

@ -153,9 +153,9 @@ MxLong Isle::StopAction(MxParam& p_param)
}
// FUNCTION: LEGO1 0x10030fc0
void Isle::VTable0x50()
void Isle::ReadyWorld()
{
LegoWorld::VTable0x50();
LegoWorld::ReadyWorld();
if (m_act1state->GetUnknown21()) {
GameState()->HandleAction(2);

View file

@ -35,7 +35,7 @@ MxLong JukeBox::Notify(MxParam& p_param)
}
// STUB: LEGO1 0x1005d9f0
void JukeBox::VTable0x50()
void JukeBox::ReadyWorld()
{
// TODO
}

View file

@ -69,9 +69,9 @@ MxLong Police::Notify(MxParam& p_param)
}
// FUNCTION: LEGO1 0x1005e530
void Police::VTable0x50()
void Police::ReadyWorld()
{
LegoWorld::VTable0x50();
LegoWorld::ReadyWorld();
PlayMusic(JukeBox::e_policeStation);
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
}

View file

@ -17,7 +17,7 @@ MxResult CarRace::Create(MxDSAction& p_dsAction)
}
// STUB: LEGO1 0x10016dd0
void CarRace::VTable0x50()
void CarRace::ReadyWorld()
{
// TODO
}