35 return Start(0x1000, 0);
221 streamingAction =
m_list.front();
241 if (((
MxDSStreamingAction*) streamingAction)->GetUnknowna0()->GetWriteOffset() < 0x20000) {
266 streamingAction =
NULL;
271 if (streamingAction) {
328#define IntoType(p) ((MxU32*) (p))
337 memset(data + 8, 0, *(
MxU32*) (data + 4));
const char * GetInternal() const
[AI] Returns a pointer to the internal string, or nullptr if not set.
[AI] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
[AI] Buffer for managing streamed DS (Data Stream) chunks and actions.
MxResult FUN_100c7090(MxDSBuffer *p_buf)
[AI] Copies buffer data and selected internal state from another buffer, if space allows.
MxU8 * GetBuffer()
[AI] Returns a pointer to the managed chunk data buffer.
void SetUnknown1c(undefined4 p_unk0x1c)
[AI] Sets the unknown value at offset 0x1c.
undefined4 GetUnknown14()
[AI] Returns the internal value at offset 0x14.
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).
void SetMode(Type p_mode)
[AI] Sets the buffer memory management mode.
MxU8 * FUN_100c6fa0(MxU8 *p_data)
[AI] Finds the next chunk boundary in the buffer, starting from an optional pointer.
MxResult AllocateBuffer(MxU32 p_bufferSize, Type p_mode)
[AI] Allocates a buffer of a given size and memory mode.
@ e_allocate
[AI] Newly allocated memory with new[].
@ e_unknown
[AI] Unknown/other (may be unused or special).
static MxU32 Size(MxU8 *p_buffer)
[AI] Returns the total size (header + data) of a chunk from a raw buffer pointer.
static MxU8 * End(MxU8 *p_buffer)
[AI] Returns a pointer to the end of this chunk for sequential iteration through a chunked buffer.
[AI] Represents a source file handler for SI (Streamer Interface) files, providing buffered access fo...
void SetFileName(const char *p_filename)
[AI] Sets the SI file's name.
MxResult Seek(MxLong, MxS32) override
[AI] Seeks to an absolute or relative position in the file.
MxULong GetStreamBuffersNum() override
[AI] Returns the number of streaming buffers, as specified in the SI file header.
MxResult Open(MxULong) override
[AI] Opens the SI file for reading or writing with the specified style flags.
MxULong GetBufferSize() override
[AI] Returns the SI chunk's buffer size, as obtained from the SI file header.
MxDSObject * FindAndErase(MxDSObject *p_action)
[AI] Finds the matching object and removes it from the list.
[AI] Base class for any object deserialized from an SI (script/data) file in the LEGO Island engine.
MxU32 GetObjectId()
[AI] Returns the object id numeric value.
virtual MxU32 * GetBuffer()
[AI] Returns a pointer to the internal buffer as a DWORD (32-bit) pointer.
MxLong GetPosition() const
[AI] Returns the current per-source seek/read/write position.
virtual MxLong GetLengthInDWords()
[AI] Gets the length of the data in DWORDs (32-bit units).
virtual MxResult ReadToBuffer(MxDSBuffer *p_buffer)
[AI] Reads from this source into a provided MxDSBuffer up to the buffer's current write offset.
[AI] Represents an action that streams data from a buffer within a DirectScript (DS) media timeline.
void SetUnknowna0(MxDSBuffer *p_unk0xa0)
[AI] Assigns a streaming buffer to this action (ownership rules apply).
MxDSBuffer * GetUnknowna0()
[AI] Returns a pointer to the first streaming buffer (possibly current read buffer).
void SetUnknowna4(MxDSBuffer *p_unk0xa4)
[AI] Assigns a secondary streaming buffer to this action.
void SetBufferOffset(MxU32 p_bufferOffset)
[AI] Sets the current buffer read offset.
void ClearUnknowna0()
[AI] Clears/deallocates (sets to NULL) the current buffer pointer (a0).
MxS32 GetUnknown9c()
[AI] Retrieves an internal integer—purpose unknown—held at 0x9c.
void SetUnknown94(MxU32 p_unk0x94)
[AI] Sets the streaming offset/status at 0x94.
MxU32 GetUnknown94()
[AI] Gets the streaming offset or status value at 0x94.
MxU32 GetBufferOffset()
[AI] Gets the buffer offset where streaming is currently positioned.
MxDSBuffer * GetUnknowna4()
[AI] Returns a pointer to the second streaming buffer (possibly for prefetch or double buffering).
[AI] Controller for streaming from disk-based SI resources, manages buffers and streaming actions.
void FUN_100c7f40(MxDSStreamingAction *p_streamingaction)
[AI] Adds a streaming action to m_list0x64 for processing.
void FUN_100c8670(MxDSStreamingAction *p_streamingAction)
[AI] Pushes an action to a private list (m_list0xb8) for later cleanup.
[AI] Thread to handle disk-based streaming for MxDiskStreamProvider, running as a worker for disk str...
MxResult StartWithTarget(MxDiskStreamProvider *p_target)
[AI] Starts the thread with a specific MxDiskStreamProvider as its target.
MxDiskStreamProvider * m_target
[AI] Target provider instance for this worker thread.
[AI] Disk-based stream provider for resource loading using background streaming and multithreading.
MxResult FUN_100d1780(MxDSStreamingAction *p_action)
[AI] Schedules a streaming action to read data (SI chunk) from disk and buffers it asynchronously.
MxS32 GetStreamBuffersNum() override
[AI] Gets the number of stream buffers/splits for the file, used to drive parallel reads.
MxDSObjectList m_list
[AI] List of streaming actions to be processed/completed by the thread.
MxU32 GetFileSize() override
[AI] Gets the size, in bytes, of the open file/buffer to be streamed.
void PerformWork()
[AI] Performs a single unit of scheduled streaming work, i.e., loading data for queued actions.
void VTable0x20(MxDSAction *p_action) override
[AI] Cancels or reclaims outstanding streaming actions based on object ID, returning associated actio...
MxDiskStreamProviderThread m_thread
[AI] Thread object handling streaming actions asynchronously.
MxResult FUN_100d1b20(MxDSStreamingAction *p_action)
[AI] Finalizes merging of streaming buffers and updates streamed data for a given action.
MxResult SetResourceToGet(MxStreamController *p_resource) override
[AI] Opens and prepares a resource for streaming from disk based on the controller's atom (resource k...
static MxBool FUN_100d1af0(MxDSStreamingAction *p_action)
[AI] Returns whether a streaming action can be processed (buffer conditions met).
~MxDiskStreamProvider() override
[AI] Cleans up the disk stream provider, including terminating the worker thread and releasing file a...
MxU32 GetLengthInDWords() override
[AI] Returns file length as dword-count for bulk/integer-based streaming use cases.
MxResult WaitForWorkToComplete()
[AI] Blocks until all scheduled streaming work is finished (used by the streaming worker thread).
MxU32 * GetBufferForDWords() override
[AI] Returns a pointer to the buffer for raw dword access (SI file data block).
MxBool m_unk0x35
[AI] Internal flag signaling available work for the thread or shutdown in progress.
MxDiskStreamProvider()
[AI] Constructs a disk stream provider, initializing critical members and preparing for disk-based st...
MxSemaphore m_busySemaphore
[AI] Semaphore used to synchronize and signal work for the background thread.
MxBool m_remainingWork
[AI] Indicates whether more streaming work remains for the thread.
MxCriticalSection m_criticalSection
[AI] Synchronizes access to the work item queue (m_list).
static const char * GetCD()
[AI] Retrieves the configured CD-ROM media path string used for resource location.
static const char * GetHD()
[AI] Retrieves the configured hard disk media path string used for resource location.
virtual MxResult Init(MxU32 p_initialCount, MxU32 p_maxCount)
Initializes the semaphore with both initial and maximum counts.
void Release(MxU32 p_releaseCount)
Increases the semaphore count, unblocking waiting threads if any.
void Wait(MxU32 p_timeoutMS)
Waits on the semaphore for the specified timeout (in milliseconds).
static MxLong * IntoTime(MxU8 *p_buffer)
[AI] Utility to cast a chunk header buffer into the time field pointer, facilitating direct parsing.
[AI] Controller for streaming and managing multimedia resources and actions during gameplay.
MxAtomId & GetAtom()
[AI] Retrieves the atom ID (unique logical identifier) for this stream controller.
MxDSFile * m_pFile
[AI] Pointer to the loaded SI file associated with this provider. [AI]
MxStreamController * m_pLookup
[AI] The stream controller using this provider as its data source. [AI]
Mindscape custom string class for managing dynamic C-strings within the game engine.
char * GetData() const
Returns a pointer to the internal character buffer.
void Terminate()
[AI] Signals the thread to terminate.
virtual MxResult Run()
[AI] Virtual function executed when the thread runs.
MxResult Start(MxS32 p_stackSize, MxS32 p_flag)
[AI] Starts the thread with a given stack size and creation flags.
void Sleep(MxS32 p_milliseconds)
[AI] Sleeps the current thread for the given duration in milliseconds.
void PushBack(T p_obj)
[AI] Pushes a copy of the provided object to the back of the list.
MxBool PopFront(T &p_obj)
[AI] Removes and returns the first element of the list.
#define DECOMP_SIZE_ASSERT(T, S)
#define NULL
[AI] Null pointer value (C/C++ semantics).
#define FAILURE
[AI] Used to indicate a failed operation in result codes.
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
#define AUTOLOCK(CS)
[AI] Macro for automatic locking using the MxAutoLock class. This macro instantiates an MxAutoLock ob...
MxU32 ReadData(MxU8 *p_fileSizeBuffer, MxU32 p_fileSize)
[AI] Rearranges split and unordered chunks within a memory buffer for SI resource files,...
#define FOURCC(a, b, c, d)
[AI] Macro to compose a 32-bit code from four 8-bit characters (e.g., for resource and chunk IDs).