mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 08:24:16 +00:00
Match Serialize
functions to BETA10 (#1334)
* Begin refactor Serialize functions
* Match more Serialize functions
* Match `LegoVehicleBuildState::Serialize`
* Match `LegoGameState::Username::Serialize`
* Match `LegoGameState::ScoreItem::Serialize`
* Match `LegoGameState::History::Serialize`
* Var name
* Var name
* Revert "Var name"
This reverts commit 1c0cccfba7
.
* Add other Serialize implementations
* Add remaining Serialize implementations
* Add Read for char*
* Improvements
This commit is contained in:

committed by
GitHub

parent
f95eedd0ce
commit
77a3dc0795
@@ -24,6 +24,7 @@ public:
|
||||
void SetDirection(const Mx3DPointFloat& p_direction) { m_direction = p_direction; }
|
||||
void SetUp(const Mx3DPointFloat& p_up) { m_up = p_up; }
|
||||
|
||||
// TODO: Unclear whether this was defined
|
||||
MxBool IsPresent() { return strcmp(m_name.GetData(), "") != 0; }
|
||||
void Reset() { m_name = ""; }
|
||||
|
||||
@@ -31,22 +32,22 @@ public:
|
||||
MxResult Serialize(LegoFile* p_file)
|
||||
{
|
||||
if (p_file->IsWriteMode()) {
|
||||
p_file->WriteString(m_name);
|
||||
p_file->WriteVector3(m_position);
|
||||
p_file->WriteVector3(m_direction);
|
||||
p_file->WriteVector3(m_up);
|
||||
p_file->Write(MxString(m_name));
|
||||
p_file->Write(m_position);
|
||||
p_file->Write(m_direction);
|
||||
p_file->Write(m_up);
|
||||
}
|
||||
else if (p_file->IsReadMode()) {
|
||||
p_file->ReadString(m_name);
|
||||
p_file->ReadVector3(m_position);
|
||||
p_file->ReadVector3(m_direction);
|
||||
p_file->ReadVector3(m_up);
|
||||
p_file->Read(m_name);
|
||||
p_file->Read(m_position);
|
||||
p_file->Read(m_direction);
|
||||
p_file->Read(m_up);
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
private:
|
||||
// private:
|
||||
MxString m_name; // 0x00
|
||||
Mx3DPointFloat m_position; // 0x10
|
||||
Mx3DPointFloat m_direction; // 0x24
|
||||
|
Reference in New Issue
Block a user