Implement/match Ambulance::HandlePathStruct (#1029)

* Implement/match Ambulance::HandlePathStruct

* Add annotation
This commit is contained in:
Christian Semmler
2024-06-13 14:10:19 -04:00
committed by GitHub
parent cf7246ac6c
commit bbc304ce46
41 changed files with 371 additions and 224 deletions

View File

@@ -27,39 +27,76 @@ public:
MxResult Serialize(LegoFile* p_legoFile) override; // vtable+0x1c
inline MxU16 GetScore(MxU8 p_id)
inline MxS16 GetHighScore(MxU8 p_actorId)
{
switch (p_id) {
case 1:
return m_score1;
case 2:
return m_score2;
case 3:
return m_score3;
case 4:
return m_score4;
case 5:
return m_score5;
switch (p_actorId) {
case LegoActor::c_pepper:
return m_peHighScore;
case LegoActor::c_mama:
return m_maHighScore;
case LegoActor::c_papa:
return m_paHighScore;
case LegoActor::c_nick:
return m_niHighScore;
case LegoActor::c_laura:
return m_laHighScore;
default:
return 0;
}
}
// FUNCTION: BETA10 0x100242d0
inline void UpdateScore(ScoreColor p_score, MxS16 p_actorId)
{
switch (p_actorId) {
case LegoActor::c_pepper:
m_peScore = p_score;
if (m_peHighScore < p_score) {
m_peHighScore = p_score;
}
break;
case LegoActor::c_mama:
m_maScore = p_score;
if (m_maHighScore < p_score) {
m_maHighScore = p_score;
}
break;
case LegoActor::c_papa:
m_paScore = p_score;
if (m_paHighScore < p_score) {
m_paHighScore = p_score;
}
break;
case LegoActor::c_nick:
m_niScore = p_score;
if (m_niHighScore < p_score) {
m_niHighScore = p_score;
}
break;
case LegoActor::c_laura:
m_laScore = p_score;
if (m_laHighScore < p_score) {
m_laHighScore = p_score;
}
break;
}
}
// SYNTHETIC: LEGO1 0x100376c0
// AmbulanceMissionState::`scalar deleting destructor'
undefined4 m_unk0x08; // 0x08
MxLong m_unk0x0c; // 0x0c
MxU16 m_unk0x10; // 0x10
MxU16 m_unk0x12; // 0x12
MxU16 m_unk0x14; // 0x14
MxU16 m_unk0x16; // 0x16
MxU16 m_unk0x18; // 0x18
MxU16 m_score1; // 0x1a
MxU16 m_score2; // 0x1c
MxU16 m_score3; // 0x1e
MxU16 m_score4; // 0x20
MxU16 m_score5; // 0x22
MxS16 m_peScore; // 0x10
MxS16 m_maScore; // 0x12
MxS16 m_paScore; // 0x14
MxS16 m_niScore; // 0x16
MxS16 m_laScore; // 0x18
MxS16 m_peHighScore; // 0x1a
MxS16 m_maHighScore; // 0x1c
MxS16 m_paHighScore; // 0x1e
MxS16 m_niHighScore; // 0x20
MxS16 m_laHighScore; // 0x22
};
// VTABLE: LEGO1 0x100d71a8
@@ -85,15 +122,15 @@ public:
return !strcmp(p_name, Ambulance::ClassName()) || IslePathActor::IsA(p_name);
}
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void Destroy(MxBool p_fromDestructor) override; // vtable+0x1c
void VTable0x70(float p_time) override; // vtable+0x70
MxLong HandleClick() override; // vtable+0xcc
MxLong HandleControl(LegoControlManagerEvent& p_param) override; // vtable+0xd4
MxLong HandleNotification19(MxType19NotificationParam& p_param) override; // vtable+0xdc
void Exit() override; // vtable+0xe4
virtual MxLong HandleButtonDown(LegoControlManagerEvent& p_param); // vtable+0xf0
virtual MxLong HandleEndAction(MxEndActionNotificationParam& p_param); // vtable+0xf4
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void Destroy(MxBool p_fromDestructor) override; // vtable+0x1c
void VTable0x70(float p_time) override; // vtable+0x70
MxLong HandleClick() override; // vtable+0xcc
MxLong HandleControl(LegoControlManagerEvent& p_param) override; // vtable+0xd4
MxLong HandlePathStruct(LegoPathStructEvent& p_param) override; // vtable+0xdc
void Exit() override; // vtable+0xe4
virtual MxLong HandleButtonDown(LegoControlManagerEvent& p_param); // vtable+0xf0
virtual MxLong HandleEndAction(MxEndActionNotificationParam& p_param); // vtable+0xf4
void CreateState();
void FUN_10036e60();
@@ -106,13 +143,15 @@ public:
private:
void PlayAnimation(IsleScript::Script p_objectId);
void PlayFinalAnimation(IsleScript::Script p_objectId);
void StopAction(IsleScript::Script p_objectId);
void PlayAction(IsleScript::Script p_objectId);
void FUN_10036ec0();
undefined m_unk0x160[4]; // 0x160
AmbulanceMissionState* m_state; // 0x164
MxS16 m_unk0x168; // 0x168
MxS16 m_unk0x16a; // 0x16a
MxS16 m_actorId; // 0x16a
MxS16 m_unk0x16c; // 0x16c
MxS16 m_unk0x16e; // 0x16e
MxS16 m_unk0x170; // 0x170

