Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement LegoCarBuildAnimPresenter::Serialize #1366

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions LEGO1/lego/legoomni/src/build/legocarbuildpresenter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,29 @@ void LegoCarBuildAnimPresenter::EndAction()
}
}

// STUB: LEGO1 0x10078e30
// STUB: BETA10 0x10071387
// FUNCTION: LEGO1 0x10078e30
// FUNCTION: BETA10 0x10071387
MxResult LegoCarBuildAnimPresenter::Serialize(LegoStorage* p_storage)
{
// TODO
if (p_storage->IsReadMode()) {
p_storage->ReadS16(m_placedPartCount);
p_storage->ReadFloat(m_unk0x130);
for (MxS16 i = 0; i < m_numberOfParts; i++) {
p_storage->ReadString(m_parts[i].m_name);
p_storage->ReadString(m_parts[i].m_wiredName);
p_storage->ReadS16(m_parts[i].m_objectId);
}
}
else if (p_storage->IsWriteMode()) {
p_storage->WriteS16(m_placedPartCount);
p_storage->WriteFloat(m_unk0x130);
for (MxS16 i = 0; i < m_numberOfParts; i++) {
p_storage->WriteString(m_parts[i].m_name);
p_storage->WriteString(m_parts[i].m_wiredName);
p_storage->WriteS16(m_parts[i].m_objectId);
}
}

return SUCCESS;
}

Expand Down
3 changes: 3 additions & 0 deletions LEGO1/lego/sources/misc/legostorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class LegoStorage {
return this;
}

// FUNCTION: BETA10 0x10073610
LegoStorage* WriteFloat(LegoFloat p_data)
{
Write(&p_data, sizeof(p_data));
Expand All @@ -102,6 +103,7 @@ class LegoStorage {
return this;
}

// FUNCTION: BETA10 0x10073690
LegoStorage* ReadString(char* p_data)
{
LegoS16 length;
Expand Down Expand Up @@ -148,6 +150,7 @@ class LegoStorage {
return this;
}

// FUNCTION: BETA10 0x10073650
LegoStorage* ReadFloat(LegoFloat& p_data)
{
Read(&p_data, sizeof(p_data));
Expand Down
Loading