mirror of
https://github.com/isledecomp/isle-portable.git
synced 2024-11-26 17:36:12 -05:00
Ambulance::Create, dtor (#719)
* Ambulance::Create, dtor * annotations * fix * remove comment --------- Co-authored-by: Ramen2X <rmn@legoisland.org> Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
parent
313bd9ffd0
commit
3f6f59852f
6 changed files with 62 additions and 20 deletions
|
@ -1,6 +1,7 @@
|
||||||
#ifndef AMBULANCE_H
|
#ifndef AMBULANCE_H
|
||||||
#define AMBULANCE_H
|
#define AMBULANCE_H
|
||||||
|
|
||||||
|
#include "ambulancemissionstate.h"
|
||||||
#include "islepathactor.h"
|
#include "islepathactor.h"
|
||||||
|
|
||||||
// VTABLE: LEGO1 0x100d71a8
|
// VTABLE: LEGO1 0x100d71a8
|
||||||
|
@ -8,6 +9,7 @@
|
||||||
class Ambulance : public IslePathActor {
|
class Ambulance : public IslePathActor {
|
||||||
public:
|
public:
|
||||||
Ambulance();
|
Ambulance();
|
||||||
|
~Ambulance() override;
|
||||||
|
|
||||||
MxLong Notify(MxParam& p_param) override; // vtable+0x04
|
MxLong Notify(MxParam& p_param) override; // vtable+0x04
|
||||||
MxResult Tickle() override; // vtable+0x08
|
MxResult Tickle() override; // vtable+0x08
|
||||||
|
@ -40,19 +42,18 @@ class Ambulance : public IslePathActor {
|
||||||
// Ambulance::`scalar deleting destructor'
|
// Ambulance::`scalar deleting destructor'
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// TODO: Ambulance fields
|
undefined m_unk0x160[4]; // 0x160
|
||||||
undefined m_unk0x160[4];
|
AmbulanceMissionState* m_state; // 0x164
|
||||||
MxS32 m_unk0x164;
|
MxS16 m_unk0x168; // 0x168
|
||||||
MxS16 m_unk0x168;
|
MxS16 m_unk0x16a; // 0x16a
|
||||||
MxS16 m_unk0x16a;
|
MxS16 m_unk0x16c; // 0x16c
|
||||||
MxS16 m_unk0x16c;
|
MxS16 m_unk0x16e; // 0x16e
|
||||||
MxS16 m_unk0x16e;
|
MxS16 m_unk0x170; // 0x170
|
||||||
MxS16 m_unk0x170;
|
MxS16 m_unk0x172; // 0x172
|
||||||
MxS16 m_unk0x172;
|
MxS32 m_unk0x174; // 0x174
|
||||||
MxS32 m_unk0x174;
|
MxS32 m_unk0x178; // 0x178
|
||||||
MxS32 m_unk0x178;
|
MxFloat m_unk0x17c; // 0x17c
|
||||||
MxFloat m_unk0x17c;
|
MxFloat m_time; // 0x180
|
||||||
undefined m_unk0x180[4];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // AMBULANCE_H
|
#endif // AMBULANCE_H
|
||||||
|
|
|
@ -24,6 +24,8 @@ class AmbulanceMissionState : public LegoState {
|
||||||
|
|
||||||
MxResult VTable0x1c(LegoFile* p_legoFile) override; // vtable+0x1c
|
MxResult VTable0x1c(LegoFile* p_legoFile) override; // vtable+0x1c
|
||||||
|
|
||||||
|
inline void SetUnknown0x08(undefined4 p_unk0x08) { m_unk0x08 = p_unk0x08; }
|
||||||
|
|
||||||
inline MxU16 GetColor(MxU8 p_id)
|
inline MxU16 GetColor(MxU8 p_id)
|
||||||
{
|
{
|
||||||
switch (p_id) {
|
switch (p_id) {
|
||||||
|
|
|
@ -177,9 +177,9 @@ class LegoGameState {
|
||||||
|
|
||||||
void SetCurrentAct(Act p_currentAct);
|
void SetCurrentAct(Act p_currentAct);
|
||||||
void FindLoadedAct();
|
void FindLoadedAct();
|
||||||
|
void RegisterState(LegoState* p_state);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void RegisterState(LegoState* p_state);
|
|
||||||
MxResult WriteVariable(LegoStorage* p_storage, MxVariableTable* p_from, const char* p_variableName);
|
MxResult WriteVariable(LegoStorage* p_storage, MxVariableTable* p_from, const char* p_variableName);
|
||||||
MxResult WriteEndOfVariables(LegoStorage* p_storage);
|
MxResult WriteEndOfVariables(LegoStorage* p_storage);
|
||||||
MxS32 ReadVariable(LegoStorage* p_storage, MxVariableTable* p_to);
|
MxS32 ReadVariable(LegoStorage* p_storage, MxVariableTable* p_to);
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
#include "mxvariable.h"
|
#include "mxvariable.h"
|
||||||
|
|
||||||
|
extern const char* g_varAMBULFUEL;
|
||||||
extern const char* g_varVISIBILITY;
|
extern const char* g_varVISIBILITY;
|
||||||
extern const char* g_varCAMERALOCATION;
|
extern const char* g_varCAMERALOCATION;
|
||||||
extern const char* g_varCURSOR;
|
extern const char* g_varCURSOR;
|
||||||
|
|
|
@ -1,6 +1,14 @@
|
||||||
#include "ambulance.h"
|
#include "ambulance.h"
|
||||||
|
|
||||||
#include "decomp.h"
|
#include "decomp.h"
|
||||||
|
#include "legocontrolmanager.h"
|
||||||
|
#include "legogamestate.h"
|
||||||
|
#include "legoomni.h"
|
||||||
|
#include "legovariables.h"
|
||||||
|
#include "misc.h"
|
||||||
|
#include "mxmisc.h"
|
||||||
|
#include "mxticklemanager.h"
|
||||||
|
#include "mxtimer.h"
|
||||||
|
|
||||||
DECOMP_SIZE_ASSERT(Ambulance, 0x184)
|
DECOMP_SIZE_ASSERT(Ambulance, 0x184)
|
||||||
|
|
||||||
|
@ -9,7 +17,7 @@ Ambulance::Ambulance()
|
||||||
{
|
{
|
||||||
this->m_unk0x168 = 0;
|
this->m_unk0x168 = 0;
|
||||||
this->m_unk0x16a = -1;
|
this->m_unk0x16a = -1;
|
||||||
this->m_unk0x164 = 0;
|
this->m_state = NULL;
|
||||||
this->m_unk0x16c = 0;
|
this->m_unk0x16c = 0;
|
||||||
this->m_unk0x174 = -1;
|
this->m_unk0x174 = -1;
|
||||||
this->m_unk0x16e = 0;
|
this->m_unk0x16e = 0;
|
||||||
|
@ -20,17 +28,43 @@ Ambulance::Ambulance()
|
||||||
this->m_unk0x17c = 1.0;
|
this->m_unk0x17c = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// STUB: LEGO1 0x10035f90
|
// FUNCTION: LEGO1 0x10035f90
|
||||||
void Ambulance::Destroy(MxBool p_fromDestructor)
|
void Ambulance::Destroy(MxBool p_fromDestructor)
|
||||||
{
|
{
|
||||||
// TODO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// STUB: LEGO1 0x100361d0
|
// FUNCTION: LEGO1 0x10036150
|
||||||
|
Ambulance::~Ambulance()
|
||||||
|
{
|
||||||
|
ControlManager()->Unregister(this);
|
||||||
|
TickleManager()->UnregisterClient(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION: LEGO1 0x100361d0
|
||||||
MxResult Ambulance::Create(MxDSAction& p_dsAction)
|
MxResult Ambulance::Create(MxDSAction& p_dsAction)
|
||||||
{
|
{
|
||||||
// TODO
|
MxResult result = IslePathActor::Create(p_dsAction);
|
||||||
return SUCCESS;
|
|
||||||
|
if (result == SUCCESS) {
|
||||||
|
m_world = CurrentWorld();
|
||||||
|
|
||||||
|
if (m_world) {
|
||||||
|
m_world->Add(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_state = (AmbulanceMissionState*) GameState()->GetState("AmbulanceMissionState");
|
||||||
|
if (!m_state) {
|
||||||
|
m_state = new AmbulanceMissionState();
|
||||||
|
m_state->SetUnknown0x08(0);
|
||||||
|
GameState()->RegisterState(m_state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
VariableTable()->SetVariable(g_varAMBULFUEL, "1.0");
|
||||||
|
m_unk0x17c = 1.0;
|
||||||
|
m_time = Timer()->GetTime();
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// STUB: LEGO1 0x10036300
|
// STUB: LEGO1 0x10036300
|
||||||
|
|
|
@ -15,6 +15,10 @@ DECOMP_SIZE_ASSERT(CursorVariable, 0x24)
|
||||||
DECOMP_SIZE_ASSERT(WhoAmIVariable, 0x24)
|
DECOMP_SIZE_ASSERT(WhoAmIVariable, 0x24)
|
||||||
DECOMP_SIZE_ASSERT(CustomizeAnimFileVariable, 0x24)
|
DECOMP_SIZE_ASSERT(CustomizeAnimFileVariable, 0x24)
|
||||||
|
|
||||||
|
// GLOBAL: LEGO1 0x100f39bc
|
||||||
|
// STRING: LEGO1 0x100f39a0
|
||||||
|
const char* g_varAMBULFUEL = "ambulFUEL";
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x100f3a40
|
// GLOBAL: LEGO1 0x100f3a40
|
||||||
// STRING: LEGO1 0x100f3808
|
// STRING: LEGO1 0x100f3808
|
||||||
const char* g_varVISIBILITY = "VISIBILITY";
|
const char* g_varVISIBILITY = "VISIBILITY";
|
||||||
|
|
Loading…
Reference in a new issue