mirror of
https://github.com/isledecomp/isle.git
synced 2024-11-23 08:08:03 -05:00
e7b5ea53df
Was intended as a simple code improvement, however it also seems to make WinMain, MxString::operator=, MxDSFile::Open 100% (all of which just needed registers to be switched around)
47 lines
1.2 KiB
C++
47 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
|