mirror of
https://github.com/isledecomp/isle.git
synced 2025-12-10 08:03:13 +00:00
100% Match of MxDSFile (#51)
* 100% Match of MxDSFile * ...almost, MxDSFile::Open is still not quite matching but all of the other methods are 100% matching. * Turns out that most of the virtual methods and some of the members are actually on the MxDSSource base class, which I've pulled out as part of this. * In order to implement the methods I added the MXIOINFO class, which seems to be a thin wrapper around the MMIOINFO windows structure. We can tell this because MMIOINFO::~MMIOINFO was included in the DLL exports, and calls down to a function which deconstructs something looking exactly like MMIOINFO. * Add mxdssource.cpp * mattkc feedback * some accuracy improvements * Use FOURCC macro * Tirival solve in mxioinfo.cpp * Update mxdsfile.cpp 0xFFFFFFFF -> -1 --------- Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
@@ -1,20 +1,46 @@
|
||||
#ifndef MXDSFILE_H
|
||||
#define MXDSFILE_H
|
||||
|
||||
class MxDSFile
|
||||
#include "mxcore.h"
|
||||
#include "mxstring.h"
|
||||
#include "mxioinfo.h"
|
||||
#include "mxdssource.h"
|
||||
class MxDSFile : public MxDSSource
|
||||
{
|
||||
public:
|
||||
__declspec(dllexport) MxDSFile(const char *,unsigned long);
|
||||
__declspec(dllexport) MxDSFile(const char *filename, unsigned long skipReadingChunks);
|
||||
__declspec(dllexport) virtual ~MxDSFile();
|
||||
__declspec(dllexport) virtual long Close();
|
||||
__declspec(dllexport) virtual unsigned long GetBufferSize();
|
||||
__declspec(dllexport) virtual unsigned long GetStreamBuffersNum();
|
||||
__declspec(dllexport) virtual long Open(unsigned long);
|
||||
__declspec(dllexport) virtual long Close();
|
||||
__declspec(dllexport) virtual long Read(unsigned char *,unsigned long);
|
||||
__declspec(dllexport) virtual long Seek(long,int);
|
||||
__declspec(dllexport) virtual unsigned long GetBufferSize();
|
||||
__declspec(dllexport) virtual unsigned long GetStreamBuffersNum();
|
||||
|
||||
private:
|
||||
char m_unknown[0x70];
|
||||
unsigned long m_buffersize;
|
||||
long ReadChunks();
|
||||
struct ChunkHeader {
|
||||
ChunkHeader()
|
||||
: majorVersion(0)
|
||||
, minorVersion(0)
|
||||
, bufferSize(0)
|
||||
, streamBuffersNum(0)
|
||||
{}
|
||||
|
||||
unsigned short majorVersion;
|
||||
unsigned short minorVersion;
|
||||
unsigned long bufferSize;
|
||||
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.
|
||||
unsigned long m_skipReadingChunks;
|
||||
};
|
||||
|
||||
#endif // MXDSFILE_H
|
||||
|
||||
Reference in New Issue
Block a user