61 m_inputManager =
NULL;
62 m_viewLODListManager =
NULL;
63 m_textureContainer =
NULL;
65 m_currentWorld =
NULL;
68 m_characterManager =
NULL;
69 m_plantManager =
NULL;
71 m_animationManager =
NULL;
72 m_buildingManager =
NULL;
73 m_bkgAudioManager =
NULL;
75 m_transitionManager =
NULL;
95 if (m_animationManager) {
96 delete m_animationManager;
97 m_animationManager =
NULL;
100 if (m_characterManager) {
101 delete m_characterManager;
102 m_characterManager =
NULL;
105 if (m_plantManager) {
106 delete m_plantManager;
107 m_plantManager =
NULL;
110 if (m_buildingManager) {
111 delete m_buildingManager;
112 m_buildingManager =
NULL;
115 if (m_textureContainer) {
116 m_textureContainer->
Clear();
117 delete m_textureContainer;
118 m_textureContainer =
NULL;
121 if (m_viewLODListManager) {
122 delete m_viewLODListManager;
123 m_viewLODListManager =
NULL;
126 if (m_inputManager) {
127 delete m_inputManager;
128 m_inputManager =
NULL;
133 if (m_bkgAudioManager) {
134 m_bkgAudioManager->
Stop();
135 delete m_bkgAudioManager;
136 m_bkgAudioManager =
NULL;
139 if (m_transitionManager) {
140 delete m_transitionManager;
141 m_transitionManager =
NULL;
192 delete m_inputManager;
193 m_inputManager =
NULL;
209 if (!m_viewLODListManager || !m_textureContainer || !m_worldList || !m_characterManager || !m_plantManager ||
210 !m_animationManager || !m_buildingManager) {
313 m_worldList->
Append(p_world);
322 if (cursor.
Find(p_world)) {
325 if (m_currentWorld == p_world) {
326 m_currentWorld =
NULL;
347 if ((p_objectId == -1 || world->
GetEntityId() == p_objectId) &&
366 while (cursor.
Next(world)) {
367 if ((p_entityid == -1 || world->
GetEntityId() == p_entityid) &&
387 if (m_currentWorld !=
NULL) {
390 m_currentWorld->
Remove(entity);
392 if (entity->
IsA(
"MxPresenter")) {
413 if (p_name !=
NULL && *p_name !=
'\0' && rois.size() > 0) {
414 for (CompoundObject::const_iterator it = rois.begin(); it != rois.end(); it++) {
416 const char* name = roi->
GetName();
419 if (!strcmpi(name, p_name)) {
438 world = this->m_currentWorld;
442 world->
Add(p_presenter);
451 if (m_currentWorld) {
474 return ::CurrentWorld()->GetCurrPathInfo(p_path, p_value);
481 if (m_worlds[i].m_id == p_worldId) {
482 return m_worlds[i].
m_key;
494 if (m_worlds[i].m_id == p_worldId) {
500 assert(
"Hey, check your code. We do not have this world." ==
NULL);
508 if ((
MxS32) &m_worlds[i] != -4 && !strcmpi(m_worlds[i].GetKey(), p_key)) {
509 return m_worlds[i].
GetId();
542 if (m_bkgAudioManager) {
[AI] Variable for updating camera location and POV (field of view/frustum settings) for navigation an...
[AI] Variable to represent game cursor (pointer) state.
static void RegisterSpawnLocations()
[AI] Static: Registers all known player spawn locations into the global location table.
[AI] Animation manager handling all world and character animation state, loading, and logic for extra...
[AI] Manages LEGO buildings in the world, including their state, animation, switching,...
[AI] Manages reference-counted characters and provides character creation, switching,...
void SetOwnership(LegoBool p_ownership)
Set whether this container owns/deletes its objects (and name strings) on removal/destruction.
void Clear()
Remove and delete all mapped objects; preserves key strings.
Comprehensive persistent game state manager: handles save/load, player selection, area switching,...
void SetCurrentAct(Act p_currentAct)
Sets the current game act.
@ e_act1
Act 1: the first main segment of the game. [AI].
[AI] Object factory for the LEGO Island game, responsible for instantiating all game-specific entitie...
[AI] Central hub singleton for the LEGO Island game engine, managing all core game systems,...
void CloseMainWindow()
[AI] Posts a close (exit) message to the main window handle, triggering shutdown.
MxResult Start(MxDSAction *p_dsAction) override
[AI] Begins executing the specified DSAction/script in the context of the current world/state.
void FUN_1005b4f0(MxBool p_disable, MxU16 p_flags)
[AI] Enables or disables input/3d/screen clearing in a single call, based on flags.
void Resume() override
[AI] Resumes engine/game state and sets default cursor.
static LegoOmni * GetInstance()
[AI] Returns the current LegoOmni singleton pointer, cast from MxOmni.
MxResult RegisterWorlds()
[AI] Registers all builtin worlds/scripts into the world's Atom/registry list (m_worlds).
void RemoveWorld(const MxAtomId &p_atom, MxLong p_objectId)
[AI] Removes worlds by Atom and/or id, deleting matching entries from the world list and freeing reso...
void AddWorld(LegoWorld *p_world)
[AI] Appends a LegoWorld to the active world list, acquiring ownership.
@ c_clearScreen
[AI] When set, clears the display surface. [AI]
@ c_disable3d
[AI] When set, disables 3D rendering. [AI]
@ c_disableInput
[AI] When set, disables input processing. [AI]
LegoWorld * FindWorld(const MxAtomId &p_atom, MxS32 p_entityid)
[AI] Finds and returns the LegoWorld by AtomId and/or entity id.
World
[AI] Identifiers for all unique, script-driven world environments in LEGO Island.
@ e_numWorlds
[AI] Number of worlds (includes undefined, test, or unused). [AI]
@ e_racj
[AI] Jet race area/world. [AI]
@ e_racc
[AI] Car race area/world. [AI]
@ e_bldr
[AI] Race car building. [AI]
@ e_icube
[AI] Information cube building. [AI]
@ e_ireg
[AI] Information registration/building. [AI]
@ e_bldh
[AI] Helicopter building. [AI]
@ e_ielev
[AI] Information elevator. [AI]
@ e_test
[AI] Test world. [AI]
@ e_bldd
[AI] Dune car building. [AI]
@ e_gmain
[AI] Garage. [AI]
@ e_police
[AI] Police station. [AI]
@ e_bldj
[AI] Jet ski building. [AI]
@ e_iisle
[AI] Information Isle room. [AI]
@ e_undefined
[AI] No world specified. [AI]
@ e_imain
[AI] Information main building. [AI]
@ e_hosp
[AI] Hospital. [AI]
@ e_act1
[AI] Act 1 main world. [AI]
LegoROI * FindROI(const char *p_name)
[AI] Finds a top-level LegoROI (region of interest/3D object) by name string.
MxAtomId * GetWorldAtom(LegoOmni::World p_id)
[AI] Looks up and returns the AtomId of a world by its enum id.
void NotifyCurrentEntity(const MxNotificationParam &p_param) override
[AI] Sends notification to the currently active world.
void DeleteWorld(LegoWorld *p_world)
[AI] Deletes (and removes from registry) a LegoWorld, deleting all resources.
static void CreateInstance()
[AI] Allocates and sets up a new LegoOmni singleton instance, replacing the previous one if any.
MxLong Notify(MxParam &p_param) override
[AI] Handles notification messages sent to the engine, including EndAction notifications for quitting...
static MxS32 GetCurrPathInfo(LegoPathBoundary **, MxS32 &)
[AI] Static utility for retrieving current path boundary and info from the current world.
void Destroy() override
[AI] Shuts down and deletes all owned game managers, variable tables, registry lists and Lego subsyst...
MxBool m_unk0x13c
[AI] Unknown flag used in rare start-action cases. [AI]
World GetWorldId(const char *p_key)
[AI] Looks up a World enum id from its string key.
void CreateBackgroundAudio()
[AI] Initializes background audio manager and starts music using global script.
~LegoOmni() override
[AI] Tears down LegoOmni, deleting or unregistering all major owned game systems and registry lists.
LegoOmni()
[AI] Constructs the LegoOmni singleton and initializes all internal pointers to NULL/default state.
void DeleteAction()
[AI] Deletes and clears the current DSAction used for world/entity tracking.
void Pause() override
[AI] Pauses the engine/game state and sets busy cursor.
MxResult Create(MxOmniCreateParam &p_param) override
[AI] Creates and initializes all subsystems for the game, wiring up all managers and attaching Lego-s...
void Init() override
[AI] Performs LegoOmni member and subsystem initialization.
MxBool DoesEntityExist(MxDSAction &p_dsAction) override
[AI] Checks if the entity described by the DSAction does NOT exist in worlds (true if not found,...
const char * GetWorldName(LegoOmni::World p_id)
[AI] Looks up and returns the registered world key for a world id.
MxEntity * AddToWorld(const char *p_id, MxS32 p_entityId, MxPresenter *p_presenter) override
[AI] Adds an entity presenter to the specified world (by id or current).
void DeleteObject(MxDSAction &p_dsAction) override
[AI] Deletes an entity or world referenced by the given DSAction (by object and Atom),...
[AI] Represents a path segment or boundary in the navigation network for actors (vehicles,...
static MxResult Init()
[AI] Static initializer for global controller boundary/edge arrays.
static MxResult Reset()
[AI] Resets (cleans up) global controller boundary/edge arrays allocated by Init().
[AI] Manages the lifecycle, state, and properties for all plant objects (flowers, trees,...
[AI] Represents a Real-time Object Instance enriched with LEGO-specific functionality.
const LegoChar * GetName() const
[AI] Gets this ROI's name.
[AI] Manages 3D sound effects and music playback for LEGO Island, integrating with DirectSound and pr...
Specialized LegoContainer handling LegoTextureInfo objects and their DirectDraw/Direct3D caching.
[AI] Extends the functionality of MxVideoManager to provide LEGO Island–specific video and 3D graphic...
Provides iteration access to a LegoWorldList.
A specialized list for managing pointers to LegoWorld instances.
Represents the active 3D world, holding all entity, animation, sound, path, and ROI objects.
void Remove(MxCore *p_object)
Removes an object from all relevant world-managed lists or sets, and also detaches if needed.
virtual void Add(MxCore *p_object)
Adds an object (entity, presenter, ROI, etc.) to the appropriate world-managed list or set.
MxCore * Find(const char *p_class, const char *p_name)
Finds an object of a given class and name in the world.
[AI] Notification parameter class that contains information about an MxDSAction, used for inter-objec...
[AI] Atomized (unique) string identifier, managed by reference counting.
const char * GetInternal() const
[AI] Returns a pointer to the internal string, or nullptr if not set.
[AI] Background music manager that handles playback, volume, state transitions, and notifications for...
void Stop()
[AI] Immediately stops all background music, clears all actions and presenters, and resets tickle sta...
virtual MxResult Create(MxAtomId &p_script, MxU32 p_frequencyMS)
[AI] Opens the music script (SI file) for streaming and registers this background audio manager as a ...
[AI] Base virtual class for all Mindscape engine (Mx) objects.
virtual MxBool IsA(const char *p_name) const
[AI] Checks whether this object's class type or parents match the given name.
[AI] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
const MxAtomId & GetAtomId()
[AI] Returns a const-reference to the object's atom identifier.
virtual void SetAtomId(MxAtomId p_atomId)
[AI] Sets the atom id for this object instance, used for indexing or lookup.
void SetUnknown24(MxS16 p_unk0x24)
[AI] Sets the unknown field at 0x24 (possibly version/state).
void ClearAtom()
[AI] Clears the atom id, releasing its association.
MxS16 GetUnknown24()
[AI] Returns the unknown 0x24 value (may be data version or usage state). [AI]
void SetObjectId(MxU32 p_objectId)
[AI] Sets the object id (for serialization or lookup).
MxU32 GetObjectId()
[AI] Returns the object id numeric value.
void ClearScreen()
[AI] Fills the current back buffer with black (clears the display area). [AI]
MxEntity is a base class for game entities which are uniquely identified by an integer ID and an Atom...
MxAtomId & GetAtomId()
Returns a reference to the entity AtomId.
MxS32 GetEntityId()
Returns the current entity ID.
MxBool Current(T &p_obj)
[AI]
void Unregister(MxCore *p_listener)
[AI] Removes a previously registered listener and flushes any pending notifications for it.
void Register(MxCore *p_listener)
[AI] Registers a listener object to receive notifications.
MxResult Send(MxCore *p_listener, const MxNotificationParam &p_param)
[AI] Queues a notification to be sent to a specific registered listener.
[AI] Parameter object representing a single notification or event, carrying an identifier and sender ...
void CreateTickleManager(MxBool p_enable)
[AI] Enables or disables the creation of the Tickle Manager subsystem at startup.
void CreateSoundManager(MxBool p_enable)
[AI] Enables or disables the creation of the Sound Manager subsystem at startup.
void CreateVideoManager(MxBool p_enable)
[AI] Enables or disables the creation of the Video Manager subsystem at startup.
void CreateObjectFactory(MxBool p_enable)
[AI] Enables or disables the creation of the Object Factory subsystem at startup.
[AI] Encapsulates parameters required to initialize the core Omni engine.
MxOmniCreateFlags & CreateFlags()
[AI] Access/modify the creation flags.
MxVideoParam & GetVideoParam()
[AI] Access the detailed video parameter structure (for modification).
const HWND GetWindowHandle() const
[AI] Returns the handle to the rendering window.
virtual void Destroy()
[AI] Tears down all engine subsystems, deletes and frees all managed memory.
MxSoundManager * m_soundManager
[AI] Manages sound (WAV, MIDI) output and channels.
virtual MxResult Create(MxOmniCreateParam &p_param)
[AI] Allocates and configures engine subsystems, depending on the provided flags in MxOmniCreateParam...
MxVideoManager * m_videoManager
[AI] Manager for decoding and rendering video resources (FLC, etc.).
static void DestroyInstance()
[AI] Destroys the singleton MxOmni instance and performs memory cleanup.
MxLong Notify(MxParam &p_param) override
[AI] Handles global notifications.
MxNotificationManager * m_notificationManager
[AI] Manages notifications and their distribution to interested clients.
virtual MxResult Start(MxDSAction *p_dsAction)
[AI] Requests the start of a top-level scripted action (from SI).
MxVariableTable * m_variableTable
[AI] Variable table for scripting/in-engine variable storage.
static MxOmni * GetInstance()
[AI] Returns the singleton instance of the MxOmni subsystem coordinator.
MxObjectFactory * m_objectFactory
[AI] Factory object used to instantiate engine objects (presenters, entities) by class name.
virtual void Resume()
[AI] Resumes paused subsystems (timer, sound manager) and clears paused state.
virtual void Init()
[AI] Resets all internal pointers to defaults.
virtual void DeleteObject(MxDSAction &p_dsAction)
[AI] Deletes a world or subsystem object corresponding to an action.
static void SetInstance(MxOmni *p_instance)
[AI] Manually set the static instance of the global engine object.
virtual MxBool DoesEntityExist(MxDSAction &p_dsAction)
[AI] Checks whether an entity (gameplay object) exists by querying the streamer and notification mana...
MxCriticalSection m_criticalSection
[AI] Critical section used for thread-safe engine operations.
virtual void Pause()
[AI] Pauses subsystems that support pausing (timer, sound manager) and sets paused state.
MxTickleManager * m_tickleManager
[AI] Manages list of objects requiring tickle updates each frame/step.
[AI] MxParam serves as a polymorphic base class for parameter passing in event and notification syste...
[AI] Abstract base class for all presenter types in the LEGO Island engine, responsible for managing ...
virtual MxResult Create(MxU32 p_frequencyMS, MxBool p_createThread)
[AI] Initializes and sets up the DirectSound environment.
void FUN_100b98f0(MxDSAction *p_action)
Internal: Delegate stream operation on MxDSAction to a DiskStreamController if present.
[AI] Manages ticking ("tickling") a set of MxCore objects at specified intervals.
[AI] Handles screen transitions and animations (such as dissolve, mosaic, wipe, etc....
virtual MxResult GetDDrawSurfaceFromVideoManager()
[AI] Retrieves the primary DirectDraw surface to render transitions onto, querying via the video mana...
void SetVariable(const char *p_key, const char *p_value)
Sets a variable by key and value, replacing or updating if it exists.
[AI] Represents a key-value variable as used in the variable table for the LEGO Island engine.
virtual MxResult Create(MxVideoParam &p_videoParam, MxU32 p_frequencyMS, MxBool p_createThread)
[AI] Similar to VTable0x28, this launches video with a new DirectDraw instance.
MxDisplaySurface * GetDisplaySurface()
[AI] Returns the display surface used for video output; for direct drawing and palette operations.
[AI] Manages the lifecycle, lookup, and sharing of ViewLODList instances for different ROI names.
[AI] Variable to trigger show/hide operations on in-game 3D objects (ROIs) by parsing visibility comm...
[AI] Variable representing the current player's character, allowing the game to switch the active act...
#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.
void SetAppCursor(Cursor p_cursor)
[AI] Sets the in-game cursor to a specified type.
@ e_cursorBusy
[AI] Busy or loading cursor (e.g., hourglass). [AI]
@ e_cursorArrow
[AI] Standard arrow cursor. [AI]
@ e_cursorNo
[AI] 'Not allowed' cursor. [AI]
MxAtomId * g_isleScript
[AI] Node used in hierarchical scene graphs and animation trees. [AI]
LegoWorld * CurrentWorld()
[AI] Accessor for the currently active LegoWorld instance. [AI]
@ e_lowerCase2
[AI] Alternative or legacy lower case mode, functionally equivalent to e_lowerCase.
#define AUTOLOCK(CS)
[AI] Macro for automatic locking using the MxAutoLock class. This macro instantiates an MxAutoLock ob...
MxStreamer * Streamer()
[AI] Returns the global streamer used for all chunked media streaming (SI file, audio,...
MxNotificationManager * NotificationManager()
[AI] Returns the notification manager for system-wide state/update notifications.
@ c_notificationEndAction
[AI] Indicates the end of an action [AI]
list< ROI * > CompoundObject
[AI] Contains global script AtomId pointers and utility functions for managing script AtomIds in LEGO...
MxAtomId * g_infoscorScript
[AI] Script AtomId for the Info Center scoring/stat script.
MxAtomId * g_act3Script
[AI] Script AtomId for Act 3 (endgame/helicopter chase) scripting.
MxAtomId * g_nocdSourceName
[AI] AtomId for the NoCD patch/script identifier used for copy protection checks.
MxAtomId * g_policeScript
[AI] Script AtomId for the police station script logic.
MxAtomId * g_regbookScript
[AI] Script AtomId for the registration book script (name entry).
MxAtomId * g_jukeboxScript
[AI] Script AtomId for the Jukebox entity/event script.
MxAtomId * g_infodoorScript
[AI] Script AtomId for the Info Center door logic script.
void DestroyScripts()
[AI] Frees and nullifies all global script AtomIds.
MxAtomId * g_infomainScript
[AI] Script AtomId for the main Info Center world/event script.
MxAtomId * g_racecarScript
[AI] Script AtomId for the build/race car SI file.
MxAtomId * g_garageScript
[AI] Script AtomId for the vehicle garage/world logic.
void CreateScripts()
[AI] Allocates and initializes all global script MxAtomIds.
MxAtomId * g_copterScript
[AI] Script AtomId for the helicopter ("copter") build or activity.
MxAtomId * g_jetskiScript
[AI] Script AtomId for the jet ski-related script.
MxAtomId * g_jetraceScript
[AI] Script AtomId for jet racing-related scripts.
MxAtomId * g_elevbottScript
[AI] Script AtomId for the elevator bottom script in Info Center.
MxAtomId * g_testScript
[AI] Script AtomId for test SI data (used in debug/development).
MxAtomId * g_hospitalScript
[AI] Script AtomId for the hospital SI logic.
MxAtomId * g_act2mainScript
[AI] Script AtomId for main script of Act 2 (island event progression).
MxAtomId * g_dunecarScript
[AI] Script AtomId for the dune car building or mission script.
MxAtomId * g_carraceScript
[AI] Script AtomId for the car racing event script.
[AI] Associates a world enum, key, and AtomId for dynamic world lookup, Atom-based registry,...
World GetId()
[AI] Returns world identifier.
MxAtomId * m_atomId
[AI] AtomId pointer for this world's script.
char m_key[20]
[AI] String key for this world (used for script/world lookup).