2023-04-27 22:19:39 -04:00
|
|
|
#ifndef MXDSFILE_H
|
|
|
|
#define MXDSFILE_H
|
|
|
|
|
2023-06-27 14:44:02 -04:00
|
|
|
#include "mxdssource.h"
|
2023-06-29 04:10:08 -04:00
|
|
|
#include "mxioinfo.h"
|
|
|
|
#include "mxstring.h"
|
2023-06-27 22:04:07 -04:00
|
|
|
|
2023-06-29 04:10:08 -04:00
|
|
|
// VTABLE 0x100dc890
|
2023-06-27 14:44:02 -04:00
|
|
|
class MxDSFile : public MxDSSource
|
2023-04-27 22:19:39 -04:00
|
|
|
{
|
|
|
|
public:
|
2023-07-02 04:05:49 -04:00
|
|
|
__declspec(dllexport) MxDSFile(const char *filename, MxULong skipReadingChunks);
|
2023-06-29 04:10:08 -04:00
|
|
|
__declspec(dllexport) virtual ~MxDSFile(); // vtable+0x0
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x100c0120
|
|
|
|
inline virtual const char *ClassName() const override // vtable+0x0c
|
|
|
|
{
|
|
|
|
// 0x10102594
|
|
|
|
return "MxDSFile";
|
|
|
|
}
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x100c0130
|
|
|
|
inline virtual MxBool IsA(const char *name) const override // vtable+0x10
|
|
|
|
{
|
|
|
|
return !strcmp(name, MxDSFile::ClassName()) || MxDSSource::IsA(name);
|
|
|
|
}
|
2023-06-27 14:44:02 -04:00
|
|
|
|
2023-07-02 04:05:49 -04:00
|
|
|
__declspec(dllexport) virtual MxLong Open(MxULong); // vtable+0x14
|
|
|
|
__declspec(dllexport) virtual MxLong Close(); // vtable+0x18
|
|
|
|
__declspec(dllexport) virtual MxLong Read(unsigned char *,MxULong); // vtable+0x20
|
|
|
|
__declspec(dllexport) virtual MxLong Seek(MxLong,int); // vtable+0x24
|
|
|
|
__declspec(dllexport) virtual MxULong GetBufferSize(); // vtable+0x28
|
|
|
|
__declspec(dllexport) virtual MxULong GetStreamBuffersNum(); // vtable+0x2c
|
2023-06-19 01:36:07 -04:00
|
|
|
private:
|
2023-07-02 04:05:49 -04:00
|
|
|
MxLong ReadChunks();
|
2023-06-27 14:44:02 -04:00
|
|
|
struct ChunkHeader {
|
|
|
|
ChunkHeader()
|
|
|
|
: majorVersion(0)
|
|
|
|
, minorVersion(0)
|
|
|
|
, bufferSize(0)
|
|
|
|
, streamBuffersNum(0)
|
|
|
|
{}
|
|
|
|
|
|
|
|
unsigned short majorVersion;
|
|
|
|
unsigned short minorVersion;
|
2023-07-02 04:05:49 -04:00
|
|
|
MxULong bufferSize;
|
2023-06-27 14:44:02 -04:00
|
|
|
short streamBuffersNum;
|
|
|
|
short reserved;
|
|
|
|
};
|
|
|
|
|
|
|
|
MxString m_filename;
|
|
|
|
MXIOINFO m_io;
|
|
|
|
ChunkHeader m_header;
|
|
|
|
|
|
|
|
// If false, read chunks immediately on open, otherwise
|
|
|
|
// skip reading chunks until ReadChunks is explicitly called.
|
2023-07-02 04:05:49 -04:00
|
|
|
MxULong m_skipReadingChunks;
|
2023-04-27 22:19:39 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MXDSFILE_H
|