Isle
Loading...
Searching...
No Matches
mxdsbuffer.h
Go to the documentation of this file.
1#ifndef MXDSBUFFER_H
2#define MXDSBUFFER_H
3
4#include "decomp.h"
5#include "mxcore.h"
6
10class MxStreamController; // [AI]
11
15class MxDSAction; // [AI]
16
20class MxDSStreamingAction; // [AI]
21
25class MxStreamChunk; // [AI]
26
30class MxDSChunk; // [AI]
31
47// VTABLE: LEGO1 0x100dcca0
48// VTABLE: BETA10 0x101c2898
49// SIZE 0x34
50class MxDSBuffer : public MxCore {
51public:
55 enum Type {
56 e_chunk = 0,
60 };
61
65 MxDSBuffer(); // [AI]
66
70 ~MxDSBuffer() override; // [AI]
71
76 const char* ClassName() const override; // [AI]
77
85 MxResult AllocateBuffer(MxU32 p_bufferSize, Type p_mode); // [AI]
86
95 MxResult SetBufferPointer(MxU8* p_buffer, MxU32 p_size); // [AI]
96
109 MxStreamController* p_controller,
110 MxDSAction* p_action,
111 MxDSStreamingAction** p_streamingAction
112 ); // [AI]
113
127 MxStreamController* p_controller,
128 MxU32* p_data,
129 MxDSAction* p_action,
130 MxDSStreamingAction** p_streamingAction
131 ); // [AI]
132
144 MxResult StartPresenterFromAction(MxStreamController* p_controller, MxDSAction* p_action1, MxDSAction* p_action2); // [AI]
145
160 MxStreamController* p_controller,
161 MxU32* p_data,
162 MxDSAction* p_action,
163 MxDSStreamingAction** p_streamingAction,
164 MxStreamChunk* p_header
165 ); // [AI]
166
175 MxU8* SkipToData(); // [AI]
176
183 MxU8 ReleaseRef(MxDSChunk*); // [AI]
184
192 void AddRef(MxDSChunk* p_chunk); // [AI]
193
203 MxResult CalcBytesRemaining(MxU8* p_data); // [AI]
204
212 void FUN_100c6f80(MxU32 p_writeOffset); // [AI] [AI_SUGGESTED_NAME: SetStreamingOffset]
213
222 MxU8* FUN_100c6fa0(MxU8* p_data); // [AI] [AI_SUGGESTED_NAME: NextChunkBoundary]
223
232 MxResult FUN_100c7090(MxDSBuffer* p_buf); // [AI] [AI_SUGGESTED_NAME: CopyFromBuffer]
233
244 static MxCore* ReadChunk(MxDSBuffer* p_buffer, MxU32* p_chunkData, MxU16 p_flags); // [AI]
245
253 static MxResult Append(MxU8* p_buffer1, MxU8* p_buffer2); // [AI]
254
259 MxU8* GetBuffer(); // [AI]
260
265 undefined4 GetUnknown14(); // [AI] [AI_SUGGESTED_NAME: GetCustomMeta1]
266
271 MxBool HasRef(); // [AI]
272
277
281 Type GetMode(); // [AI]
282
287
292
297 void SetUnknown14(undefined4 p_unk0x14); // [AI] [AI_SUGGESTED_NAME: SetCustomMeta1]
298
303 void SetUnknown1c(undefined4 p_unk0x1c); // [AI] [AI_SUGGESTED_NAME: SetCustomMeta2]
304
309 void SetMode(Type p_mode); // [AI]
310
315 void SetUnk30(MxDSStreamingAction* p_unk0x30); // [AI] [AI_SUGGESTED_NAME: SetCurrentStreamingAction]
316
317 // SYNTHETIC: LEGO1 0x100c6510
318 // SYNTHETIC: BETA10 0x10158530
319 // MxDSBuffer::`scalar deleting destructor'
320
321private:
322 MxU8* m_pBuffer;
323 MxU8* m_pIntoBuffer;
324 MxU8* m_pIntoBuffer2;
325 undefined4 m_unk0x14;
326 undefined4 m_unk0x18;
327 undefined4 m_unk0x1c;
328 MxU16 m_referenceCount;
329 Type m_mode;
330 MxU32 m_writeOffset;
331 MxU32 m_bytesRemaining;
332 MxDSStreamingAction* m_unk0x30;
333};
334
335#endif // MXDSBUFFER_H
[AI] Base virtual class for all Mindscape engine (Mx) objects.
Definition: mxcore.h:15
[AI] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
Definition: mxdsaction.h:17
[AI] Buffer for managing streamed DS (Data Stream) chunks and actions.
Definition: mxdsbuffer.h:50
MxU8 * SkipToData()
[AI] Scans this buffer forward to the next valid object or chunk and returns a pointer to its start.
Definition: mxdsbuffer.cpp:352
MxResult FUN_100c7090(MxDSBuffer *p_buf)
[AI] Copies buffer data and selected internal state from another buffer, if space allows.
Definition: mxdsbuffer.cpp:495
MxU16 GetRefCount()
[AI] Returns the current buffer reference count.
MxResult SetBufferPointer(MxU8 *p_buffer, MxU32 p_size)
[AI] Sets a buffer pointer and records its size.
Definition: mxdsbuffer.cpp:89
MxResult CalcBytesRemaining(MxU8 *p_data)
[AI] Calculates pending bytes remaining to be streamed, updates buffer state accordingly.
Definition: mxdsbuffer.cpp:417
MxU8 * GetBuffer()
[AI] Returns a pointer to the managed chunk data buffer.
void AddRef(MxDSChunk *p_chunk)
[AI] Increment reference count for this buffer (ownership by a chunk).
Definition: mxdsbuffer.cpp:408
void SetUnk30(MxDSStreamingAction *p_unk0x30)
[AI] Sets the pointer to the currently relevant streaming action for this buffer.
Type GetMode()
[AI] Returns the current buffer management mode.
void SetUnknown1c(undefined4 p_unk0x1c)
[AI] Sets the unknown value at offset 0x1c.
MxU8 ReleaseRef(MxDSChunk *)
[AI] Decrement the buffer's chunk reference count.
Definition: mxdsbuffer.cpp:399
undefined4 GetUnknown14()
[AI] Returns the internal value at offset 0x14.
MxResult StartPresenterFromAction(MxStreamController *p_controller, MxDSAction *p_action1, MxDSAction *p_action2)
[AI] Launches a presenter for the given action if not already present.
Definition: mxdsbuffer.cpp:201
MxResult CreateObject(MxStreamController *p_controller, MxU32 *p_data, MxDSAction *p_action, MxDSStreamingAction **p_streamingAction)
[AI] Creates a presenter/action object by deserializing a data block.
Definition: mxdsbuffer.cpp:163
void SetUnknown14(undefined4 p_unk0x14)
[AI] Sets the unknown value at offset 0x14.
MxU32 GetWriteOffset()
[AI] Returns the current buffer write offset (number of bytes with valid data).
~MxDSBuffer() override
[AI] Destructor: Releases memory appropriately based on buffer management mode and asserts no referen...
Definition: mxdsbuffer.cpp:34
MxDSBuffer()
[AI] Constructs a buffer object and initializes all internal pointers and counters.
Definition: mxdsbuffer.cpp:17
void SetMode(Type p_mode)
[AI] Sets the buffer memory management mode.
const char * ClassName() const override
[AI] Returns the runtime class name for serialization/reflection.
MxU8 * FUN_100c6fa0(MxU8 *p_data)
[AI] Finds the next chunk boundary in the buffer, starting from an optional pointer.
Definition: mxdsbuffer.cpp:459
MxResult AllocateBuffer(MxU32 p_bufferSize, Type p_mode)
[AI] Allocates a buffer of a given size and memory mode.
Definition: mxdsbuffer.cpp:60
MxResult ParseChunk(MxStreamController *p_controller, MxU32 *p_data, MxDSAction *p_action, MxDSStreamingAction **p_streamingAction, MxStreamChunk *p_header)
[AI] Parses an MxStreamChunk for logical streaming actions, nested chunks, EoS, and splitting.
Definition: mxdsbuffer.cpp:240
void FUN_100c6f80(MxU32 p_writeOffset)
[AI] Sets the buffer's internal streaming position to the given write offset.
Definition: mxdsbuffer.cpp:450
static MxResult Append(MxU8 *p_buffer1, MxU8 *p_buffer2)
[AI] Appends one chunk/data stream buffer to another, adjusting sizes/headers.
Definition: mxdsbuffer.cpp:509
MxResult FUN_100c67b0(MxStreamController *p_controller, MxDSAction *p_action, MxDSStreamingAction **p_streamingAction)
[AI] Executes streaming action startup and object creation loop from an initial SI chunk.
Definition: mxdsbuffer.cpp:102
MxU32 GetBytesRemaining()
[AI] Returns the number of bytes remaining to stream in this buffer.
static MxCore * ReadChunk(MxDSBuffer *p_buffer, MxU32 *p_chunkData, MxU16 p_flags)
[AI] Reads an SI file object/chunk at given position in a buffer.
Definition: mxdsbuffer.cpp:322
Type
[AI] Buffer memory management type.
Definition: mxdsbuffer.h:55
@ e_preallocated
[AI] Preallocated memory passed in from outside.
Definition: mxdsbuffer.h:58
@ e_allocate
[AI] Newly allocated memory with new[].
Definition: mxdsbuffer.h:57
@ e_chunk
[AI] Chunk-managed memory (from Streamer pool).
Definition: mxdsbuffer.h:56
@ e_unknown
[AI] Unknown/other (may be unused or special).
Definition: mxdsbuffer.h:59
MxBool HasRef()
[AI] Checks whether there are any active references to this buffer.
[AI] Represents a chunk of data extracted from a stream (typically from a Mindscape/Mx SI file or str...
Definition: mxdschunk.h:38
[AI] Represents an action that streams data from a buffer within a DirectScript (DS) media timeline.
[AI] Represents a streamable chunk of data, typically sourced from a media buffer and designed for no...
Definition: mxstreamchunk.h:19
[AI] Controller for streaming and managing multimedia resources and actions during gameplay.
unsigned int undefined4
Definition: decomp.h:28
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
MxLong MxResult
[AI]
Definition: mxtypes.h:106
unsigned char MxU8
[AI]
Definition: mxtypes.h:8
unsigned short MxU16
[AI]
Definition: mxtypes.h:20
unsigned int MxU32
[AI]
Definition: mxtypes.h:32