Implement/match FUN_10032620 (#687)

This commit is contained in:
Christian Semmler 2024-03-18 10:38:02 -04:00 committed by GitHub
parent 937a45020c
commit ba5bc46c0c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 62 additions and 30 deletions

View file

@ -79,7 +79,7 @@ class Isle : public LegoWorld {
virtual void VTable0x6c(IslePathActor* p_actor); // vtable+6c virtual void VTable0x6c(IslePathActor* p_actor); // vtable+6c
MxLong StopAction(MxParam& p_param); MxLong StopAction(MxParam& p_param);
MxLong HandleType17Notification(MxParam& p_param); MxLong HandleClick(MxParam& p_param);
MxLong HandleType19Notification(MxParam& p_param); MxLong HandleType19Notification(MxParam& p_param);
MxLong HandleTransitionEnd(); MxLong HandleTransitionEnd();
void FUN_10032620(); void FUN_10032620();

View file

@ -2,6 +2,7 @@
#define ISLEPATHACTOR_H #define ISLEPATHACTOR_H
#include "legocontrolmanager.h" #include "legocontrolmanager.h"
#include "legogamestate.h"
#include "legopathactor.h" #include "legopathactor.h"
#include "legoworld.h" #include "legoworld.h"
#include "mxtype18notificationparam.h" #include "mxtype18notificationparam.h"
@ -52,8 +53,8 @@ class IslePathActor : public LegoPathActor {
virtual void VTable0xe0(); // vtable+0xe0 virtual void VTable0xe0(); // vtable+0xe0
virtual void VTable0xe4(); // vtable+0xe4 virtual void VTable0xe4(); // vtable+0xe4
virtual void VTable0xe8(MxU32, MxBool, MxU8); // vtable+0xe8 virtual void VTable0xe8(LegoGameState::Area, MxBool, MxU8); // vtable+0xe8
virtual void VTable0xec(); // vtable+0xec virtual void VTable0xec(MxMatrix, MxU32, MxBool); // vtable+0xec
// SYNTHETIC: LEGO1 0x10002ff0 // SYNTHETIC: LEGO1 0x10002ff0
// IslePathActor::`scalar deleting destructor' // IslePathActor::`scalar deleting destructor'

View file

@ -68,14 +68,20 @@ class LegoGameState {
e_dunecarbuild, e_dunecarbuild,
e_jetskibuild, e_jetskibuild,
e_racecarbuild, e_racecarbuild,
e_unk40,
e_unk41,
e_unk42,
e_act2main = 46, e_unk45 = 45,
e_act2main,
e_act3script, e_act3script,
e_unk48,
e_unk49,
e_jukeboxw = 53, e_jukeboxw = 53,
e_unk54, e_unk54,
e_unk55,
e_histbook = 56, e_histbook,
e_bike, e_bike,
e_dunecar, e_dunecar,
e_motocycle, e_motocycle,

View file

@ -62,7 +62,7 @@ void Helicopter::GetState()
void Helicopter::VTable0xe4() void Helicopter::VTable0xe4()
{ {
if (GameState()->GetCurrentAct() == LegoGameState::e_act1) { if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
VTable0xe8(0x28, TRUE, 7); VTable0xe8(LegoGameState::e_unk40, TRUE, 7);
} }
IslePathActor::VTable0xe4(); IslePathActor::VTable0xe4();
@ -71,7 +71,7 @@ void Helicopter::VTable0xe4()
GameState()->SetCurrentArea(LegoGameState::e_copter); GameState()->SetCurrentArea(LegoGameState::e_copter);
if (CurrentActor()) { if (CurrentActor()) {
if (CurrentActor()->IsA("IslePathActor")) { if (CurrentActor()->IsA("IslePathActor")) {
((IslePathActor*) CurrentActor())->VTable0xe8(0x37, TRUE, 7); ((IslePathActor*) CurrentActor())->VTable0xe8(LegoGameState::e_unk55, TRUE, 7);
} }
} }
} }
@ -114,7 +114,7 @@ MxU32 Helicopter::VTable0xcc()
case LegoGameState::e_act1: case LegoGameState::e_act1:
m_script = *g_isleScript; m_script = *g_isleScript;
AnimationManager()->FUN_10064670(FALSE); AnimationManager()->FUN_10064670(FALSE);
VTable0xe8(0x29, TRUE, 7); VTable0xe8(LegoGameState::e_unk41, TRUE, 7);
((Isle*) CurrentWorld())->SetDestLocation(LegoGameState::e_copter); ((Isle*) CurrentWorld())->SetDestLocation(LegoGameState::e_copter);
FUN_10015820(TRUE, 0); FUN_10015820(TRUE, 0);
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, TRUE); TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, TRUE);
@ -253,10 +253,10 @@ MxU32 Helicopter::VTable0xd8(MxType18NotificationParam& p_param)
case 1: { case 1: {
if (GameState()->GetCurrentAct() == LegoGameState::e_act1) { if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
((Act1State*) GameState()->GetState("Act1State"))->SetUnknown18(4); ((Act1State*) GameState()->GetState("Act1State"))->SetUnknown18(4);
VTable0xe8(0x2a, TRUE, 7); VTable0xe8(LegoGameState::e_unk42, TRUE, 7);
} }
else { else {
VTable0xe8(0x31, TRUE, 7); VTable0xe8(LegoGameState::e_unk49, TRUE, 7);
} }
m_state->SetUnknown8(2); m_state->SetUnknown8(2);
@ -290,10 +290,10 @@ MxU32 Helicopter::VTable0xd8(MxType18NotificationParam& p_param)
if (GameState()->GetCurrentAct() == LegoGameState::e_act1) { if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
((Act1State*) GameState()->GetState("Act1State"))->SetUnknown18(0); ((Act1State*) GameState()->GetState("Act1State"))->SetUnknown18(0);
VTable0xe8(0x29, TRUE, 7); VTable0xe8(LegoGameState::e_unk41, TRUE, 7);
} }
else { else {
VTable0xe8(0x30, TRUE, 7); VTable0xe8(LegoGameState::e_unk48, TRUE, 7);
} }
m_state->SetUnknown8(0); m_state->SetUnknown8(0);

View file

@ -45,13 +45,13 @@ void IslePathActor::VTable0xe4()
} }
// STUB: LEGO1 0x1001b2a0 // STUB: LEGO1 0x1001b2a0
void IslePathActor::VTable0xe8(MxU32, MxBool, MxU8) void IslePathActor::VTable0xe8(LegoGameState::Area, MxBool, MxU8)
{ {
// TODO // TODO
} }
// STUB: LEGO1 0x1001b5b0 // STUB: LEGO1 0x1001b5b0
void IslePathActor::VTable0xec() void IslePathActor::VTable0xec(MxMatrix, MxU32, MxBool)
{ {
// TODO // TODO
} }

