mirror of
https://github.com/isledecomp/isle.git
synced 2025-12-10 08:03:13 +00:00
Move Read/Write functions to LegoStorage base class, match Act1State::Serialize (#1335)
* Move Read/Write function to LegoStorage base class * Proper const use for vector / BETA match * Match `Act1State::Serialize`
This commit is contained in:
committed by
GitHub
parent
77a3dc0795
commit
70b0f76fa1
@@ -39,17 +39,17 @@ public:
|
||||
MxS16 GetHighScore() { return m_score; }
|
||||
|
||||
// FUNCTION: BETA10 0x100c96f0
|
||||
MxResult Serialize(LegoFile* p_file)
|
||||
MxResult Serialize(LegoStorage* p_storage)
|
||||
{
|
||||
if (p_file->IsReadMode()) {
|
||||
p_file->Read(m_id);
|
||||
p_file->Read(m_unk0x02);
|
||||
p_file->Read(m_score);
|
||||
if (p_storage->IsReadMode()) {
|
||||
p_storage->ReadU8(m_id);
|
||||
p_storage->ReadS16(m_unk0x02);
|
||||
p_storage->ReadS16(m_score);
|
||||
}
|
||||
else if (p_file->IsWriteMode()) {
|
||||
p_file->Write(m_id);
|
||||
p_file->Write(m_unk0x02);
|
||||
p_file->Write(m_score);
|
||||
else if (p_storage->IsWriteMode()) {
|
||||
p_storage->WriteU8(m_id);
|
||||
p_storage->WriteS16(m_unk0x02);
|
||||
p_storage->WriteS16(m_score);
|
||||
}
|
||||
else {
|
||||
return FAILURE;
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
return !strcmp(p_name, RaceState::ClassName()) || LegoState::IsA(p_name);
|
||||
}
|
||||
|
||||
MxResult Serialize(LegoFile* p_file) override; // vtable+0x1c
|
||||
MxResult Serialize(LegoStorage* p_storage) override; // vtable+0x1c
|
||||
|
||||
Entry* GetState(MxU8 p_id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user