mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-24 17:04:17 +00:00
Use reference on MxDSObject Deserialize calls (#767)
This commit is contained in:
@@ -322,7 +322,7 @@ MxCore* MxDSBuffer::ReadChunk(MxDSBuffer* p_buffer, MxU32* p_chunkData, MxU16 p_
|
||||
|
||||
switch (*p_chunkData) {
|
||||
case FOURCC('M', 'x', 'O', 'b'):
|
||||
result = DeserializeDSObjectDispatch(&dataStart, p_flags);
|
||||
result = DeserializeDSObjectDispatch(dataStart, p_flags);
|
||||
break;
|
||||
case FOURCC('M', 'x', 'C', 'h'):
|
||||
result = new MxStreamChunk();
|
||||
|
||||
@@ -113,7 +113,7 @@ MxU32 ReadData(MxU8* p_buffer, MxU32 p_size)
|
||||
data2 = data;
|
||||
data += 8;
|
||||
|
||||
MxDSObject* obj = DeserializeDSObjectDispatch(&data, -1);
|
||||
MxDSObject* obj = DeserializeDSObjectDispatch(data, -1);
|
||||
id = obj->GetObjectId();
|
||||
delete obj;
|
||||
|
||||
|
||||
@@ -36,12 +36,19 @@ MxU32 MxStreamChunk::ReadChunkHeader(MxU8* p_chunkData)
|
||||
MxU32 headersize = 0;
|
||||
if (p_chunkData) {
|
||||
MxU8* chunkData = p_chunkData;
|
||||
// Note: the alpha debug version uses memcpy calls here,
|
||||
// but the code generation is the same.
|
||||
GetScalar(&p_chunkData, m_flags);
|
||||
GetScalar(&p_chunkData, m_objectId);
|
||||
GetScalar(&p_chunkData, m_time);
|
||||
GetScalar(&p_chunkData, m_length);
|
||||
|
||||
memcpy(&m_flags, p_chunkData, sizeof(m_flags));
|
||||
p_chunkData += sizeof(m_flags);
|
||||
|
||||
memcpy(&m_objectId, p_chunkData, sizeof(m_objectId));
|
||||
p_chunkData += sizeof(m_objectId);
|
||||
|
||||
memcpy(&m_time, p_chunkData, sizeof(m_time));
|
||||
p_chunkData += sizeof(m_time);
|
||||
|
||||
memcpy(&m_length, p_chunkData, sizeof(m_length));
|
||||
p_chunkData += sizeof(m_length);
|
||||
|
||||
m_data = p_chunkData;
|
||||
headersize = p_chunkData - chunkData;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user