38 m_addedToView =
FALSE;
41 if (!p_fromDestructor) {
55 LegoU32 version, textureInfoOffset, i, numTextures, skipTextures;
68 if (storage.Read(&version,
sizeof(version)) !=
SUCCESS) {
74 if (storage.Read(&textureInfoOffset,
sizeof(textureInfoOffset)) !=
SUCCESS) {
78 storage.SetPosition(textureInfoOffset);
80 if (storage.Read(&numTextures,
sizeof(numTextures)) !=
SUCCESS) {
83 if (storage.Read(&skipTextures,
sizeof(skipTextures)) !=
SUCCESS) {
87 for (i = 0; i < numTextures; i++) {
90 storage.
Read(&textureNameLength,
sizeof(textureNameLength));
91 textureName =
new LegoChar[textureNameLength + 1];
92 storage.Read(textureName, textureNameLength);
93 textureName[textureNameLength] =
'\0';
97 if (textureName[0] ==
'^') {
98 strcpy(textureName, textureName + 1);
102 if (texture->
Read(&storage, hardwareMode) !=
SUCCESS) {
110 delete discardTexture;
117 delete discardTexture;
120 if (texture->
Read(&storage, hardwareMode) !=
SUCCESS) {
127 if (texture->
Read(&storage, hardwareMode) !=
SUCCESS) {
136 if (textureInfo ==
NULL) {
143 delete[] textureName;
150 storage.SetPosition(8);
152 if (storage.Read(&numROIs,
sizeof(numROIs)) !=
SUCCESS) {
179 if (textureName !=
NULL) {
180 delete[] textureName;
182 if (texture !=
NULL) {
208 if (m_roi ==
NULL && (result = CreateROI(&p_chunk)) ==
SUCCESS && p_entity !=
NULL) {
217 if (p_entity !=
NULL) {
243 ->GetInternalEntity()
270 ->GetInternalEntity()
295 char extraCopy[1024], output[1024];
297 memcpy(extraCopy, extraData, extraLength);
298 extraCopy[extraLength] =
'\0';
305 m_addedToView =
FALSE;
310 list<LegoROI*>& roiList = currentWorld->
GetROIList();
312 for (list<LegoROI*>::iterator it = roiList.begin(); it != roiList.end(); it++) {
313 if (!strcmpi((*it)->GetName(), output)) {
317 m_addedToView =
TRUE;
BOOL Moved(ViewROI &rROI)
[AI] Notifies the manager that the ROI has moved and needs spatial update.
BOOL Add(ViewROI &rROI)
[AI] Adds a ViewROI (rendered object) to the scene.
[AI] Root class for all node-based animation blending/structure.
virtual LegoResult Read(LegoStorage *p_storage, LegoS32 p_parseScene)
[AI] Loads model and animation data from storage, optionally including scene/camera animation.
LegoROI * GetActorROI(const char *p_name, MxBool p_createEntity)
[AI] Returns a LegoROI for the given character name, creating and registering the actor if necessary.
void Add(const char *p_name, T *p_value)
Add an element mapped to the given name, replacing existing item if present.
[AI] Presenter responsible for managing the lifecycle, location, and logic for a LegoEntity instance ...
[AI] Represents an entity that can be placed and managed in the LEGO Island world.
virtual void SetROI(LegoROI *p_roi, MxBool p_bool1, MxBool p_bool2)
[AI] Assigns a 3D ROI (3D object instance) to this entity, controlling how it appears/acts in the wor...
void ClearFlag(MxU8 p_flag)
[AI] Clears the given flag in the flags byte.
@ e_actor
[AI] Standard character entity controlled by scripts or user [AI]
@ c_managerOwned
[AI] Indicates this entity is managed/owned by an entity manager [AI]
Implementation of LegoStorage for memory-backed buffers.
[AI] Presenter class for managing 3D model (ROI) presentation and their relationship with entities in...
MxResult FUN_1007ff70(MxDSChunk &p_chunk, LegoEntity *p_entity, MxBool p_roiVisible, LegoWorld *p_world)
[AI] Loads or associates an ROI for presentation from a chunk, linking it to a LegoEntity or LegoWorl...
void ReadyTickle() override
[AI] Handles the tickle state when moving into the Ready state. If necessary, creates or assigns an R...
void Destroy() override
[AI] Destroys all resources and resets state. Calls base class destroy if not from destructor.
void ParseExtra() override
[AI] Parses and applies extra data from the action, for example to auto-create or DB-create an ROI ba...
[AI] Represents a Real-time Object Instance enriched with LEGO-specific functionality.
LegoResult SetFrame(LegoAnim *p_anim, LegoTime p_time)
[AI] Sets the current animation frame for this ROI based on a parsed animation structure.
LegoResult Read(OrientableROI *p_unk0xd4, Tgl::Renderer *p_renderer, ViewLODListManager *p_viewLODListManager, LegoTextureContainer *p_textureContainer, LegoStorage *p_storage)
[AI] Reads and initializes this ROI from a LEGO project resource stream, populating geometry,...
[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.
Lego3DManager * Get3DManager()
[AI] Returns the Lego3DManager for this manager, which owns all 3D scene representations and view con...
Represents the active 3D world, holding all entity, animation, sound, path, and ROI objects.
list< LegoROI * > & GetROIList()
Gets the list of all ROIs (Real-time Object Instances) in the world.
[AI] Represents a 3D point with floating-point precision, inheriting from Vector3.
BOOL GetHardwareMode()
[AI] Checks if the device is operating in hardware mode.
MxBool IsA(const char *p_name) const override
[AI] Runtime type checking for presenter class hierarchy, supporting parent/child class checks.
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.
void GetExtra(MxU16 &p_extraLength, char *&p_extraData)
[AI] Retrieves the extra data and its length for this action.
const Vector3 & GetLocation()
[AI] Gets the location vector for this action (world or local space).
const Vector3 & GetUp()
[AI] Gets the up vector for this action (global or local).
const Vector3 & GetDirection()
[AI] Gets the direction vector (typically forward vector) for this action.
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.
[AI] Represents a 4x4 transformation matrix, specialized for the LEGO Island engine and derived from ...
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.
MxS32 GetCurrentTickleState() const
[AI] Returns the current tickle state.
@ e_ready
[AI] Prepared to start processing an action.
@ e_starting
[AI] In the process of starting playback/presentation.
MxCriticalSection m_criticalSection
[AI] Thread synchronization for presenter state and data.
MxCompositePresenter * m_compositePresenter
[AI] Owner composite presenter, if any.
[AI] Represents a streamable chunk of data, typically sourced from a media buffer and designed for no...
void EndAction() override
Signals the end of the current playback action.
void Destroy() override
Destroys internal resources for the presenter.
void UpdateTransformationRelativeToParent(const Matrix4 &p_transform)
Calculates and updates the world transform relative to this object's parent, then calls UpdateWorldDa...
void SetVisibility(unsigned char p_visible)
[AI] Sets the visibility flag to the provided value.
#define DECOMP_SIZE_ASSERT(T, S)
const char * g_parseExtraTokens
[AI] Delimiter tokens for parsing extra parameters in scripts or command strings.
const char * g_strAUTO_CREATE
[AI] Used to signal that an object or feature should be automatically created/initialized on load.
const char * g_strDB_CREATE
[AI] Used to indicate an entry should be created for a resource in a data block (DB) at load time.
MxS32 g_modelPresenterConfig
#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....
LegoCharacterManager * CharacterManager()
[AI] Accessor for the character manager, which manages in-game characters/NPCs. [AI]
ViewLODListManager * GetViewLODListManager()
[AI] Returns the global ViewLODListManager for view LOD (Level of Detail) resources....
LegoWorld * CurrentWorld()
[AI] Accessor for the currently active LegoWorld instance. [AI]
LegoTextureContainer * TextureContainer()
[AI] Accessor for the texture container used for global texture management. [AI]
MxBool KeyValueStringParse(char *, const char *, const char *)
Searches p_string for a key command and copies its associated value to p_output.
void CalcLocalTransform(const Vector3 &p_posVec, const Vector3 &p_dirVec, const Vector3 &p_upVec, Matrix4 &p_outMatrix)
[AI] Computes a transformation matrix based on a position, direction, and up vector.
#define MODEL_VERSION
[AI] Represents the version number of the game model/resources.