isle-portable/LEGO1/omni/include/mxdsfile.h

66 lines
1.9 KiB
C
Raw Normal View History

2023-04-27 22:19:39 -04:00
#ifndef MXDSFILE_H
#define MXDSFILE_H
#include "mxdssource.h"
#include "mxioinfo.h"
#include "mxstring.h"
#include "mxtypes.h"
#include <windows.h>
(Proposal) Adjustments to "decomp" language (#308) * Adjustments to "decomp" language * Fix a comment * Fix accidental clang-formatting * Fix order * Fix order * Remove junk * Fix OFFSET * Adjustments based on new suggestions * Annotate globals * Globals in ISLE * More globals * Merge from parser2 branch * Allow prepending space for exact marker match * To eliminate noise, require the 0x prefix on offset for marker match * fix test from previous * Count tab stops for indented functions to reduce MISSED_END_OF_FUNCTION noise * FUNCTION to SYNTHETIC where needed * Missed marker conversion on SetAtomId * pylint cleanup, remove unused code * Fix unexpected function end, add more unit tests * Be more strict about synthetic name syntax * Revert "Missed marker conversion on SetAtomId" This reverts commit d87d665127fae7dd6e5bd48d9af14a0a829bf9e2. * Revert "FUNCTION to SYNTHETIC where needed" This reverts commit 8c815418d261ba8c5f67a9a2cae349fe4ac92db8. * Implicit lookup by name for functions * Fix VTABLE SYNTHETIC and other decomp markers * Get vtable class name * Vtable marker should identify struct * No colon for SIZE comment * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update CONTRIBUTING.md * Fix destructor/annotation * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md --------- Co-authored-by: disinvite <disinvite@users.noreply.github.com>
2023-12-06 07:10:45 -05:00
// VTABLE: LEGO1 0x100dc890
2023-10-24 19:38:27 -04:00
class MxDSFile : public MxDSSource {
2023-04-27 22:19:39 -04:00
public:
__declspec(dllexport) MxDSFile(const char* p_filename, MxULong p_skipReadingChunks);
2023-10-24 19:38:27 -04:00
__declspec(dllexport) virtual ~MxDSFile(); // vtable+0x0
(Proposal) Adjustments to "decomp" language (#308) * Adjustments to "decomp" language * Fix a comment * Fix accidental clang-formatting * Fix order * Fix order * Remove junk * Fix OFFSET * Adjustments based on new suggestions * Annotate globals * Globals in ISLE * More globals * Merge from parser2 branch * Allow prepending space for exact marker match * To eliminate noise, require the 0x prefix on offset for marker match * fix test from previous * Count tab stops for indented functions to reduce MISSED_END_OF_FUNCTION noise * FUNCTION to SYNTHETIC where needed * Missed marker conversion on SetAtomId * pylint cleanup, remove unused code * Fix unexpected function end, add more unit tests * Be more strict about synthetic name syntax * Revert "Missed marker conversion on SetAtomId" This reverts commit d87d665127fae7dd6e5bd48d9af14a0a829bf9e2. * Revert "FUNCTION to SYNTHETIC where needed" This reverts commit 8c815418d261ba8c5f67a9a2cae349fe4ac92db8. * Implicit lookup by name for functions * Fix VTABLE SYNTHETIC and other decomp markers * Get vtable class name * Vtable marker should identify struct * No colon for SIZE comment * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update CONTRIBUTING.md * Fix destructor/annotation * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md --------- Co-authored-by: disinvite <disinvite@users.noreply.github.com>
2023-12-06 07:10:45 -05:00
// FUNCTION: LEGO1 0x100c0120
2023-10-24 19:38:27 -04:00
inline virtual const char* ClassName() const override // vtable+0x0c
{
// STRING: LEGO1 0x10102594
2023-10-24 19:38:27 -04:00
return "MxDSFile";
}
(Proposal) Adjustments to "decomp" language (#308) * Adjustments to "decomp" language * Fix a comment * Fix accidental clang-formatting * Fix order * Fix order * Remove junk * Fix OFFSET * Adjustments based on new suggestions * Annotate globals * Globals in ISLE * More globals * Merge from parser2 branch * Allow prepending space for exact marker match * To eliminate noise, require the 0x prefix on offset for marker match * fix test from previous * Count tab stops for indented functions to reduce MISSED_END_OF_FUNCTION noise * FUNCTION to SYNTHETIC where needed * Missed marker conversion on SetAtomId * pylint cleanup, remove unused code * Fix unexpected function end, add more unit tests * Be more strict about synthetic name syntax * Revert "Missed marker conversion on SetAtomId" This reverts commit d87d665127fae7dd6e5bd48d9af14a0a829bf9e2. * Revert "FUNCTION to SYNTHETIC where needed" This reverts commit 8c815418d261ba8c5f67a9a2cae349fe4ac92db8. * Implicit lookup by name for functions * Fix VTABLE SYNTHETIC and other decomp markers * Get vtable class name * Vtable marker should identify struct * No colon for SIZE comment * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update CONTRIBUTING.md * Fix destructor/annotation * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md --------- Co-authored-by: disinvite <disinvite@users.noreply.github.com>
2023-12-06 07:10:45 -05:00
// FUNCTION: LEGO1 0x100c0130
inline virtual MxBool IsA(const char* p_name) const override // vtable+0x10
2023-10-24 19:38:27 -04:00
{
return !strcmp(p_name, MxDSFile::ClassName()) || MxDSSource::IsA(p_name);
2023-10-24 19:38:27 -04:00
}
__declspec(dllexport) virtual MxLong Open(MxULong); // vtable+0x14
__declspec(dllexport) virtual MxLong Close(); // vtable+0x18
__declspec(dllexport) virtual MxResult 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
inline void SetFileName(const char* p_filename) { m_filename = p_filename; }
inline MxS32 CalcFileSize() { return GetFileSize(m_io.m_info.hmmio, NULL); }
// SYNTHETIC: LEGO1 0x100c01e0
// MxDSFile::`scalar deleting destructor'
private:
2023-10-24 19:38:27 -04:00
MxLong ReadChunks();
struct ChunkHeader {
ChunkHeader() : m_majorVersion(0), m_minorVersion(0), m_bufferSize(0), m_streamBuffersNum(0) {}
2023-10-24 19:38:27 -04:00
MxU16 m_majorVersion;
MxU16 m_minorVersion;
MxULong m_bufferSize;
MxS16 m_streamBuffersNum;
MxS16 m_reserved;
2023-10-24 19:38:27 -04:00
};
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.
MxULong m_skipReadingChunks;
2023-04-27 22:19:39 -04:00
};
#endif // MXDSFILE_H