InfoCenterEntity::VTable0x50 implementation (#725)

* Start InfoCenterEntity::VTable0x50 implementation

* Fully implement InfoCenterEntity::VTable0x50

* Fix function name typo

* match

* fix style

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
Joshua Peisach 2024-03-29 14:09:53 -04:00 committed by GitHub
parent 2c57e33ce5
commit 87f633af54
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 74 additions and 8 deletions

View file

@ -35,8 +35,8 @@ class Act3 : public LegoWorld {
MxBool VTable0x64() override; // vtable+0x64
void Enable(MxBool p_enable) override; // vtable+0x68
inline void SetUnkown420c(MxEntity* p_entity) { m_unk0x420c = p_entity; }
inline void SetUnkown4270(MxU32 p_unk0x4270) { m_unk0x4270 = p_unk0x4270; }
inline void SetUnknown420c(MxEntity* p_entity) { m_unk0x420c = p_entity; }
inline void SetUnknown4270(MxU32 p_unk0x4270) { m_unk0x4270 = p_unk0x4270; }
// SYNTHETIC: LEGO1 0x10072630
// Act3::`scalar deleting destructor'

View file

@ -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'

View file

@ -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,

View file

@ -19,6 +19,8 @@ class LegoAct2 : public LegoWorld {
MxBool VTable0x64() override; // vtable+0x64
void Enable(MxBool p_enable) override; // vtable+0x68
inline void SetUnknown0x1150(undefined4 p_unk0x1150) { m_unk0x1150 = p_unk0x1150; }
// SYNTHETIC: LEGO1 0x1004fe20
// LegoAct2::`scalar deleting destructor'

View file

@ -28,10 +28,11 @@ class LegoAct2State : public LegoState {
// LegoAct2State::`scalar deleting destructor'
inline undefined4 GetUnknown0x08() { return m_unk0x08; }
inline void SetUnknown0x0c(undefined p_unk0x0c) { m_unk0x0c = p_unk0x0c; }
private:
undefined4 m_unk0x08; // 0x08
undefined4 m_unk0x0c; // 0x0c
undefined m_unk0x0c; // 0x0c
};
#endif // LEGOACT2STATE_H

View file

@ -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'

View file

@ -41,7 +41,7 @@ MxResult Helicopter::Create(MxDSAction& p_dsAction)
LegoWorld* world = CurrentWorld();
SetWorld(world);
if (world->IsA("Act3")) {
((Act3*) GetWorld())->SetUnkown420c(this);
((Act3*) GetWorld())->SetUnknown420c(this);
}
world = GetWorld();
if (world) {
@ -160,7 +160,7 @@ MxU32 Helicopter::VTable0xd4(LegoControlManagerEvent& p_param)
switch (p_param.GetClickedObjectId()) {
case IsleScript::c_HelicopterArms_Ctl:
if (*g_act3Script == script) {
((Act3*) CurrentWorld())->SetUnkown4270(2);
((Act3*) CurrentWorld())->SetUnknown4270(2);
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
}
else if (m_state->GetUnkown8() != 0) {

View file

@ -1,3 +1,60 @@
#include "infocenterentity.h"
#include "act1state.h"
#include "act2main_actions.h"
#include "act3.h"
#include "act3_actions.h"
#include "act3state.h"
#include "isle.h"
#include "isle_actions.h"
#include "islepathactor.h"
#include "legoact2.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)
{
switch (GameState()->GetCurrentAct()) {
case LegoGameState::Act::e_act1: {
if (CurrentActor()->GetActorId() != GameState()->GetActorId()) {
CurrentActor()->VTable0xe4();
}
Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle);
isle->FUN_10033350();
isle->SetDestLocation(LegoGameState::Area::e_infomain);
Act1State* act1state = (Act1State*) GameState()->GetState("Act1State");
act1state->SetUnknown18(0);
break;
}
case LegoGameState::Act::e_act2: {
LegoAct2* act2 = (LegoAct2*) FindWorld(*g_act2mainScript, Act2mainScript::c__Act2Main);
act2->SetUnknown0x1150(2);
LegoAct2State* act2state = (LegoAct2State*) GameState()->GetState("LegoAct2State");
if (act2state) {
act2state->SetUnknown0x0c(0);
}
break;
}
case LegoGameState::Act::e_act3:
Act3* act3 = (Act3*) FindWorld(*g_act3Script, Act3Script::c__Act3);
act3->SetUnknown4270(2);
break;
}
AnimationManager()->FUN_10061010(0);
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
return 1;
}

View file

@ -1115,3 +1115,9 @@ MxBool Isle::VTable0x64()
// TODO
return FALSE;
}
// STUB: LEGO1 0x10033350
void Isle::FUN_10033350()
{
// TODO
}