implement/match Hospital::Create() (#665)

This commit is contained in:
Ramen2X
2024-03-13 11:45:27 -04:00
committed by GitHub
parent 06080b6492
commit 4aafc435f5
3 changed files with 74 additions and 35 deletions

View File

@@ -1,5 +1,10 @@
#include "hospital.h"
#include "legocontrolmanager.h"
#include "legogamestate.h"
#include "legoinputmanager.h"
#include "legoutils.h"
#include "misc.h"
#include "mxmisc.h"
#include "mxnotificationmanager.h"
@@ -8,18 +13,18 @@ DECOMP_SIZE_ASSERT(Hospital, 0x12c)
// FUNCTION: LEGO1 0x100745e0
Hospital::Hospital()
{
this->m_unk0xf8 = 0;
this->m_unk0x100 = 0;
this->m_unk0x104 = 0;
this->m_unk0x108 = 0;
this->m_unk0xfc = 0;
this->m_unk0x10c = 0;
this->m_unk0x110 = 0;
this->m_unk0x114 = 0;
this->m_unk0x118 = 0;
this->m_unk0x11c = 0;
this->m_unk0x120 = 0;
this->m_unk0x128 = 0;
m_unk0xf8 = 0;
m_unk0x100 = 0;
m_hospitalState = NULL;
m_unk0x108 = 0;
m_unk0xfc = 0;
m_unk0x10c = 0;
m_unk0x110 = 0;
m_unk0x114 = 0;
m_unk0x118 = 0;
m_unk0x11c = 0;
m_unk0x120 = 0;
m_unk0x128 = 0;
NotificationManager()->Register(this);
}
@@ -35,11 +40,36 @@ Hospital::~Hospital()
// TODO
}
// STUB: LEGO1 0x100748c0
// FUNCTION: LEGO1 0x100748c0
MxResult Hospital::Create(MxDSAction& p_dsAction)
{
// TODO
return SUCCESS;
MxResult result = LegoWorld::Create(p_dsAction);
if (result == SUCCESS) {
InputManager()->SetWorld(this);
ControlManager()->Register(this);
}
SetIsWorldActive(FALSE);
m_hospitalState = (HospitalState*) GameState()->GetState("HospitalState");
if (!m_hospitalState) {
m_hospitalState = (HospitalState*) GameState()->CreateState("HospitalState");
m_hospitalState->m_unk0x08.m_unk0x00 = 1;
}
else if (m_hospitalState->m_unk0x08.m_unk0x00 == 4) {
m_hospitalState->m_unk0x08.m_unk0x00 = 4;
}
else {
m_hospitalState->m_unk0x08.m_unk0x00 = 3;
}
GameState()->SetCurrentArea(LegoGameState::e_hospital);
GameState()->StopArea(LegoGameState::e_previousArea);
InputManager()->Register(this);
FUN_1003ef00(FALSE);
return result;
}
// STUB: LEGO1 0x10074990