2023-09-25 22:30:56 -04:00
|
|
|
#ifndef MXDSBUFFER_H
|
|
|
|
#define MXDSBUFFER_H
|
|
|
|
|
|
|
|
#include "decomp.h"
|
|
|
|
#include "mxcore.h"
|
|
|
|
|
2023-12-13 18:11:07 -05:00
|
|
|
class MxStreamController;
|
|
|
|
class MxDSAction;
|
2023-12-17 12:24:39 -05:00
|
|
|
class MxDSStreamingAction;
|
|
|
|
class MxStreamChunk;
|
|
|
|
class MxDSChunk;
|
2023-12-13 18:11:07 -05:00
|
|
|
|
2023-10-30 09:54:00 -04:00
|
|
|
enum MxDSBufferType {
|
|
|
|
MxDSBufferType_Chunk = 0,
|
|
|
|
MxDSBufferType_Allocate = 1,
|
|
|
|
MxDSBufferType_Preallocated = 2,
|
|
|
|
MxDSBufferType_Unknown = 3,
|
|
|
|
};
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// VTABLE: LEGO1 0x100dcca0
|
2023-09-25 22:30:56 -04:00
|
|
|
// SIZE 0x34
|
2023-10-24 19:38:27 -04:00
|
|
|
class MxDSBuffer : public MxCore {
|
2023-09-25 22:30:56 -04:00
|
|
|
public:
|
2023-10-24 19:38:27 -04:00
|
|
|
MxDSBuffer();
|
|
|
|
virtual ~MxDSBuffer() override;
|
2023-09-25 22:30:56 -04:00
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100c6500
|
2023-10-24 19:38:27 -04:00
|
|
|
inline virtual const char* ClassName() const override // vtable+0x0c
|
|
|
|
{
|
2023-12-27 15:59:42 -05:00
|
|
|
// STRING: LEGO1 0x101025b8
|
2023-10-24 19:38:27 -04:00
|
|
|
return "MxDSBuffer";
|
|
|
|
}
|
2023-10-22 15:58:05 -04:00
|
|
|
|
2023-10-30 09:54:00 -04:00
|
|
|
MxResult AllocateBuffer(MxU32 p_bufferSize, MxDSBufferType p_mode);
|
|
|
|
MxResult SetBufferPointer(MxU32* p_buffer, MxU32 p_size);
|
2023-12-22 14:03:55 -05:00
|
|
|
MxResult FUN_100c67b0(
|
|
|
|
MxStreamController* p_controller,
|
|
|
|
MxDSAction* p_action,
|
|
|
|
MxDSStreamingAction** p_streamingAction
|
|
|
|
);
|
2023-12-17 12:24:39 -05:00
|
|
|
MxResult CreateObject(
|
|
|
|
MxStreamController* p_controller,
|
|
|
|
MxU32* p_data,
|
|
|
|
MxDSAction* p_action,
|
2023-12-25 13:32:01 -05:00
|
|
|
MxDSStreamingAction** p_streamingAction
|
2023-12-17 12:24:39 -05:00
|
|
|
);
|
|
|
|
MxResult StartPresenterFromAction(MxStreamController* p_controller, MxDSAction* p_action1, MxDSAction* p_action2);
|
|
|
|
MxResult ParseChunk(
|
|
|
|
MxStreamController* p_controller,
|
|
|
|
MxU32* p_data,
|
|
|
|
MxDSAction* p_action,
|
2023-12-25 13:32:01 -05:00
|
|
|
MxDSStreamingAction** p_streamingAction,
|
2023-12-17 12:24:39 -05:00
|
|
|
MxStreamChunk* p_header
|
|
|
|
);
|
|
|
|
static MxCore* ReadChunk(MxDSBuffer* p_buffer, MxU32* p_chunkData, MxU16 p_flags);
|
2023-12-25 17:39:31 -05:00
|
|
|
MxU8* SkipToData();
|
2023-12-17 12:24:39 -05:00
|
|
|
MxU8 ReleaseRef(MxDSChunk*);
|
|
|
|
void AddRef(MxDSChunk* p_chunk);
|
2023-12-25 17:39:31 -05:00
|
|
|
MxResult CalcBytesRemaining(MxU8* p_data);
|
2023-12-13 05:48:14 -05:00
|
|
|
void FUN_100c6f80(MxU32 p_writeOffset);
|
2023-09-25 22:30:56 -04:00
|
|
|
|
2023-10-30 09:54:00 -04:00
|
|
|
inline MxU8* GetBuffer() { return m_pBuffer; }
|
2023-10-24 19:38:27 -04:00
|
|
|
inline MxU32 GetWriteOffset() { return m_writeOffset; }
|
2023-12-25 17:39:31 -05:00
|
|
|
inline MxU32 GetBytesRemaining() { return m_bytesRemaining; }
|
2023-12-22 14:03:55 -05:00
|
|
|
inline MxU16 GetRefCount() { return m_refcount; }
|
|
|
|
inline MxDSBufferType GetMode() { return m_mode; }
|
2023-12-25 13:32:01 -05:00
|
|
|
inline void SetUnknown14(undefined4 p_unk0x14) { m_unk0x14 = p_unk0x14; }
|
|
|
|
inline void SetUnknown1c(undefined4 p_unk0x1c) { m_unk0x1c = p_unk0x1c; }
|
2023-12-25 17:39:31 -05:00
|
|
|
inline void SetUnk30(MxDSStreamingAction* p_unk0x30) { m_unk0x30 = p_unk0x30; }
|
2023-10-22 15:58:05 -04:00
|
|
|
|
|
|
|
private:
|
2023-12-17 12:24:39 -05:00
|
|
|
MxU8* m_pBuffer; // 0x08
|
|
|
|
MxU8* m_pIntoBuffer; // 0x0c
|
|
|
|
MxU8* m_pIntoBuffer2; // 0x10
|
|
|
|
undefined4 m_unk0x14; // 0x14
|
|
|
|
undefined4 m_unk0x18; // 0x18
|
|
|
|
undefined4 m_unk0x1c; // 0x1c
|
|
|
|
MxU16 m_refcount; // 0x20
|
|
|
|
MxDSBufferType m_mode; // 0x24
|
|
|
|
MxU32 m_writeOffset; // 0x28
|
|
|
|
MxU32 m_bytesRemaining; // 0x2c
|
|
|
|
MxDSStreamingAction* m_unk0x30; // 0x30
|
2023-09-25 22:30:56 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MXDSBUFFER_H
|