View File

@@ -44,13 +44,13 @@ public:
return !strcmp(p_name, CarRace::ClassName()) || LegoRace::IsA(p_name);
}
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void ReadyWorld() override; // vtable+0x50
MxBool Escape() override; // vtable+0x64
MxLong HandleClick(LegoEventNotificationParam&) override; // vtable+0x6c
MxLong HandleType19Notification(MxType19NotificationParam&) override; // vtable+0x70
MxLong HandleEndAction(MxEndActionNotificationParam&) override; // vtable+0x74
MxLong HandleType0Notification(MxNotificationParam&) override; // vtable+0x78
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void ReadyWorld() override; // vtable+0x50
MxBool Escape() override; // vtable+0x64
MxLong HandleClick(LegoEventNotificationParam&) override; // vtable+0x6c
MxLong HandlePathStruct(LegoPathStructEvent&) override; // vtable+0x70
MxLong HandleEndAction(MxEndActionNotificationParam&) override; // vtable+0x74
MxLong HandleType0Notification(MxNotificationParam&) override; // vtable+0x78
// SYNTHETIC: LEGO1 0x10016c70
// CarRace::`scalar deleting destructor'

View File

@@ -23,12 +23,12 @@ public:
return !strcmp(p_name, DuneBuggy::ClassName()) || IslePathActor::IsA(p_name);
}
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void VTable0x70(float p_float) override; // vtable+0x70
MxLong HandleClick() override; // vtable+0xcc
MxLong HandleControl(LegoControlManagerEvent& p_param) override; // vtable+0xd4
MxLong HandleNotification19(MxType19NotificationParam& p_param) override; // vtable+0xdc
void Exit() override; // vtable+0xe4
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void VTable0x70(float p_float) override; // vtable+0x70
MxLong HandleClick() override; // vtable+0xcc
MxLong HandleControl(LegoControlManagerEvent& p_param) override; // vtable+0xd4
MxLong HandlePathStruct(LegoPathStructEvent& p_param) override; // vtable+0xdc
void Exit() override; // vtable+0xe4
void FUN_10068350();

View File

@@ -15,7 +15,7 @@ class Jetski;
class JukeBoxEntity;
class LegoNamedTexture;
class Motocycle;
class MxType19NotificationParam;
class LegoPathStructEvent;
class Pizza;
class Pizzeria;
class RaceCar;
@@ -199,7 +199,7 @@ public:
protected:
MxLong HandleEndAction(MxEndActionNotificationParam& p_param);
MxLong HandleControl(LegoControlManagerEvent& p_param);
MxLong HandleType19Notification(MxType19NotificationParam& p_param);
MxLong HandlePathStruct(LegoPathStructEvent& p_param);
MxLong HandleTransitionEnd();
void HandleElevatorEndAction();
void UpdateGlobe();

View File

@@ -9,7 +9,7 @@
class LegoControlManagerEvent;
class LegoEndAnimNotificationParam;
class LegoWorld;
class MxType19NotificationParam;
class LegoPathStructEvent;
// VTABLE: LEGO1 0x100d4398
// SIZE 0x160
@@ -119,7 +119,7 @@ public:
virtual MxLong HandleEndAnim(LegoEndAnimNotificationParam&) { return 0; } // vtable+0xd8
// FUNCTION: LEGO1 0x10002e00
virtual MxLong HandleNotification19(MxType19NotificationParam&) { return 0; } // vtable+0xdc
virtual MxLong HandlePathStruct(LegoPathStructEvent&) { return 0; } // vtable+0xdc
virtual void Enter(); // vtable+0xe0
virtual void Exit(); // vtable+0xe4

View File

