mirror of
https://github.com/isledecomp/isle-portable.git
synced 2024-11-29 19:05:34 -05:00
51ec2c97c6
* 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>
46 lines
1.2 KiB
C++
46 lines
1.2 KiB
C++
#ifndef MXDSFILE_H
|
|
#define MXDSFILE_H
|
|
|
|
#include "mxcore.h"
|
|
#include "mxstring.h"
|
|
#include "mxioinfo.h"
|
|
#include "mxdssource.h"
|
|
class MxDSFile : public MxDSSource
|
|
{
|
|
public:
|
|
__declspec(dllexport) MxDSFile(const char *filename, unsigned long skipReadingChunks);
|
|
__declspec(dllexport) virtual ~MxDSFile();
|
|
__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:
|
|
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
|