2023-06-29 04:10:08 -04:00
|
|
|
#ifndef MXDSCHUNK_H
|
|
|
|
#define MXDSCHUNK_H
|
|
|
|
|
2023-11-13 06:25:27 -05:00
|
|
|
#include "decomp.h"
|
2023-06-29 04:10:08 -04:00
|
|
|
#include "mxcore.h"
|
2023-07-16 02:51:11 -04:00
|
|
|
#include "mxtypes.h"
|
2023-06-29 04:10:08 -04:00
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// VTABLE: LEGO1 0x100dc7f8
|
2023-11-13 06:25:27 -05:00
|
|
|
// SIZE 0x1c
|
2023-10-24 19:38:27 -04:00
|
|
|
class MxDSChunk : public MxCore {
|
2023-06-29 04:10:08 -04:00
|
|
|
public:
|
2023-11-13 06:25:27 -05:00
|
|
|
enum {
|
2024-01-17 11:53:53 -05:00
|
|
|
c_bit1 = 0x01,
|
|
|
|
c_end = 0x02,
|
|
|
|
c_bit3 = 0x04,
|
|
|
|
c_split = 0x10,
|
|
|
|
c_bit16 = 0x8000
|
2023-11-13 06:25:27 -05:00
|
|
|
};
|
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
MxDSChunk();
|
2024-02-01 15:42:10 -05:00
|
|
|
~MxDSChunk() override;
|
2023-06-29 04:10:08 -04:00
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100be0c0
|
2024-02-01 15:42:10 -05:00
|
|
|
inline const char* ClassName() const override // vtable+0x0c
|
2023-10-24 19:38:27 -04:00
|
|
|
{
|
2023-12-27 15:59:42 -05:00
|
|
|
// STRING: LEGO1 0x10101e6c
|
2023-10-24 19:38:27 -04:00
|
|
|
return "MxDSChunk";
|
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100be0d0
|
2024-02-01 15:42:10 -05:00
|
|
|
inline MxBool IsA(const char* p_name) const override // vtable+0x10
|
2023-10-24 19:38:27 -04:00
|
|
|
{
|
2023-12-13 05:48:14 -05:00
|
|
|
return !strcmp(p_name, MxDSChunk::ClassName()) || MxCore::IsA(p_name);
|
2023-10-24 19:38:27 -04:00
|
|
|
}
|
2023-06-29 04:10:08 -04:00
|
|
|
|
2024-01-10 06:55:25 -05:00
|
|
|
static MxU32 GetHeaderSize();
|
|
|
|
inline static MxU32* IntoType(MxU8* p_buffer) { return (MxU32*) p_buffer; }
|
|
|
|
inline static MxU32* IntoLength(MxU8* p_buffer) { return (MxU32*) (p_buffer + 4); }
|
|
|
|
inline static MxU32 Size(MxU32 p_dataSize) { return (p_dataSize & 1) + p_dataSize + 8; }
|
|
|
|
inline static MxU8* End(MxU8* p_buffer) { return p_buffer + Size(*IntoLength(p_buffer)); }
|
2023-12-26 16:27:54 -05:00
|
|
|
|
2023-12-13 05:48:14 -05:00
|
|
|
inline void SetFlags(MxU16 p_flags) { m_flags = p_flags; }
|
2023-12-17 12:24:39 -05:00
|
|
|
inline void SetObjectId(undefined4 p_objectid) { m_objectId = p_objectid; }
|
2023-11-13 06:25:27 -05:00
|
|
|
inline void SetTime(MxLong p_time) { m_time = p_time; }
|
|
|
|
inline void SetLength(MxU32 p_length) { m_length = p_length; }
|
|
|
|
inline void SetData(MxU8* p_data) { m_data = p_data; }
|
|
|
|
|
|
|
|
inline MxU16 GetFlags() { return m_flags; }
|
2023-12-17 10:57:29 -05:00
|
|
|
inline undefined4 GetObjectId() { return m_objectId; }
|
2023-11-13 06:25:27 -05:00
|
|
|
inline MxLong GetTime() { return m_time; }
|
|
|
|
inline MxU32 GetLength() { return m_length; }
|
|
|
|
inline MxU8* GetData() { return m_data; }
|
|
|
|
|
|
|
|
inline void Release()
|
|
|
|
{
|
2024-02-01 15:42:10 -05:00
|
|
|
if (m_data) {
|
2023-11-13 06:25:27 -05:00
|
|
|
delete[] m_data;
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
2023-11-13 06:25:27 -05:00
|
|
|
}
|
|
|
|
|
2024-01-18 08:34:14 -05:00
|
|
|
// SYNTHETIC: LEGO1 0x100be150
|
|
|
|
// MxDSChunk::`scalar deleting destructor'
|
|
|
|
|
2023-12-17 12:24:39 -05:00
|
|
|
protected:
|
2024-01-29 16:17:17 -05:00
|
|
|
MxU16 m_flags; // 0x08
|
|
|
|
MxU32 m_objectId; // 0x0c
|
2023-12-26 20:33:53 -05:00
|
|
|
MxLong m_time; // 0x10
|
|
|
|
MxU32 m_length; // 0x14
|
|
|
|
MxU8* m_data; // 0x18
|
2023-06-29 04:10:08 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MXDSCHUNK_H
|