mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 00:14:22 +00:00
Refactor deserialization of objects (#170)
* Use template helpers for deserialization * Remove space * Fix naming
This commit is contained in:

committed by
GitHub

parent
62b97b8f1f
commit
a9fa734844
@@ -15,6 +15,7 @@
|
||||
#include "mxdsselectaction.h"
|
||||
#include "mxdsstill.h"
|
||||
#include "mxdsobjectaction.h"
|
||||
#include "legoutil.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(MxDSObject, 0x2c);
|
||||
|
||||
@@ -128,20 +129,14 @@ MxU32 MxDSObject::GetSizeOnDisk()
|
||||
// OFFSET: LEGO1 0x100bfa20
|
||||
void MxDSObject::Deserialize(char **p_source, MxS16 p_unk24)
|
||||
{
|
||||
this->SetSourceName(*p_source);
|
||||
*p_source += strlen(this->m_sourceName) + 1;
|
||||
this->m_unk14 = *(undefined4*) *p_source;
|
||||
*p_source += sizeof(undefined4);
|
||||
|
||||
this->SetObjectName(*p_source);
|
||||
*p_source += strlen(this->m_objectName) + 1;
|
||||
this->m_objectId = *(MxU32*) *p_source;
|
||||
*p_source += sizeof(MxU32);
|
||||
GetString(p_source, this->m_sourceName, this, &MxDSObject::SetSourceName);
|
||||
GetScalar(p_source, this->m_unk14);
|
||||
GetString(p_source, this->m_objectName, this, &MxDSObject::SetObjectName);
|
||||
GetScalar(p_source, this->m_objectId);
|
||||
|
||||
this->m_unk24 = p_unk24;
|
||||
}
|
||||
|
||||
|
||||
// OFFSET: LEGO1 0x100bfb30
|
||||
MxDSObject *DeserializeDSObjectDispatch(char **p_source, MxS16 p_flags)
|
||||
{
|
||||
|
Reference in New Issue
Block a user