mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 08:24:16 +00:00
Consolidate state and building entity classes (#989)
This commit is contained in:

committed by
GitHub

parent
73bb37596e
commit
133a312aee
@@ -1,8 +1,7 @@
|
||||
#include "hospital.h"
|
||||
|
||||
#include "act1state.h"
|
||||
#include "hospital_actions.h"
|
||||
#include "hospitalstate.h"
|
||||
#include "isle.h"
|
||||
#include "islepathactor.h"
|
||||
#include "jukebox.h"
|
||||
#include "jukebox_actions.h"
|
||||
@@ -22,6 +21,7 @@
|
||||
#include "scripts.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(Hospital, 0x12c)
|
||||
DECOMP_SIZE_ASSERT(HospitalState, 0x18)
|
||||
|
||||
// GLOBAL: LEGO1 0x100f7918
|
||||
undefined4 g_unk0x100f7918 = 3;
|
||||
@@ -671,3 +671,49 @@ MxBool Hospital::Escape()
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10076370
|
||||
HospitalState::HospitalState()
|
||||
{
|
||||
m_unk0x0c = 0;
|
||||
m_unk0x0e = 0;
|
||||
m_unk0x10 = 0;
|
||||
m_unk0x12 = 0;
|
||||
m_unk0x14 = 0;
|
||||
m_unk0x16 = 0;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10076530
|
||||
MxResult HospitalState::Serialize(LegoFile* p_legoFile)
|
||||
{
|
||||
LegoState::Serialize(p_legoFile);
|
||||
|
||||
if (p_legoFile->IsWriteMode()) {
|
||||
// A write variable needs to be used here, otherwise
|
||||
// the compiler aggresively optimizes the function
|
||||
MxS16 write;
|
||||
|
||||
write = m_unk0x0c;
|
||||
p_legoFile->Write(&write, sizeof(m_unk0x0c));
|
||||
write = m_unk0x0e;
|
||||
p_legoFile->Write(&write, sizeof(m_unk0x0e));
|
||||
write = m_unk0x10;
|
||||
p_legoFile->Write(&write, sizeof(m_unk0x10));
|
||||
write = m_unk0x12;
|
||||
p_legoFile->Write(&write, sizeof(m_unk0x12));
|
||||
write = m_unk0x14;
|
||||
p_legoFile->Write(&write, sizeof(m_unk0x14));
|
||||
write = m_unk0x16;
|
||||
p_legoFile->Write(&write, sizeof(m_unk0x16));
|
||||
}
|
||||
else if (p_legoFile->IsReadMode()) {
|
||||
p_legoFile->Read(&m_unk0x0c, sizeof(m_unk0x0c));
|
||||
p_legoFile->Read(&m_unk0x0e, sizeof(m_unk0x0e));
|
||||
p_legoFile->Read(&m_unk0x10, sizeof(m_unk0x10));
|
||||
p_legoFile->Read(&m_unk0x12, sizeof(m_unk0x12));
|
||||
p_legoFile->Read(&m_unk0x14, sizeof(m_unk0x14));
|
||||
p_legoFile->Read(&m_unk0x16, sizeof(m_unk0x16));
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
Reference in New Issue
Block a user