mirror of
https://github.com/isledecomp/isle-portable.git
synced 2024-11-23 07:58:21 -05:00
Match MxRAMStreamProvider::SetResourceToGet
This commit is contained in:
parent
c890831c41
commit
562d6a966e
1 changed files with 3 additions and 3 deletions
|
@ -77,14 +77,14 @@ MxResult MxRAMStreamProvider::SetResourceToGet(MxStreamController* p_resource)
|
||||||
m_fileSize = m_pFile->CalcFileSize();
|
m_fileSize = m_pFile->CalcFileSize();
|
||||||
if (m_fileSize != 0) {
|
if (m_fileSize != 0) {
|
||||||
m_bufferSize = m_pFile->GetBufferSize();
|
m_bufferSize = m_pFile->GetBufferSize();
|
||||||
m_pBufferOfFileSize = new MxU32[m_fileSize];
|
m_pBufferOfFileSize = (MxU32*) new MxU8[m_fileSize];
|
||||||
if (m_pBufferOfFileSize != NULL &&
|
if (m_pBufferOfFileSize != NULL &&
|
||||||
m_pFile->Read((unsigned char*) m_pBufferOfFileSize, m_fileSize) == SUCCESS) {
|
m_pFile->Read((unsigned char*) m_pBufferOfFileSize, m_fileSize) == SUCCESS) {
|
||||||
m_lengthInDWords = m_pFile->GetLengthInDWords();
|
m_lengthInDWords = m_pFile->GetLengthInDWords();
|
||||||
m_bufferForDWords = new MxU32[m_lengthInDWords * sizeof(MxU32)];
|
m_bufferForDWords = new MxU32[m_lengthInDWords];
|
||||||
|
|
||||||
if (m_bufferForDWords != NULL) {
|
if (m_bufferForDWords != NULL) {
|
||||||
memcpy(m_bufferForDWords, m_pFile->GetBuffer(), m_lengthInDWords);
|
memcpy(m_bufferForDWords, m_pFile->GetBuffer(), m_lengthInDWords * sizeof(MxU32));
|
||||||
result = SUCCESS;
|
result = SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue