feat: Implement several ::Serialize functions (#1017)

* feat: Implement many ::Serialize functions

* address review comments, part 1 [skip ci]

* address review comments, part 2 [skip ci]

* review comments (final part)

* refactor: Remove Read/Write duplication

* fix merge conflict

* Match PizzeriaState::Serialize again

* Remove unused variable, add LegoVehicleBuildState::Serialize

* Implement AnimState::Serialize

* fix: Conform with naming scheme

* refactor: change names back

* refactor: int to MxS32

---------

Co-authored-by: jonschz <jonschz@users.noreply.github.com>
This commit is contained in:
jonschz
2024-06-14 23:24:34 +02:00
committed by GitHub
parent 165785c434
commit a6644801f1
23 changed files with 335 additions and 168 deletions

View File

@@ -15,11 +15,35 @@ public:
// SIZE 0x20
struct Entry {
public:
undefined2 m_unk0x00; // 0x00
MxU8 m_id; // 0x02
undefined m_unk0x03[0x15]; // 0x03
MxS16 m_score; // 0x18
undefined m_unk0x18[6]; // 0x1a
inline MxResult WriteToFile(LegoFile* p_file)
{
Write(p_file, m_unk0x06);
Write(p_file, m_unk0x14);
Write(p_file, m_unk0x16);
Write(p_file, m_score);
return SUCCESS;
}
inline MxResult ReadFromFile(LegoFile* p_file)
{
Read(p_file, &m_unk0x06);
Read(p_file, &m_unk0x14);
Read(p_file, &m_unk0x16);
Read(p_file, &m_score);
return SUCCESS;
}
undefined2 m_unk0x00; // 0x00
MxU8 m_id; // 0x02
undefined m_unk0x03[3]; // 0x03
MxS16 m_unk0x06; // 0x06
undefined m_unk0x08[8]; // 0x08
MxS16 m_unk0x10; // 0x10
MxS16 m_unk0x12; // 0x12
MxS16 m_unk0x14; // 0x14
MxS16 m_unk0x16; // 0x16
MxS16 m_score; // 0x18
undefined m_unk0x1a[6]; // 0x1a
};
PizzaMissionState();
@@ -37,7 +61,7 @@ public:
return !strcmp(p_name, PizzaMissionState::ClassName()) || LegoState::IsA(p_name);
}
MxResult Serialize(LegoFile* p_legoFile) override; // vtable+0x1c
MxResult Serialize(LegoFile* p_file) override; // vtable+0x1c
inline MxS16 GetHighScore(MxU8 p_id) { return GetState(p_id)->m_score; }