mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-21 07:11:16 +00:00
Add other Serialize implementations
This commit is contained in:
parent
3e50893ea4
commit
78ee2de392
@ -42,14 +42,17 @@ class RaceState : public LegoState {
|
|||||||
MxResult Serialize(LegoFile* p_file)
|
MxResult Serialize(LegoFile* p_file)
|
||||||
{
|
{
|
||||||
if (p_file->IsReadMode()) {
|
if (p_file->IsReadMode()) {
|
||||||
Read(p_file, &m_id);
|
p_file->Read(m_id);
|
||||||
Read(p_file, &m_unk0x02);
|
p_file->Read(m_unk0x02);
|
||||||
Read(p_file, &m_score);
|
p_file->Read(m_score);
|
||||||
}
|
}
|
||||||
else if (p_file->IsWriteMode()) {
|
else if (p_file->IsWriteMode()) {
|
||||||
Write(p_file, m_id);
|
p_file->Write(m_id);
|
||||||
Write(p_file, m_unk0x02);
|
p_file->Write(m_unk0x02);
|
||||||
Write(p_file, m_score);
|
p_file->Write(m_score);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
|
|||||||
@ -605,18 +605,25 @@ PizzaMissionState::PizzaMissionState()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100393c0
|
// FUNCTION: LEGO1 0x100393c0
|
||||||
|
// FUNCTION: BETA10 0x100eebf2
|
||||||
MxResult PizzaMissionState::Serialize(LegoFile* p_file)
|
MxResult PizzaMissionState::Serialize(LegoFile* p_file)
|
||||||
{
|
{
|
||||||
LegoState::Serialize(p_file);
|
LegoState::Serialize(p_file);
|
||||||
|
|
||||||
if (p_file->IsReadMode()) {
|
if (p_file->IsReadMode()) {
|
||||||
for (MxS16 i = 0; i < 5; i++) {
|
for (MxS16 i = 0; i < 5; i++) {
|
||||||
m_missions[i].ReadFromFile(p_file);
|
p_file->Read(m_missions[i].m_unk0x06);
|
||||||
|
p_file->Read(m_missions[i].m_unk0x14);
|
||||||
|
p_file->Read(m_missions[i].m_score);
|
||||||
|
p_file->Read(m_missions[i].m_hiScore);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (p_file->IsWriteMode()) {
|
else if (p_file->IsWriteMode()) {
|
||||||
for (MxS16 i = 0; i < 5; i++) {
|
for (MxS16 i = 0; i < 5; i++) {
|
||||||
m_missions[i].WriteToFile(p_file);
|
p_file->Write(m_missions[i].m_unk0x06);
|
||||||
|
p_file->Write(m_missions[i].m_unk0x14);
|
||||||
|
p_file->Write(m_missions[i].m_score);
|
||||||
|
p_file->Write(m_missions[i].m_hiScore);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -633,6 +640,7 @@ PizzaMissionState::Mission* PizzaMissionState::GetMission(MxU8 p_actorId)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert("No pizza mission for this character!" == NULL);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -609,33 +609,34 @@ TowTrackMissionState::TowTrackMissionState()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1004dde0
|
// FUNCTION: LEGO1 0x1004dde0
|
||||||
|
// FUNCTION: BETA10 0x100f8720
|
||||||
MxResult TowTrackMissionState::Serialize(LegoFile* p_file)
|
MxResult TowTrackMissionState::Serialize(LegoFile* p_file)
|
||||||
{
|
{
|
||||||
LegoState::Serialize(p_file);
|
LegoState::Serialize(p_file);
|
||||||
|
|
||||||
if (p_file->IsReadMode()) {
|
if (p_file->IsReadMode()) {
|
||||||
Read(p_file, &m_peScore);
|
p_file->Read(m_peScore);
|
||||||
Read(p_file, &m_maScore);
|
p_file->Read(m_maScore);
|
||||||
Read(p_file, &m_paScore);
|
p_file->Read(m_paScore);
|
||||||
Read(p_file, &m_niScore);
|
p_file->Read(m_niScore);
|
||||||
Read(p_file, &m_laScore);
|
p_file->Read(m_laScore);
|
||||||
Read(p_file, &m_peHighScore);
|
p_file->Read(m_peHighScore);
|
||||||
Read(p_file, &m_maHighScore);
|
p_file->Read(m_maHighScore);
|
||||||
Read(p_file, &m_paHighScore);
|
p_file->Read(m_paHighScore);
|
||||||
Read(p_file, &m_niHighScore);
|
p_file->Read(m_niHighScore);
|
||||||
Read(p_file, &m_laHighScore);
|
p_file->Read(m_laHighScore);
|
||||||
}
|
}
|
||||||
else if (p_file->IsWriteMode()) {
|
else if (p_file->IsWriteMode()) {
|
||||||
Write(p_file, m_peScore);
|
p_file->Write(m_peScore);
|
||||||
Write(p_file, m_maScore);
|
p_file->Write(m_maScore);
|
||||||
Write(p_file, m_paScore);
|
p_file->Write(m_paScore);
|
||||||
Write(p_file, m_niScore);
|
p_file->Write(m_niScore);
|
||||||
Write(p_file, m_laScore);
|
p_file->Write(m_laScore);
|
||||||
Write(p_file, m_peHighScore);
|
p_file->Write(m_peHighScore);
|
||||||
Write(p_file, m_maHighScore);
|
p_file->Write(m_maHighScore);
|
||||||
Write(p_file, m_paHighScore);
|
p_file->Write(m_paHighScore);
|
||||||
Write(p_file, m_niHighScore);
|
p_file->Write(m_niHighScore);
|
||||||
Write(p_file, m_laHighScore);
|
p_file->Write(m_laHighScore);
|
||||||
}
|
}
|
||||||
|
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
|
|||||||
@ -208,15 +208,16 @@ PoliceState::PoliceState()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1005e990
|
// FUNCTION: LEGO1 0x1005e990
|
||||||
|
// FUNCTION: BETA10 0x100f08b0
|
||||||
MxResult PoliceState::Serialize(LegoFile* p_file)
|
MxResult PoliceState::Serialize(LegoFile* p_file)
|
||||||
{
|
{
|
||||||
LegoState::Serialize(p_file);
|
LegoState::Serialize(p_file);
|
||||||
|
|
||||||
if (p_file->IsReadMode()) {
|
if (p_file->IsReadMode()) {
|
||||||
Read(p_file, &m_policeScript);
|
p_file->Read((MxS32&) m_policeScript);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Write(p_file, m_policeScript);
|
p_file->Write((MxS32) m_policeScript);
|
||||||
}
|
}
|
||||||
|
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
|
|||||||
@ -136,6 +136,14 @@ class LegoFile : public LegoStorage {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Type might be different (LegoS32). MxS32 is incompatible with LegoS32.
|
||||||
|
// FUNCTION: BETA10 0x10088540
|
||||||
|
LegoStorage* Write(MxS32 p_data)
|
||||||
|
{
|
||||||
|
Write(&p_data, sizeof(p_data));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Type might be different (LegoU32). MxU32 is incompatible with LegoU32.
|
// TODO: Type might be different (LegoU32). MxU32 is incompatible with LegoU32.
|
||||||
// FUNCTION: BETA10 0x1004b150
|
// FUNCTION: BETA10 0x1004b150
|
||||||
LegoStorage* Write(MxU32 p_data)
|
LegoStorage* Write(MxU32 p_data)
|
||||||
@ -195,6 +203,14 @@ class LegoFile : public LegoStorage {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Type might be different (LegoS32). MxS32 is incompatible with LegoS32.
|
||||||
|
// FUNCTION: BETA10 0x10088580
|
||||||
|
LegoStorage* Read(MxS32& p_data)
|
||||||
|
{
|
||||||
|
Read(&p_data, sizeof(p_data));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Type might be different (LegoU32). MxU32 is incompatible with LegoU32.
|
// TODO: Type might be different (LegoU32). MxU32 is incompatible with LegoU32.
|
||||||
// FUNCTION: BETA10 0x1004b210
|
// FUNCTION: BETA10 0x1004b210
|
||||||
LegoStorage* Read(MxU32& p_data)
|
LegoStorage* Read(MxU32& p_data)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user