View file

@ -102,7 +102,7 @@ MxResult Hospital::Create(MxDSAction& p_dsAction)
// FUNCTION: LEGO1 0x10074990 // FUNCTION: LEGO1 0x10074990
MxLong Hospital::Notify(MxParam& p_param) MxLong Hospital::Notify(MxParam& p_param)
{ {
MxResult result = SUCCESS; MxLong result = 0;
LegoWorld::Notify(p_param); LegoWorld::Notify(p_param);
if (m_worldStarted) { if (m_worldStarted) {

View file

@ -51,7 +51,7 @@ Isle::Isle()
m_skateboard = NULL; m_skateboard = NULL;
m_racecar = NULL; m_racecar = NULL;
m_jetski = NULL; m_jetski = NULL;
m_act1state = 0; m_act1state = NULL;
m_destLocation = LegoGameState::e_undefined; m_destLocation = LegoGameState::e_undefined;
NotificationManager()->Register(this); NotificationManager()->Register(this);
@ -137,7 +137,7 @@ MxLong Isle::Notify(MxParam& p_param)
} }
break; break;
case c_notificationClick: case c_notificationClick:
result = HandleType17Notification(p_param); result = HandleClick(p_param);
break; break;
case c_notificationType18: case c_notificationType18:
switch (m_act1state->GetUnknown18()) { switch (m_act1state->GetUnknown18()) {
@ -183,7 +183,7 @@ void Isle::ReadyWorld()
m_act1state->SetUnknown18(0); m_act1state->SetUnknown18(0);
m_act1state->SetUnknown21(0); m_act1state->SetUnknown21(0);
} }
else if (GameState()->GetLoadedAct()) { else if (GameState()->GetLoadedAct() != LegoGameState::e_act1) {
FUN_1003ef00(TRUE); FUN_1003ef00(TRUE);
FUN_10032620(); FUN_10032620();
m_act1state->FUN_10034d00(); m_act1state->FUN_10034d00();
@ -192,7 +192,7 @@ void Isle::ReadyWorld()
} }
// STUB: LGEO1 0x10031030 // STUB: LGEO1 0x10031030
MxLong Isle::HandleType17Notification(MxParam& p_param) MxLong Isle::HandleClick(MxParam& p_param)
{ {
return 0; return 0;
} }
@ -252,7 +252,7 @@ void Isle::Enable(MxBool p_enable)
if (CurrentActor() != NULL && CurrentActor()->IsA("Jetski")) { if (CurrentActor() != NULL && CurrentActor()->IsA("Jetski")) {
IslePathActor* actor = CurrentActor(); IslePathActor* actor = CurrentActor();
actor->VTable0xe8(0x2d, FALSE, 7); actor->VTable0xe8(LegoGameState::e_unk45, FALSE, 7);
actor->SetUnknownDC(0); actor->SetUnknownDC(0);
} }
else { else {
@ -428,7 +428,7 @@ void Isle::Enable(MxBool p_enable)
} }
break; break;
case 5: { case 5: {
CurrentActor()->VTable0xe8(0xf, FALSE, 7); CurrentActor()->VTable0xe8(LegoGameState::e_jetrace2, FALSE, 7);
JetskiRaceState* raceState = (JetskiRaceState*) GameState()->GetState("JetskiRaceState"); JetskiRaceState* raceState = (JetskiRaceState*) GameState()->GetState("JetskiRaceState");
if (raceState->GetUnknown0x28() == 2) { if (raceState->GetUnknown0x28() == 2) {
@ -456,8 +456,7 @@ void Isle::Enable(MxBool p_enable)
} }
case 6: { case 6: {
GameState()->m_currentArea = LegoGameState::e_carraceExterior; GameState()->m_currentArea = LegoGameState::e_carraceExterior;
CurrentActor()->VTable0xe8(0x15, FALSE, 7); CurrentActor()->VTable0xe8(LegoGameState::e_unk21, FALSE, 7);
CarRaceState* raceState = (CarRaceState*) GameState()->GetState("CarRaceState"); CarRaceState* raceState = (CarRaceState*) GameState()->GetState("CarRaceState");
if (raceState->GetUnknown0x28() == 2) { if (raceState->GetUnknown0x28() == 2) {
@ -502,7 +501,7 @@ void Isle::Enable(MxBool p_enable)
break; break;
case 11: case 11:
m_act1state->m_unk0x018 = 0; m_act1state->m_unk0x018 = 0;
CurrentActor()->VTable0xe8(0x36, TRUE, 7); CurrentActor()->VTable0xe8(LegoGameState::e_unk54, TRUE, 7);
GameState()->m_currentArea = LegoGameState::e_unk66; GameState()->m_currentArea = LegoGameState::e_unk66;
FUN_1003ef00(TRUE); FUN_1003ef00(TRUE);
m_jukebox->StartAction(); m_jukebox->StartAction();
@ -540,10 +539,32 @@ void Isle::Enable(MxBool p_enable)
} }
} }
// STUB: LEGO1 0x10032620 // FUNCTION: LEGO1 0x10032620
void Isle::FUN_10032620() void Isle::FUN_10032620()
{ {
// TODO VideoManager()->Get3DManager()->SetFrustrum(90.0, 0.1, 250.0);
switch (GameState()->m_currentArea) {
case LegoGameState::e_unk66: {
MxMatrix mat(CurrentActor()->GetROI()->GetLocal2World());
MxU32 unk0x88 = CurrentActor()->GetUnknown88();
CurrentActor()->VTable0xec(mat, unk0x88, TRUE);
break;
}
case LegoGameState::e_unk4:
case LegoGameState::e_jetraceExterior:
case LegoGameState::e_unk17:
case LegoGameState::e_carraceExterior:
case LegoGameState::e_unk20:
case LegoGameState::e_pizzeriaExterior:
case LegoGameState::e_garageExterior:
case LegoGameState::e_hospitalExterior:
case LegoGameState::e_unk31:
case LegoGameState::e_policeExterior:
CurrentActor()->VTable0xe8(GameState()->m_currentArea, TRUE, 7);
GameState()->m_currentArea = LegoGameState::e_unk66;
break;
}
} }
// FUNCTION: LEGO1 0x100327a0 // FUNCTION: LEGO1 0x100327a0

View file

@ -124,7 +124,7 @@ MxLong RegistrationBook::HandleClick(LegoControlManagerEvent& p_param)
if (unk0x28 == 28) { if (unk0x28 == 28) {
DeleteObjects(&m_atom, RegbookScript::c_iic006in_RunAnim, RegbookScript::c_iic008in_PlayWav); DeleteObjects(&m_atom, RegbookScript::c_iic006in_RunAnim, RegbookScript::c_iic008in_PlayWav);
if (GameState()->GetCurrentAct() == 0) { if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
m_infocenterState->SetUnknown0x74(15); m_infocenterState->SetUnknown0x74(15);
} }
else { else {

View file

@ -8,8 +8,12 @@
class MxMatrix : public Matrix4 { class MxMatrix : public Matrix4 {
public: public:
inline MxMatrix() : Matrix4(m_elements) {} inline MxMatrix() : Matrix4(m_elements) {}
// FUNCTION: LEGO1 0x10032770
inline MxMatrix(const MxMatrix& p_matrix) : Matrix4(m_elements) { Equals(p_matrix); } inline MxMatrix(const MxMatrix& p_matrix) : Matrix4(m_elements) { Equals(p_matrix); }
inline MxMatrix(const Matrix4& p_matrix) : Matrix4(m_elements) { Equals(p_matrix); }
float* operator[](size_t idx) { return m_data[idx]; } float* operator[](size_t idx) { return m_data[idx]; }
const float* operator[](size_t idx) const { return m_data[idx]; } const float* operator[](size_t idx) const { return m_data[idx]; }