50 if (!p_fromDestructor) {
61 LegoU32 textureInfoOffset, i, j, numTextures;
62 LegoU32 roiNameLength, roiInfoOffset, surplusLODs;
71 if (storage.
Read(&textureInfoOffset,
sizeof(textureInfoOffset)) !=
SUCCESS) {
77 if (storage.
Read(&numTextures,
sizeof(numTextures)) !=
SUCCESS) {
81 for (i = 0; i < numTextures; i++) {
84 storage.
Read(&textureNameLength,
sizeof(textureNameLength));
85 textureName =
new LegoChar[textureNameLength + 1];
86 storage.
Read(textureName, textureNameLength);
87 textureName[textureNameLength] =
'\0';
91 if (textureName[0] ==
'^') {
92 strcpy(textureName, textureName + 1);
96 if (texture->
Read(&storage, hardwareMode) !=
SUCCESS) {
104 delete discardTexture;
111 delete discardTexture;
114 if (texture->
Read(&storage, hardwareMode) !=
SUCCESS) {
121 if (texture->
Read(&storage, hardwareMode) !=
SUCCESS) {
129 if (textureInfo ==
NULL) {
136 delete[] textureName;
148 if (storage.
Read(&numROIs,
sizeof(numROIs)) !=
SUCCESS) {
152 for (i = 0; i < numROIs; i++) {
153 if (storage.
Read(&roiNameLength,
sizeof(roiNameLength)) !=
SUCCESS) {
157 roiName =
new LegoChar[roiNameLength + 1];
158 if (storage.
Read(roiName, roiNameLength) !=
SUCCESS) {
162 roiName[roiNameLength] =
'\0';
165 if (storage.
Read(&numLODs,
sizeof(numLODs)) !=
SUCCESS) {
168 if (storage.
Read(&roiInfoOffset,
sizeof(roiInfoOffset)) !=
SUCCESS) {
182 for (j = 0; j < numLODs; j++) {
202 m_parts->
Append(namedPart);
211 if (roiName !=
NULL) {
249 while (partCursor.
Next(part)) {
252 if (lodList ==
NULL) {
258 while (lodCursor.
First(lod)) {
268 if (m_parts !=
NULL) {
const T * PushBack(const T *)
[AI] Typed append.
void Add(const char *p_name, T *p_value)
Add an element mapped to the given name, replacing existing item if present.
[AI] Cursor class for traversing a LegoLODList.
[AI] Manages a list of LOD (Level-of-Detail) objects used for efficient 3D rendering by trading detai...
[AI] Level-Of-Detail (LOD) object used for rendering and managing polygonal mesh data with LOD switch...
LegoResult Read(Tgl::Renderer *p_renderer, LegoTextureContainer *p_textureContainer, LegoStorage *p_storage)
[AI] Load LOD geometry and material info from storage, building Tgl::Mesh group(s).
Implementation of LegoStorage for memory-backed buffers.
LegoResult Read(void *p_buffer, LegoU32 p_size) override
Reads bytes from memory buffer at current position.
LegoResult SetPosition(LegoU32 p_position) override
Sets the current offset into the memory buffer.
[AI] Cursor/iterator for traversing a LegoNamedPartList.
[AI] A list container for storing pointers to LegoNamedPart objects.
[AI] Encapsulates a named part within a LEGO object that contains a list of LODs (Levels of Detail).
LegoLODList * GetList()
[AI] Accesses the list of LODs associated with this part.
const MxString * GetName() const
[AI] Gets the name of this named part.
[AI] Presents and loads Lego part definitions from SI chunks and manages their installation in ViewLO...
MxResult Read(MxDSChunk &p_chunk)
[AI] Reads Lego part and texture data from a MxDSChunk and builds internal part list.
MxResult AddToManager() override
[AI] Registers this presenter with the VideoManager.
void Destroy() override
[AI] Virtual destroy method called by framework.
void Store()
[AI] Transfers all loaded named Lego parts and LODs to the ViewLODListManager.
void ReadyTickle() override
[AI] Called when entering the Ready tickle state: loads and installs parts from the subscriber stream...
[AI] Contains DirectDraw and Direct3DRM handles and metadata for a texture used in the LEGO Island re...
static LegoTextureInfo * Create(const char *p_name, LegoTexture *p_texture)
[AI] Creates a new LegoTextureInfo for a given logical name and loaded LegoTexture.
[AI] Represents a texture which wraps a LegoImage and provides loading/saving functionality.
LegoResult Read(LegoStorage *p_storage, LegoU32 p_square)
[AI] Reads texture data from a LegoStorage.
MxDirect3D * GetDirect3D()
[AI] Returns the active Direct3D wrapper (engine/utility) object.
BOOL GetHardwareMode()
[AI] Checks if the device is operating in hardware mode.
void Enter()
[AI] Acquires/gains entry to the critical section or mutex, blocking if not available.
void Leave()
[AI] Releases/leaves the critical section or mutex.
virtual MxLong GetElapsedTime()
[AI] Gets elapsed time for this action since the last time field 0x90 was set.
[AI] Represents a chunk of data extracted from a stream (typically from a Mindscape/Mx SI file or str...
MxLong GetTime()
[AI] Returns the time (timestamp or tick) associated with this chunk. [AI]
MxU8 * GetData()
[AI] Returns a pointer to the start of the data payload. [AI]
MxStreamChunk * PopData()
[AI] Pops the next available pending data chunk for consumption, moving it to the consumed list.
void FreeDataChunk(MxStreamChunk *p_chunk)
[AI] Frees (deletes) a data chunk if it's found in the consumed data list; also forcibly deletes sing...
MxStreamChunk * PeekData()
[AI] Returns but does not remove the first pending data chunk ("peek" operation).
MxAssignedDevice * AssignedDevice()
[AI] Returns the currently selected/active rendering device information for 3D output.
MxBool First(T &p_obj)
[AI]
MxU32 GetNumElements()
[AI]
virtual void ParseExtra()
[AI] Parses additional data from the associated action for configuration or world interaction.
void ProgressTickleState(TickleState p_tickleState)
[AI] Helper for advancing the presenter's tickle state and updating transition history.
MxDSAction * m_action
[AI] The associated action currently being presented by this presenter.
@ e_starting
[AI] In the process of starting playback/presentation.
MxCriticalSection m_criticalSection
[AI] Thread synchronization for presenter state and data.
[AI] Represents a streamable chunk of data, typically sourced from a media buffer and designed for no...
char * GetData() const
Returns a pointer to the internal character buffer.
ViewLODList * Create(const ROIName &rROIName, int lodCount)
[AI] Creates and registers a new ViewLODList for a named ROI, with space for the specified number of ...
ViewLODList * Lookup(const ROIName &) const
[AI] Looks up an existing ViewLODList by ROI name, incrementing its reference count.
[AI] Reference-counted list of Level-of-Detail (LOD) objects associated with a single ROI (Realtime O...
int Release()
[AI] Decrements the reference count.
unsigned char GetUnknown0x08Test8()
[AI] Performs a bitwise AND (mask) with value 0xffffff08 on the internal flag, returning result as an...
#define DECOMP_SIZE_ASSERT(T, S)
MxS32 g_partPresenterConfig1
MxS32 g_partPresenterConfig2
#define NULL
[AI] Null pointer value (C/C++ semantics).
unsigned long LegoU32
[AI] Unsigned 32-bit integer type for cross-platform compatibility.
char LegoChar
[AI] Alias for char, for use in character/byte data and string handling.
#define FAILURE
[AI] Used to indicate a failed operation in result codes.
long LegoS32
[AI] Signed 32-bit integer type for cross-platform compatibility.
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
LegoVideoManager * VideoManager()
[AI] Accessor for the game's LegoVideoManager subsystem. Used for managing 3D/video hardware....
ViewLODListManager * GetViewLODListManager()
[AI] Returns the global ViewLODListManager for view LOD (Level of Detail) resources....
LegoTextureContainer * TextureContainer()
[AI] Accessor for the texture container used for global texture management. [AI]