Isle
|
[AI] Manages reference-counted characters and provides character creation, switching, and property update functionality. More...
#include <legocharactermanager.h>
Public Member Functions | |
LegoCharacterManager () | |
[AI] Constructs the character manager, initializing tables and the customizable animation variable. More... | |
~LegoCharacterManager () | |
[AI] Destroys the manager, cleaning up all managed characters and animation customization state. More... | |
MxResult | Write (LegoStorage *p_storage) |
[AI] Writes the persistent character info data to a storage object. More... | |
MxResult | Read (LegoStorage *p_storage) |
[AI] Reads character info data from a storage object. More... | |
const char * | GetActorName (MxS32 p_index) |
[AI] Returns the actor name for the given actor index (lookup in global g_actorInfo table). More... | |
MxU32 | GetNumActors () |
[AI] Returns the number of actors registered in global g_actorInfo. More... | |
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. More... | |
void | Init () |
[AI] Initializes all actor info structures based on their templates/defaults. More... | |
void | ReleaseAllActors () |
[AI] Releases all actors associated with this manager, unregistering/releasing references until destroyed. More... | |
MxBool | Exists (const char *p_name) |
[AI] Returns whether a character with the given name exists in the manager. More... | |
MxU32 | GetRefCount (LegoROI *p_roi) |
[AI] Returns the reference count for a given LegoROI* tracked by the manager. More... | |
void | ReleaseActor (const char *p_name) |
[AI] Releases a character/ROI by name, decrementing its reference count and deleting if zero. More... | |
void | ReleaseActor (LegoROI *p_roi) |
[AI] Releases a character/ROI object, handling reference count and eventual deletion. More... | |
void | ReleaseAutoROI (LegoROI *p_roi) |
[AI] Releases an "auto" ROI, used for dynamically created ROI objects by this manager. More... | |
MxBool | FUN_100849a0 (LegoROI *p_roi, LegoTextureInfo *p_texture) |
[AI] Replaces the head LOD of a character ROI with a new LOD list built using the provided texture. More... | |
LegoExtraActor * | GetExtraActor (const char *p_name) |
[AI] Returns an extra actor associated with a given character name, or NULL if not found. More... | |
LegoActorInfo * | GetActorInfo (const char *p_name) |
[AI] Returns the actor info struct for the character of the given name, or NULL if not found. More... | |
LegoActorInfo * | GetActorInfo (LegoROI *p_roi) |
[AI] Returns actor info struct for the character associated with a given ROI pointer. More... | |
MxBool | SwitchColor (LegoROI *p_roi, LegoROI *p_targetROI) |
[AI] Changes the color of a part of a character's ROI, updating its part info index and updating ROI color. More... | |
MxBool | SwitchVariant (LegoROI *p_roi) |
[AI] Cycles through part variants (e.g. More... | |
MxBool | SwitchSound (LegoROI *p_roi) |
[AI] Cycles the sound type for the actor, updating the per-actor info. More... | |
MxBool | SwitchMove (LegoROI *p_roi) |
[AI] Cycles the move type for the actor, updating the per-actor info. More... | |
MxBool | SwitchMood (LegoROI *p_roi) |
[AI] Cycles the mood type for the actor, updating the per-actor info. More... | |
MxU32 | GetAnimationId (LegoROI *p_roi) |
[AI] Returns an animation ID corresponding to the ROI's move index. More... | |
MxU32 | GetSoundId (LegoROI *p_roi, MxBool p_und) |
[AI] Returns the sound ID for the ROI's current sound/mood selection. More... | |
MxU8 | GetMood (LegoROI *p_roi) |
[AI] Returns the current mood value (0-3) for the actor associated with the ROI. More... | |
LegoROI * | CreateAutoROI (const char *p_name, const char *p_lodName, MxBool p_createEntity) |
[AI] Creates an "auto" ROI object with the given name, LOD name, and optional entity creation. More... | |
MxResult | FUN_10085870 (LegoROI *p_roi) |
[AI] Initializes auto-ROI with bounding volume and transformation. More... | |
LegoROI * | FUN_10085a80 (const char *p_name, const char *p_lodName, MxBool p_createEntity) |
[AI] Helper function that delegates to CreateAutoROI. More... | |
Static Public Member Functions | |
static void | SetCustomizeAnimFile (const char *p_value) |
[AI] Sets the value of the customization animation file variable, propagating to all relevant subsystems. More... | |
static MxBool | IsActor (const char *p_name) |
[AI] Checks if the given name matches an actor in the global actor table (case-insensitive). More... | |
static const char * | GetCustomizeAnimFile () |
[AI] Gets the value of the customize animation file variable. More... | |
[AI] Manages reference-counted characters and provides character creation, switching, and property update functionality.
Handles creation and deletion of LegoROI-based character objects, manages reference counts to avoid redundant copies, supports property switching for sound, color, variant, mood, animation, reading/writing state to storage, and provides runtime customization features (e.g., runtime selection of animation files).
Used for runtime management of all interactive/actor-type Lego characters and "automatic" ROI objects tied to characters (by name). [AI]
SIZE: 0x08 bytes
Definition at line 131 of file legocharactermanager.h.
LegoCharacterManager::LegoCharacterManager | ( | ) |
[AI] Constructs the character manager, initializing tables and the customizable animation variable.
Definition at line 59 of file legocharactermanager.cpp.
LegoCharacterManager::~LegoCharacterManager | ( | ) |
[AI] Destroys the manager, cleaning up all managed characters and animation customization state.
Definition at line 70 of file legocharactermanager.cpp.
LegoROI * LegoCharacterManager::CreateAutoROI | ( | const char * | p_name, |
const char * | p_lodName, | ||
MxBool | p_createEntity | ||
) |
[AI] Creates an "auto" ROI object with the given name, LOD name, and optional entity creation.
[AI]
p_name | Name for the new ROI (or NULL for auto-generated). [AI] |
p_lodName | LOD name to use to build ROI/model. [AI] |
p_createEntity | If TRUE, also creates and registers a new LegoEntity. [AI] |
Definition at line 985 of file legocharactermanager.cpp.
MxBool LegoCharacterManager::Exists | ( | const char * | p_name | ) |
[AI] Returns whether a character with the given name exists in the manager.
p_name | Name of the character. [AI] |
Definition at line 299 of file legocharactermanager.cpp.
MxBool LegoCharacterManager::FUN_100849a0 | ( | LegoROI * | p_roi, |
LegoTextureInfo * | p_texture | ||
) |
[AI] Replaces the head LOD of a character ROI with a new LOD list built using the provided texture.
p_roi | ROI to update. [AI] |
p_texture | New texture to use for the head LOD. [AI] |
Definition at line 605 of file legocharactermanager.cpp.
[AI] Initializes auto-ROI with bounding volume and transformation.
p_roi | ROI to initialize. [AI] |
Sets up bounding box/sphere and invokes VTable0x14 for derived setup. [AI]
Definition at line 1045 of file legocharactermanager.cpp.
LegoROI * LegoCharacterManager::FUN_10085a80 | ( | const char * | p_name, |
const char * | p_lodName, | ||
MxBool | p_createEntity | ||
) |
[AI] Helper function that delegates to CreateAutoROI.
p_name | Name for the new ROI. [AI] |
p_lodName | LOD name. [AI] |
p_createEntity | Entity creation flag. [AI] |
Definition at line 1087 of file legocharactermanager.cpp.
LegoActorInfo * LegoCharacterManager::GetActorInfo | ( | const char * | p_name | ) |
[AI] Returns the actor info struct for the character of the given name, or NULL if not found.
p_name | Character name [AI] |
Definition at line 683 of file legocharactermanager.cpp.
LegoActorInfo * LegoCharacterManager::GetActorInfo | ( | LegoROI * | p_roi | ) |
[AI] Returns actor info struct for the character associated with a given ROI pointer.
p_roi | ROI to match [AI] |
Definition at line 703 of file legocharactermanager.cpp.
const char * LegoCharacterManager::GetActorName | ( | MxS32 | p_index | ) |
[AI] Returns the actor name for the given actor index (lookup in global g_actorInfo table).
p_index | Index into the actor info array. [AI] |
Definition at line 230 of file legocharactermanager.cpp.
[AI] Returns a LegoROI for the given character name, creating and registering the actor if necessary.
p_name | Name of the actor. [AI] |
p_createEntity | Whether to create and attach an entity if one doesn't exist. [AI] |
Definition at line 249 of file legocharactermanager.cpp.
[AI] Returns an animation ID corresponding to the ROI's move index.
[AI]
p_roi | Character ROI [AI] |
Definition at line 920 of file legocharactermanager.cpp.
|
inlinestatic |
[AI] Gets the value of the customize animation file variable.
[AI]
Definition at line 354 of file legocharactermanager.h.
LegoExtraActor * LegoCharacterManager::GetExtraActor | ( | const char * | p_name | ) |
[AI] Returns an extra actor associated with a given character name, or NULL if not found.
p_name | Character name [AI] |
Definition at line 670 of file legocharactermanager.cpp.
[AI] Returns the current mood value (0-3) for the actor associated with the ROI.
[AI]
p_roi | Character ROI [AI] |
Definition at line 952 of file legocharactermanager.cpp.
MxU32 LegoCharacterManager::GetNumActors | ( | ) |
[AI] Returns the number of actors registered in global g_actorInfo.
[AI]
Definition at line 242 of file legocharactermanager.cpp.
[AI] Returns the reference count for a given LegoROI* tracked by the manager.
p_roi | ROI to query. [AI] |
Definition at line 311 of file legocharactermanager.cpp.
[AI] Returns the sound ID for the ROI's current sound/mood selection.
[AI]
p_roi | Character ROI [AI] |
p_und | If true, returns alternate mood-based sound id. [AI] |
Definition at line 934 of file legocharactermanager.cpp.
void LegoCharacterManager::Init | ( | ) |
[AI] Initializes all actor info structures based on their templates/defaults.
[AI]
Definition at line 89 of file legocharactermanager.cpp.
|
static |
[AI] Checks if the given name matches an actor in the global actor table (case-insensitive).
p_name | Name string to check. [AI] |
Definition at line 658 of file legocharactermanager.cpp.
MxResult LegoCharacterManager::Read | ( | LegoStorage * | p_storage | ) |
[AI] Reads character info data from a storage object.
p_storage | Storage object to read from. [AI] |
Reads the dynamic properties back into LegoActorInfo structures. [AI]
Definition at line 174 of file legocharactermanager.cpp.
void LegoCharacterManager::ReleaseActor | ( | const char * | p_name | ) |
[AI] Releases a character/ROI by name, decrementing its reference count and deleting if zero.
p_name | Name of the character to release. [AI] |
Definition at line 329 of file legocharactermanager.cpp.
void LegoCharacterManager::ReleaseActor | ( | LegoROI * | p_roi | ) |
[AI] Releases a character/ROI object, handling reference count and eventual deletion.
p_roi | ROI to release. [AI] |
Definition at line 370 of file legocharactermanager.cpp.
void LegoCharacterManager::ReleaseAllActors | ( | ) |
[AI] Releases all actors associated with this manager, unregistering/releasing references until destroyed.
Definition at line 97 of file legocharactermanager.cpp.
void LegoCharacterManager::ReleaseAutoROI | ( | LegoROI * | p_roi | ) |
[AI] Releases an "auto" ROI, used for dynamically created ROI objects by this manager.
p_roi | ROI to release. [AI] |
This is specifically for ROIs created via CreateAutoROI.
Definition at line 415 of file legocharactermanager.cpp.
|
static |
[AI] Sets the value of the customization animation file variable, propagating to all relevant subsystems.
p_value | The new animation file to use. [AI] |
Also updates PlantManager and BuildingManager. [AI]
Definition at line 965 of file legocharactermanager.cpp.
[AI] Changes the color of a part of a character's ROI, updating its part info index and updating ROI color.
p_roi | Character ROI [AI] |
p_targetROI | ROI for the part to change (may be determined based on target name). [AI] |
Definition at line 746 of file legocharactermanager.cpp.
[AI] Cycles the mood type for the actor, updating the per-actor info.
[AI]
p_roi | Character ROI [AI] |
Definition at line 900 of file legocharactermanager.cpp.
[AI] Cycles the move type for the actor, updating the per-actor info.
[AI]
p_roi | Character ROI [AI] |
Definition at line 880 of file legocharactermanager.cpp.
[AI] Cycles the sound type for the actor, updating the per-actor info.
[AI]
p_roi | Character ROI [AI] |
Definition at line 860 of file legocharactermanager.cpp.
[AI] Cycles through part variants (e.g.
hat) for the character's ROI, updating the model as appropriate.
p_roi | Character ROI [AI] |
Definition at line 805 of file legocharactermanager.cpp.
MxResult LegoCharacterManager::Write | ( | LegoStorage * | p_storage | ) |
[AI] Writes the persistent character info data to a storage object.
p_storage | Storage object to serialize to. [AI] |
Serializes out the dynamic properties of LegoActorInfo for each actor, such as sound, move, mood, etc. [AI]
Definition at line 119 of file legocharactermanager.cpp.