From 341a1ec5709c01ee4bc49d344be5b65542789f3e Mon Sep 17 00:00:00 2001 From: Joshua Peisach Date: Sun, 24 Mar 2024 21:33:51 -0400 Subject: [PATCH] Start InfoCenterEntity::VTable0x50 implementation --- .../lego/legoomni/include/infocenterentity.h | 3 +- LEGO1/lego/legoomni/include/isle.h | 1 + LEGO1/lego/legoomni/include/policeentity.h | 2 +- .../src/infocenter/infocenterentity.cpp | 48 +++++++++++++++++++ LEGO1/lego/legoomni/src/worlds/isle.cpp | 6 +++ 5 files changed, 57 insertions(+), 3 deletions(-) diff --git a/LEGO1/lego/legoomni/include/infocenterentity.h b/LEGO1/lego/legoomni/include/infocenterentity.h index 0584db7f..82fa3d30 100644 --- a/LEGO1/lego/legoomni/include/infocenterentity.h +++ b/LEGO1/lego/legoomni/include/infocenterentity.h @@ -20,8 +20,7 @@ class InfoCenterEntity : public BuildingEntity { return !strcmp(p_name, InfoCenterEntity::ClassName()) || BuildingEntity::IsA(p_name); } - // STUB: LEGO1 0x100150c0 - MxLong VTable0x50(MxParam& p_param) override { return 0; } + MxLong VTable0x50(MxParam& p_param) override; // vtable+0x50 // SYNTHETIC: LEGO1 0x1000f7b0 // InfoCenterEntity::`scalar deleting destructor' diff --git a/LEGO1/lego/legoomni/include/isle.h b/LEGO1/lego/legoomni/include/isle.h index 0439d0a1..38895964 100644 --- a/LEGO1/lego/legoomni/include/isle.h +++ b/LEGO1/lego/legoomni/include/isle.h @@ -69,6 +69,7 @@ class Isle : public LegoWorld { void FUN_10031590(); void FUN_10032620(); void FUN_100330e0(); + void FUN_10033350(); void FUN_10032d30( IsleScript::Script p_script, JukeboxScript::Script p_music, diff --git a/LEGO1/lego/legoomni/include/policeentity.h b/LEGO1/lego/legoomni/include/policeentity.h index 42792204..48156150 100644 --- a/LEGO1/lego/legoomni/include/policeentity.h +++ b/LEGO1/lego/legoomni/include/policeentity.h @@ -20,7 +20,7 @@ class PoliceEntity : public BuildingEntity { return !strcmp(p_name, PoliceEntity::ClassName()) || BuildingEntity::IsA(p_name); } - MxLong VTable0x50(MxParam& p_param) override; + MxLong VTable0x50(MxParam& p_param) override; // vtable+0x50 // SYNTHETIC: LEGO1 0x1000f900 // PoliceEntity::`scalar deleting destructor' diff --git a/LEGO1/lego/legoomni/src/infocenter/infocenterentity.cpp b/LEGO1/lego/legoomni/src/infocenter/infocenterentity.cpp index 0f5689ac..1fbe4a38 100644 --- a/LEGO1/lego/legoomni/src/infocenter/infocenterentity.cpp +++ b/LEGO1/lego/legoomni/src/infocenter/infocenterentity.cpp @@ -1,3 +1,51 @@ #include "infocenterentity.h" +#include "act1state.h" +#include "act2main_actions.h" +#include "act3_actions.h" +#include "act3state.h" +#include "isle.h" +#include "isle_actions.h" +#include "islepathactor.h" +#include "legoact2state.h" +#include "legoanimationmanager.h" +#include "legogamestate.h" +#include "legoomni.h" +#include "legoutils.h" +#include "legoworld.h" +#include "misc.h" +#include "mxtransitionmanager.h" + DECOMP_SIZE_ASSERT(InfoCenterEntity, 0x68) + +// FUNCTION: LEGO1 0x100150c0 +MxLong InfoCenterEntity::VTable0x50(MxParam& p_param) +{ + Isle* isle; + switch (GameState()->GetCurrentAct()) { + case LegoGameState::Act::e_act1: + if (CurrentActor()->GetActorId() != GameState()->GetActorId()) { + CurrentActor()->VTable0xe4(); + } + + isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle); + isle->FUN_10033350(); + + // Act1State* act1state = (Act1State*) GameState()->GetState("Act1State"); + break; + case LegoGameState::Act::e_act2: + isle = (Isle*) FindWorld(*g_act2mainScript, Act2mainScript::c__Act2Main); + // FIXME: something eles goes here + // LegoAct2State* act2state = (LegoAct2State*) GameState()->GetState("LegoAct2State"); + break; + case LegoGameState::Act::e_act3: + isle = (Isle*) FindWorld(*g_act3Script, Act3Script::c__Act3); + // TODO: something with the lists + break; + } + + AnimationManager()->FUN_10061010(NULL); + TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); + + return 1; +} diff --git a/LEGO1/lego/legoomni/src/worlds/isle.cpp b/LEGO1/lego/legoomni/src/worlds/isle.cpp index 9f6c8353..e887087c 100644 --- a/LEGO1/lego/legoomni/src/worlds/isle.cpp +++ b/LEGO1/lego/legoomni/src/worlds/isle.cpp @@ -1115,3 +1115,9 @@ MxBool Isle::VTable0x64() // TODO return FALSE; } + +// STUB: LEGO1 0x10033350 +void Isle::FUN_10033350() +{ + // TODO +}