LegoOmni::CreateStreamObject and related (#129)

* LegoOmni::CreateStreamObject and related

* Revert change to MxDSSource/MxDSFile Read export
This commit is contained in:
MS
2023-09-20 16:22:57 -04:00
committed by GitHub
parent 1d3c1bdbd1
commit b743f99d20
14 changed files with 147 additions and 13 deletions

View File

@@ -47,13 +47,13 @@ MxLong MxDSFile::Open(MxULong uStyle)
}
// OFFSET: LEGO1 0x100cc780
MxLong MxDSFile::Read(unsigned char *pch, MxULong cch)
MxResult MxDSFile::Read(unsigned char *p_buf, MxULong p_nbytes)
{
if (m_io.Read((char*)pch, cch) != cch)
return -1;
if (m_io.Read(p_buf, p_nbytes) != p_nbytes)
return FAILURE;
m_position += cch;
return 0;
m_position += p_nbytes;
return SUCCESS;
}
// OFFSET: LEGO1 0x100cc620
@@ -72,7 +72,7 @@ MxLong MxDSFile::ReadChunks()
return -1;
}
m_io.Read((char*)&m_header, 0xc);
m_io.Read(&m_header, 0xc);
if ((m_header.majorVersion == SI_MAJOR_VERSION) && (m_header.minorVersion == SI_MINOR_VERSION))
{
childChunk.ckid = FOURCC('M', 'x', 'O', 'f');
@@ -80,9 +80,9 @@ MxLong MxDSFile::ReadChunks()
return -1;
}
MxULong* pLengthInDWords = &m_lengthInDWords;
m_io.Read((char *)pLengthInDWords, 4);
m_io.Read(pLengthInDWords, 4);
m_pBuffer = malloc(*pLengthInDWords * 4);
m_io.Read((char*)m_pBuffer, *pLengthInDWords * 4);
m_io.Read(m_pBuffer, *pLengthInDWords * 4);
return 0;
}
else