diff --git a/LEGO1/mxdsfile.cpp b/LEGO1/mxdsfile.cpp index 77d1ed04..cf37e187 100644 --- a/LEGO1/mxdsfile.cpp +++ b/LEGO1/mxdsfile.cpp @@ -1,10 +1,14 @@ #include "mxdsfile.h" -#include "stdio.h" +#include #define SI_MAJOR_VERSION 2 #define SI_MINOR_VERSION 2 +#define FCC_OMNI 0x494e4d4f +#define FCC_MxHd 0x6448784d +#define FCC_MxOf 0x664f784d + // OFFSET: LEGO1 0x100cc4b0 MxDSFile::MxDSFile(const char *filename, unsigned long skipReadingChunks) { @@ -24,7 +28,7 @@ long MxDSFile::Open(unsigned long uStyle) // No idea what's stopping this one matching, but I'm pretty // confident it has the correct behavior. memset(&m_io, 0, sizeof(MXIOINFO)); - if (m_io.Open(m_filename.Data(), uStyle) != 0) { + if (m_io.Open(m_filename.GetData(), uStyle) != 0) { return -1; } @@ -62,11 +66,11 @@ long MxDSFile::ReadChunks() _MMCKINFO childChunk; char tempBuffer[80]; - topChunk.fccType = 0x494e4d4f; + topChunk.fccType = FCC_OMNI; if (m_io.Descend(&topChunk, NULL, MMIO_FINDRIFF) != 0) { return -1; } - childChunk.ckid = 0x6448784d; + childChunk.ckid = FCC_MxHd; if (m_io.Descend(&childChunk, &topChunk, 0) != 0) { return -1; } @@ -74,7 +78,7 @@ long MxDSFile::ReadChunks() m_io.Read((char*)&m_header, 0xc); if ((m_header.majorVersion == SI_MAJOR_VERSION) && (m_header.minorVersion == SI_MINOR_VERSION)) { - childChunk.ckid = 0x664f784d; + childChunk.ckid = FCC_MxOf; if (m_io.Descend(&childChunk, &topChunk, 0) != 0) { return -1; } @@ -87,7 +91,7 @@ long MxDSFile::ReadChunks() else { sprintf(tempBuffer, "Wrong SI file version. %d.%d expected.", SI_MAJOR_VERSION, SI_MINOR_VERSION); - MessageBoxA(NULL, tempBuffer, NULL, 0x10); + MessageBoxA(NULL, tempBuffer, NULL, MB_ICONERROR); return -1; } } diff --git a/LEGO1/mxdsfile.h b/LEGO1/mxdsfile.h index 86702519..e1e170d4 100644 --- a/LEGO1/mxdsfile.h +++ b/LEGO1/mxdsfile.h @@ -9,13 +9,13 @@ class MxDSFile : public MxDSSource { public: __declspec(dllexport) MxDSFile(const char *filename, unsigned long skipReadingChunks); - __declspec(dllexport) ~MxDSFile(); - __declspec(dllexport) long Open(unsigned long); - __declspec(dllexport) long Close(); - __declspec(dllexport) long Read(unsigned char *,unsigned long); - __declspec(dllexport) long Seek(long,int); - __declspec(dllexport) unsigned long GetBufferSize(); - __declspec(dllexport) unsigned long GetStreamBuffersNum(); + __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(); diff --git a/LEGO1/mxioinfo.h b/LEGO1/mxioinfo.h index ce8c4eb5..27aa482d 100644 --- a/LEGO1/mxioinfo.h +++ b/LEGO1/mxioinfo.h @@ -1,7 +1,7 @@ #ifndef MXIOINFO_H #define MXIOINFO_H -#include "windows.h" +#include "legoinc.h" #include "mmsystem.h" class MXIOINFO { diff --git a/LEGO1/mxstring.h b/LEGO1/mxstring.h index 12194447..a9a25ba1 100644 --- a/LEGO1/mxstring.h +++ b/LEGO1/mxstring.h @@ -16,7 +16,7 @@ class MxString : public MxCore void ToLowerCase(); const MxString &operator=(MxString *); - inline const char *Data() const { return m_data; } + inline const char *GetData() const { return m_data; } private: char *m_data;