mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 08:24:16 +00:00
implement MxDSBuffer object creation (#340)
* push changes * Update mxstreamcontroller.cpp * fix build * MxStreamChunk * fix format * Match functions * Add a comment --------- Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
@@ -731,7 +731,7 @@ void SetOmniUserMessage(void (*p_userMsg)(const char*, int))
|
||||
// FUNCTION: LEGO1 0x100c0280
|
||||
MxDSObject* CreateStreamObject(MxDSFile* p_file, MxS16 p_ofs)
|
||||
{
|
||||
char* buf;
|
||||
MxU8* buf;
|
||||
_MMCKINFO tmpChunk;
|
||||
|
||||
if (p_file->Seek(((MxLong*) p_file->GetBuffer())[p_ofs], 0)) {
|
||||
@@ -741,18 +741,18 @@ MxDSObject* CreateStreamObject(MxDSFile* p_file, MxS16 p_ofs)
|
||||
if (p_file->Read((MxU8*) &tmpChunk.ckid, 8) == 0 && tmpChunk.ckid == FOURCC('M', 'x', 'S', 't')) {
|
||||
if (p_file->Read((MxU8*) &tmpChunk.ckid, 8) == 0 && tmpChunk.ckid == FOURCC('M', 'x', 'O', 'b')) {
|
||||
|
||||
buf = new char[tmpChunk.cksize];
|
||||
buf = new MxU8[tmpChunk.cksize];
|
||||
if (!buf) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (p_file->Read((MxU8*) buf, tmpChunk.cksize) != 0) {
|
||||
if (p_file->Read(buf, tmpChunk.cksize) != 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Save a copy so we can clean up properly, because
|
||||
// this function will alter the pointer value.
|
||||
char* copy = buf;
|
||||
MxU8* copy = buf;
|
||||
MxDSObject* obj = DeserializeDSObjectDispatch(&buf, -1);
|
||||
delete[] copy;
|
||||
return obj;
|
||||
|
Reference in New Issue
Block a user