@@ -48,12 +48,12 @@ public:
return !strcmp(p_name, JetskiRace::ClassName()) || LegoRace::IsA(p_name);
}
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void ReadyWorld() override; // vtable+0x50
MxBool Escape() override; // vtable+0x64
MxLong HandleClick(LegoEventNotificationParam&) override; // vtable+0x6c
MxLong HandleType19Notification(MxType19NotificationParam&) override; // vtable+0x70
MxLong HandleEndAction(MxEndActionNotificationParam&) override; // vtable+0x74
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void ReadyWorld() override; // vtable+0x50
MxBool Escape() override; // vtable+0x64
MxLong HandleClick(LegoEventNotificationParam&) override; // vtable+0x6c
MxLong HandlePathStruct(LegoPathStructEvent&) override; // vtable+0x70
MxLong HandleEndAction(MxEndActionNotificationParam&) override; // vtable+0x74
};
// SYNTHETIC: LEGO1 0x1000f530

View File

@@ -3,11 +3,38 @@
#include "decomp.h"
#include "mxatom.h"
#include "mxnotificationparam.h"
#include "mxtypes.h"
class LegoPathActor;
class LegoWorld;
// VTABLE: LEGO1 0x100d6230
// SIZE 0x10
class LegoPathStructEvent : public MxNotificationParam {
public:
LegoPathStructEvent(NotificationId p_type, MxCore* p_sender, MxU8 p_trigger, MxS16 p_data) : MxNotificationParam()
{
m_type = p_type;
m_sender = p_sender;
m_data = p_data;
m_trigger = p_trigger;
}
// FUNCTION: LEGO1 0x1001bac0
MxNotificationParam* Clone() const override
{
return new LegoPathStructEvent(m_type, m_sender, m_trigger, m_data);
} // vtable+0x04
inline MxU8 GetTrigger() { return m_trigger; }
inline MxS16 GetData() { return m_data; }
protected:
MxS16 m_data; // 0x0c
MxU8 m_trigger; // 0x0e
};
// VTABLE: LEGO1 0x100d7d9c
// SIZE 0x0c
struct LegoPathStructBase {
@@ -71,6 +98,12 @@ private:
MxAtomId m_atomId; // 0x10
};
// SYNTHETIC: LEGO1 0x1001bb80
// LegoPathStructEvent::`scalar deleting destructor'
// SYNTHETIC: LEGO1 0x1001bbf0
// LegoPathStructEvent::~LegoPathStructEvent
// SYNTHETIC: LEGO1 0x10047440
// LegoPathStructBase::`scalar deleting destructor'

View File

@@ -13,7 +13,7 @@ class LegoEventNotificationParam;
class LegoPathActor;
class MxEndActionNotificationParam;
class MxNotificationParam;
class MxType19NotificationParam;
class LegoPathStructEvent;
// VTABLE: LEGO1 0x100d5e30
// SIZE 0x2c
@@ -23,12 +23,12 @@ public:
struct Entry {
public:
inline MxS16 GetUnknown0x02() { return m_unk0x02; }
inline MxU16 GetScore() { return m_score; }
inline MxS16 GetHighScore() { return m_score; }
// TODO: Possibly private
MxU8 m_id; // 0x00
MxS16 m_unk0x02; // 0x02
MxU16 m_score; // 0x04
MxS16 m_score; // 0x04
};
RaceState();
@@ -98,11 +98,11 @@ public:
// FUNCTION: LEGO1 0x1000dae0
MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c
MxBool Escape() override; // vtable+0x64
void Enable(MxBool p_enable) override; // vtable+0x68
virtual MxLong HandleClick(LegoEventNotificationParam&) = 0; // vtable+0x6c
virtual MxLong HandleType19Notification(MxType19NotificationParam&); // vtable+0x70
virtual MxLong HandleEndAction(MxEndActionNotificationParam&); // vtable+0x74
MxBool Escape() override; // vtable+0x64
void Enable(MxBool p_enable) override; // vtable+0x68
virtual MxLong HandleClick(LegoEventNotificationParam&) = 0; // vtable+0x6c
virtual MxLong HandlePathStruct(LegoPathStructEvent&); // vtable+0x70
virtual MxLong HandleEndAction(MxEndActionNotificationParam&); // vtable+0x74
// FUNCTION: LEGO1 0x1000dab0
virtual MxLong HandleType0Notification(MxNotificationParam&) { return 0; } // vtable+0x78

View File

