mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-22 16:04:17 +00:00
Move CreateStreamObject
to proper location (#1249)
This commit is contained in:

committed by
GitHub

parent
c9acd9a49f
commit
5a61cf6566
@@ -251,7 +251,6 @@ function(add_lego_libraries NAME)
|
|||||||
LEGO1/omni/src/stream/mxdsbuffer.cpp
|
LEGO1/omni/src/stream/mxdsbuffer.cpp
|
||||||
LEGO1/omni/src/stream/mxdschunk.cpp
|
LEGO1/omni/src/stream/mxdschunk.cpp
|
||||||
LEGO1/omni/src/stream/mxdsfile.cpp
|
LEGO1/omni/src/stream/mxdsfile.cpp
|
||||||
LEGO1/omni/src/stream/mxdssource.cpp
|
|
||||||
LEGO1/omni/src/stream/mxdssubscriber.cpp
|
LEGO1/omni/src/stream/mxdssubscriber.cpp
|
||||||
LEGO1/omni/src/stream/mxio.cpp
|
LEGO1/omni/src/stream/mxio.cpp
|
||||||
LEGO1/omni/src/stream/mxramstreamcontroller.cpp
|
LEGO1/omni/src/stream/mxramstreamcontroller.cpp
|
||||||
|
@@ -5,6 +5,7 @@
|
|||||||
#include "mxatom.h"
|
#include "mxatom.h"
|
||||||
#include "mxcore.h"
|
#include "mxcore.h"
|
||||||
|
|
||||||
|
class MxDSFile;
|
||||||
class MxPresenter;
|
class MxPresenter;
|
||||||
|
|
||||||
// VTABLE: LEGO1 0x100dc868
|
// VTABLE: LEGO1 0x100dc868
|
||||||
@@ -104,5 +105,6 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
MxDSObject* DeserializeDSObjectDispatch(MxU8*&, MxS16);
|
MxDSObject* DeserializeDSObjectDispatch(MxU8*&, MxS16);
|
||||||
|
MxDSObject* CreateStreamObject(MxDSFile*, MxS16);
|
||||||
|
|
||||||
#endif // MXDSOBJECT_H
|
#endif // MXDSOBJECT_H
|
||||||
|
@@ -2,8 +2,7 @@
|
|||||||
#define MXDSSOURCE_H
|
#define MXDSSOURCE_H
|
||||||
|
|
||||||
#include "mxcore.h"
|
#include "mxcore.h"
|
||||||
|
#include "mxdsbuffer.h"
|
||||||
class MxDSBuffer;
|
|
||||||
|
|
||||||
// VTABLE: LEGO1 0x100dc8c8
|
// VTABLE: LEGO1 0x100dc8c8
|
||||||
// SIZE 0x14
|
// SIZE 0x14
|
||||||
@@ -27,15 +26,26 @@ public:
|
|||||||
return !strcmp(p_name, MxDSSource::ClassName()) || MxCore::IsA(p_name);
|
return !strcmp(p_name, MxDSSource::ClassName()) || MxCore::IsA(p_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual MxLong Open(MxULong) = 0; // vtable+0x14
|
virtual MxLong Open(MxULong) = 0; // vtable+0x14
|
||||||
virtual MxLong Close() = 0; // vtable+0x18
|
virtual MxLong Close() = 0; // vtable+0x18
|
||||||
virtual MxResult ReadToBuffer(MxDSBuffer* p_buffer); // vtable+0x1c
|
|
||||||
virtual MxResult Read(unsigned char*, MxULong) = 0; // vtable+0x20
|
// FUNCTION: LEGO1 0x100bffd0
|
||||||
virtual MxLong Seek(MxLong, MxS32) = 0; // vtable+0x24
|
virtual MxResult ReadToBuffer(MxDSBuffer* p_buffer)
|
||||||
virtual MxULong GetBufferSize() = 0; // vtable+0x28
|
{
|
||||||
virtual MxULong GetStreamBuffersNum() = 0; // vtable+0x2c
|
return Read(p_buffer->GetBuffer(), p_buffer->GetWriteOffset());
|
||||||
virtual MxLong GetLengthInDWords(); // vtable+0x30
|
} // vtable+0x1c
|
||||||
virtual MxU32* GetBuffer(); // vtable+0x34
|
|
||||||
|
virtual MxResult Read(unsigned char*, MxULong) = 0; // vtable+0x20
|
||||||
|
virtual MxLong Seek(MxLong, MxS32) = 0; // vtable+0x24
|
||||||
|
virtual MxULong GetBufferSize() = 0; // vtable+0x28
|
||||||
|
virtual MxULong GetStreamBuffersNum() = 0; // vtable+0x2c
|
||||||
|
|
||||||
|
// FUNCTION: LEGO1 0x100bfff0
|
||||||
|
virtual MxLong GetLengthInDWords() { return m_lengthInDWords; } // vtable+0x30
|
||||||
|
|
||||||
|
// FUNCTION: LEGO1 0x100c0000
|
||||||
|
virtual MxU32* GetBuffer() { return m_pBuffer; } // vtable+0x34
|
||||||
|
|
||||||
MxLong GetPosition() const { return m_position; }
|
MxLong GetPosition() const { return m_position; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@@ -76,7 +76,6 @@ void OmniError(const char* p_message, MxS32 p_status);
|
|||||||
void SetOmniUserMessage(void (*p_omniUserMessage)(const char*, MxS32));
|
void SetOmniUserMessage(void (*p_omniUserMessage)(const char*, MxS32));
|
||||||
MxBool ContainsPresenter(MxCompositePresenterList& p_presenterList, MxPresenter* p_presenter);
|
MxBool ContainsPresenter(MxCompositePresenterList& p_presenterList, MxPresenter* p_presenter);
|
||||||
void FUN_100b7220(MxDSAction* p_action, MxU32 p_newFlags, MxBool p_setFlags);
|
void FUN_100b7220(MxDSAction* p_action, MxU32 p_newFlags, MxBool p_setFlags);
|
||||||
MxDSObject* CreateStreamObject(MxDSFile*, MxS16);
|
|
||||||
MxBool KeyValueStringParse(char*, const char*, const char*);
|
MxBool KeyValueStringParse(char*, const char*, const char*);
|
||||||
|
|
||||||
#endif // MXUTILITIES_H
|
#endif // MXUTILITIES_H
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
#include "mxdsaction.h"
|
#include "mxdsaction.h"
|
||||||
#include "mxdsanim.h"
|
#include "mxdsanim.h"
|
||||||
#include "mxdsevent.h"
|
#include "mxdsevent.h"
|
||||||
|
#include "mxdsfile.h"
|
||||||
#include "mxdsmediaaction.h"
|
#include "mxdsmediaaction.h"
|
||||||
#include "mxdsmultiaction.h"
|
#include "mxdsmultiaction.h"
|
||||||
#include "mxdsobjectaction.h"
|
#include "mxdsobjectaction.h"
|
||||||
@@ -227,3 +228,39 @@ MxDSObject* DeserializeDSObjectDispatch(MxU8*& p_source, MxS16 p_flags)
|
|||||||
|
|
||||||
return obj;
|
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;
|
||||||
|
}
|
||||||
|
@@ -158,39 +158,3 @@ void FUN_100b7220(MxDSAction* p_action, MxU32 p_newFlags, MxBool p_setFlags)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Should probably be somewhere else
|
|
||||||
// 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;
|
|
||||||
}
|
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
#define SI_MAJOR_VERSION 2
|
#define SI_MAJOR_VERSION 2
|
||||||
#define SI_MINOR_VERSION 2
|
#define SI_MINOR_VERSION 2
|
||||||
|
|
||||||
|
DECOMP_SIZE_ASSERT(MxDSSource, 0x14)
|
||||||
DECOMP_SIZE_ASSERT(MxDSFile::ChunkHeader, 0x0c)
|
DECOMP_SIZE_ASSERT(MxDSFile::ChunkHeader, 0x0c)
|
||||||
DECOMP_SIZE_ASSERT(MxDSFile, 0x7c)
|
DECOMP_SIZE_ASSERT(MxDSFile, 0x7c)
|
||||||
|
|
||||||
|
@@ -1,23 +0,0 @@
|
|||||||
#include "mxdssource.h"
|
|
||||||
|
|
||||||
#include "mxdsbuffer.h"
|
|
||||||
|
|
||||||
DECOMP_SIZE_ASSERT(MxDSSource, 0x14)
|
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100bffd0
|
|
||||||
MxResult MxDSSource::ReadToBuffer(MxDSBuffer* p_buffer)
|
|
||||||
{
|
|
||||||
return Read(p_buffer->GetBuffer(), p_buffer->GetWriteOffset());
|
|
||||||
}
|
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100bfff0
|
|
||||||
MxLong MxDSSource::GetLengthInDWords()
|
|
||||||
{
|
|
||||||
return m_lengthInDWords;
|
|
||||||
}
|
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100c0000
|
|
||||||
MxU32* MxDSSource::GetBuffer()
|
|
||||||
{
|
|
||||||
return m_pBuffer;
|
|
||||||
}
|
|
Reference in New Issue
Block a user