mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-24 00:44:21 +00:00
Move CreateStreamObject to proper location (#1249)
This commit is contained in:
committed by
GitHub
parent
c9acd9a49f
commit
5a61cf6566
@@ -3,6 +3,7 @@
|
||||
#include "mxdsaction.h"
|
||||
#include "mxdsanim.h"
|
||||
#include "mxdsevent.h"
|
||||
#include "mxdsfile.h"
|
||||
#include "mxdsmediaaction.h"
|
||||
#include "mxdsmultiaction.h"
|
||||
#include "mxdsobjectaction.h"
|
||||
@@ -227,3 +228,39 @@ MxDSObject* DeserializeDSObjectDispatch(MxU8*& p_source, MxS16 p_flags)
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100c0280
|
||||
MxDSObject* CreateStreamObject(MxDSFile* p_file, MxS16 p_ofs)
|
||||
{
|
||||
MxU8* buf;
|
||||
_MMCKINFO tmpChunk;
|
||||
|
||||
if (p_file->Seek(((MxLong*) p_file->GetBuffer())[p_ofs], SEEK_SET)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
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 MxU8[tmpChunk.cksize];
|
||||
if (!buf) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
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.
|
||||
MxU8* copy = buf;
|
||||
MxDSObject* obj = DeserializeDSObjectDispatch(buf, -1);
|
||||
delete[] copy;
|
||||
return obj;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user