@@ -9,6 +9,13 @@
// SIZE 0x08
class LegoState : public MxCore {
public:
enum ScoreColor {
e_grey = 0,
e_yellow,
e_blue,
e_red
};
// FUNCTION: LEGO1 0x10005f40
~LegoState() override {}

View File

@@ -23,12 +23,12 @@ public:
return !strcmp(p_name, Motocycle::ClassName()) || IslePathActor::IsA(p_name);
}
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void VTable0x70(float p_float) override; // vtable+0x70
MxLong HandleClick() override; // vtable+0xcc
MxLong HandleControl(LegoControlManagerEvent& p_param) override; // vtable+0xd4
MxLong HandleNotification19(MxType19NotificationParam&) override; // vtable+0xdc
void Exit() override; // vtable+0xe4
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void VTable0x70(float p_float) override; // vtable+0x70
MxLong HandleClick() override; // vtable+0xcc
MxLong HandleControl(LegoControlManagerEvent& p_param) override; // vtable+0xd4
MxLong HandlePathStruct(LegoPathStructEvent&) override; // vtable+0xdc
void Exit() override; // vtable+0xe4
void FUN_10035e10();

View File

@@ -18,7 +18,7 @@ public:
undefined2 m_unk0x00; // 0x00
MxU8 m_id; // 0x02
undefined m_unk0x03[0x15]; // 0x03
MxU16 m_score; // 0x18
MxS16 m_score; // 0x18
undefined m_unk0x18[6]; // 0x1a
};
@@ -39,7 +39,7 @@ public:
MxResult Serialize(LegoFile* p_legoFile) override; // vtable+0x1c
inline MxU16 GetScore(MxU8 p_id) { return GetState(p_id)->m_score; }
inline MxS16 GetHighScore(MxU8 p_id) { return GetState(p_id)->m_score; }
// SYNTHETIC: LEGO1 0x10039350
// PizzaMissionState::`scalar deleting destructor'

View File

@@ -26,7 +26,7 @@ public:
MxResult Serialize(LegoFile* p_legoFile) override; // vtable+0x1c
inline MxU16 GetScore(MxU8 p_id)
inline MxS16 GetHighScore(MxU8 p_id)
{
switch (p_id) {
case 1:
@@ -50,16 +50,16 @@ public:
undefined4 m_unk0x08; // 0x08
undefined4 m_unk0x0c; // 0x0c
MxU8 m_unk0x10; // 0x10
MxU16 m_unk0x12; // 0x12
MxU16 m_unk0x14; // 0x14
MxU16 m_unk0x16; // 0x16
MxU16 m_unk0x18; // 0x18
MxU16 m_unk0x1a; // 0x1a
MxU16 m_score1; // 0x1c
MxU16 m_score2; // 0x1e
MxU16 m_score3; // 0x20
MxU16 m_score4; // 0x22
MxU16 m_score5; // 0x24
MxS16 m_unk0x12; // 0x12
MxS16 m_unk0x14; // 0x14
MxS16 m_unk0x16; // 0x16
MxS16 m_unk0x18; // 0x18
MxS16 m_unk0x1a; // 0x1a
MxS16 m_score1; // 0x1c
MxS16 m_score2; // 0x1e
MxS16 m_score3; // 0x20
MxS16 m_score4; // 0x22
MxS16 m_score5; // 0x24
};
// VTABLE: LEGO1 0x100d7ee0
@@ -82,14 +82,14 @@ public:
return !strcmp(p_name, TowTrack::ClassName()) || IslePathActor::IsA(p_name);
}
MxLong Notify(MxParam& p_param) override; // vtable+0x04
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void VTable0x70(float p_float) override; // vtable+0x70
MxLong HandleClick() override; // vtable+0xcc
MxLong HandleControl(LegoControlManagerEvent& p_param) override; // vtable+0xd4
MxLong HandleEndAnim(LegoEndAnimNotificationParam& p_param) override; // vtable+0xd8
MxLong HandleNotification19(MxType19NotificationParam& p_param) override; // vtable+0xdc
void Exit() override; // vtable+0xe4
MxLong Notify(MxParam& p_param) override; // vtable+0x04
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void VTable0x70(float p_float) override; // vtable+0x70
MxLong HandleClick() override; // vtable+0xcc
MxLong HandleControl(LegoControlManagerEvent& p_param) override; // vtable+0xd4
MxLong HandleEndAnim(LegoEndAnimNotificationParam& p_param) override; // vtable+0xd8
MxLong HandlePathStruct(LegoPathStructEvent& p_param) override; // vtable+0xdc
void Exit() override; // vtable+0xe4
void CreateState();
void FUN_1004dab0();