Isle
Loading...
Searching...
No Matches
misc.cpp
Go to the documentation of this file.
1#include "misc.h"
2
4#include "legoinputmanager.h"
5#include "legomain.h"
6#include "legovideomanager.h"
8#include "mxmisc.h"
9#include "roi/legoroi.h"
10#include "scripts.h"
11
12// GLOBAL: LEGO1 0x100f4c58
14
15// FUNCTION: LEGO1 0x10015700
17{
18 return LegoOmni::GetInstance();
19}
20
21// FUNCTION: LEGO1 0x10015710
23{
25}
26
27// FUNCTION: LEGO1 0x10015720
28// FUNCTION: BETA10 0x100e4807
30{
31 assert(LegoOmni::GetInstance());
33}
34
35// FUNCTION: LEGO1 0x10015730
36// FUNCTION: BETA10 0x100e484e
38{
39 assert(LegoOmni::GetInstance());
41}
42
43// FUNCTION: LEGO1 0x10015740
44// FUNCTION: BETA10 0x100e4895
46{
47 assert(LegoOmni::GetInstance());
49}
50
51// FUNCTION: LEGO1 0x10015750
52// FUNCTION: BETA10 0x100e48dc
54{
55 assert(LegoOmni::GetInstance());
57}
58
59// FUNCTION: LEGO1 0x10015760
60// FUNCTION: BETA10 0x100e492a
62{
63 assert(LegoOmni::GetInstance());
65}
66
67// FUNCTION: LEGO1 0x10015770
68// FUNCTION: BETA10 0x100e4971
70{
71 assert(LegoOmni::GetInstance());
73}
74
75// FUNCTION: LEGO1 0x10015780
76// FUNCTION: BETA10 0x100e49b8
78{
79 assert(LegoOmni::GetInstance());
81}
82
83// FUNCTION: LEGO1 0x10015790
84// FUNCTION: BETA10 0x100e49ff
86{
87 assert(LegoOmni::GetInstance());
89}
90
91// FUNCTION: LEGO1 0x100157a0
92// FUNCTION: BETA10 0x100e4a46
94{
95 assert(LegoOmni::GetInstance());
97}
98
99// FUNCTION: LEGO1 0x100157b0
100// FUNCTION: BETA10 0x100e4a8d
102{
103 assert(LegoOmni::GetInstance());
105}
106
107// FUNCTION: LEGO1 0x100157c0
109{
111}
112
113// FUNCTION: LEGO1 0x100157e0
114// FUNCTION: BETA10 0x100e4b29
116{
117 assert(LegoOmni::GetInstance());
119}
120
121// FUNCTION: LEGO1 0x100157f0
122// FUNCTION: BETA10 0x100e4b70
124{
125 assert(LegoOmni::GetInstance());
127}
128
129// FUNCTION: LEGO1 0x10015800
131{
133}
134
135// FUNCTION: LEGO1 0x10015810
137{
139}
140
141// FUNCTION: LEGO1 0x10015820
142// FUNCTION: BETA10 0x100e4c92
143void FUN_10015820(MxBool p_disable, MxU16 p_flags)
144{
145 assert(LegoOmni::GetInstance());
146 LegoOmni::GetInstance()->FUN_1005b4f0(p_disable, p_flags);
147}
148
149// FUNCTION: LEGO1 0x10015840
150// FUNCTION: BETA10 0x100e4ce4
151LegoROI* FindROI(const char* p_name)
152{
153 assert(LegoOmni::GetInstance());
154 return LegoOmni::GetInstance()->FindROI(p_name);
155}
156
157// FUNCTION: LEGO1 0x10015860
158void SetROIVisible(const char* p_name, MxBool p_visible)
159{
160 LegoROI* roi = FindROI(p_name);
161
162 if (roi) {
163 roi->SetVisibility(p_visible);
164 }
165}
166
167// FUNCTION: LEGO1 0x10015880
168void SetUserActor(LegoPathActor* p_userActor)
169{
170 LegoOmni::GetInstance()->SetUserActor(p_userActor);
171}
172
173// FUNCTION: LEGO1 0x10015890
174// FUNCTION: BETA10 0x100e4d80
176{
178}
179
180// FUNCTION: LEGO1 0x100158b0
182{
184}
185
186// FUNCTION: LEGO1 0x100158c0
187// FUNCTION: BETA10 0x100e4e18
188LegoWorld* FindWorld(const MxAtomId& p_atom, MxS32 p_entityid)
189{
190 assert(LegoOmni::GetInstance());
191 return LegoOmni::GetInstance()->FindWorld(p_atom, p_entityid);
192}
193
194// FUNCTION: LEGO1 0x100158e0
196{
198}
199
200// FUNCTION: LEGO1 0x100158f0
202{
204}
205
206// FUNCTION: LEGO1 0x10015900
207// FUNCTION: BETA10 0x100e4f02
209{
210 assert(LegoOmni::GetInstance());
212}
213
214// FUNCTION: LEGO1 0x10015910
215// FUNCTION: BETA10 0x100e4f4c
217{
218 assert(LegoOmni::GetInstance());
219
220 MxDSAction action;
221 action.SetAtomId(*g_jukeboxScript);
222 action.SetObjectId(p_objectId);
223
225}
226
227// FUNCTION: LEGO1 0x100159c0
228void SetIsWorldActive(MxBool p_isWorldActive)
229{
230 if (!p_isWorldActive) {
232 }
233 g_isWorldActive = p_isWorldActive;
234}
235
236// FUNCTION: LEGO1 0x100159e0
237void DeleteObjects(MxAtomId* p_id, MxS32 p_first, MxS32 p_last)
238{
239 MxDSAction action;
240
241 action.SetAtomId(*p_id);
242 action.SetUnknown24(-2);
243
244 for (MxS32 first = p_first, last = p_last; first <= last; first++) {
245 action.SetObjectId(first);
246 DeleteObject(action);
247 }
248}
Lego3DView * GetLego3DView()
[AI] Returns the encapsulated Lego3DView instance.
ViewManager * GetViewManager()
[AI] Returns the ViewManager responsible for managing scene objects and transformations.
Definition: lego3dview.h:154
[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,...
[AI] Manages control presenters and dispatches notifications for control/input events within the LEGO...
Comprehensive persistent game state manager: handles save/load, player selection, area switching,...
Definition: legogamestate.h:78
[AI] Handles keyboard, mouse, and joystick input for the game.
LegoControlManager * GetControlManager()
[AI] Retrieve the active control manager, responsible for UI and main action mapping.
void SetCamera(LegoCameraController *p_camera)
[AI] Assigns a new camera controller for mouse/look operations.
[AI] Handles user navigation input (keyboard and joystick) and determines avatar movement and directi...
[AI] Central hub singleton for the LEGO Island game engine, managing all core game systems,...
Definition: legomain.h:40
void FUN_1005b4f0(MxBool p_disable, MxU16 p_flags)
[AI] Enables or disables input/3d/screen clearing in a single call, based on flags.
Definition: legomain.cpp:517
LegoCharacterManager * GetCharacterManager()
[AI] Returns character manager, handling population and logic for all in-world characters.
Definition: legomain.h:437
LegoAnimationManager * GetAnimationManager()
[AI] Returns animation manager for managing character/world animations.
Definition: legomain.h:395
LegoBuildingManager * GetBuildingManager()
[AI] Returns building manager (handles in-world structures and their logic).
Definition: legomain.h:401
void SetUserActor(LegoPathActor *p_userActor)
[AI] Sets the user actor pointer (player).
Definition: legomain.h:449
LegoPlantManager * GetPlantManager()
[AI] Returns active plant manager, which tracks in-world plants/objects.
Definition: legomain.h:389
static LegoOmni * GetInstance()
[AI] Returns the current LegoOmni singleton pointer, cast from MxOmni.
Definition: legomain.cpp:305
MxTransitionManager * GetTransitionManager()
[AI] Returns transition manager for handling UI/game state transitions/fades.
Definition: legomain.h:425
LegoGameState * GetGameState()
[AI] Returns the global game state tracker.
Definition: legomain.h:413
MxResult StartActionIfUnknown0x13c(MxDSAction &p_dsAction)
[AI] Starts action if the unknown0x13c member is set; otherwise returns success.
Definition: legomain.h:468
LegoNavController * GetNavController()
[AI] Returns the navigation controller (handles player navigation and camera logic).
Definition: legomain.h:377
LegoInputManager * GetInputManager()
[AI] Returns the input manager.
Definition: legomain.h:353
LegoWorld * FindWorld(const MxAtomId &p_atom, MxS32 p_entityid)
[AI] Finds and returns the LegoWorld by AtomId and/or entity id.
Definition: legomain.cpp:360
LegoROI * FindROI(const char *p_name)
[AI] Finds a top-level LegoROI (region of interest/3D object) by name string.
Definition: legomain.cpp:408
LegoVideoManager * GetVideoManager()
[AI] Returns the active video manager, cast to LegoVideoManager.
Definition: legomain.h:341
LegoTextureContainer * GetTextureContainer()
[AI] Returns the global texture container (all loaded textures).
Definition: legomain.h:359
LegoWorld * GetCurrentWorld()
[AI] Returns the pointer to the currently active world.
Definition: legomain.h:371
MxDSAction & GetCurrentAction()
[AI] Returns the actual DSAction used for the current/pending event.
Definition: legomain.h:431
MxBackgroundAudioManager * GetBackgroundAudioManager()
[AI] Returns handle to the background audio manager (jukebox/music/ambience).
Definition: legomain.h:419
void DeleteAction()
[AI] Deletes and clears the current DSAction used for world/entity tracking.
Definition: legomain.cpp:558
void SetCurrentWorld(LegoWorld *p_currentWorld)
[AI] Sets the current world pointer for global context.
Definition: legomain.h:455
ViewLODListManager * GetViewLODListManager()
[AI] Returns the LOD list manager for handling refcounted LOD data in the scene.
Definition: legomain.h:365
LegoPathActor * GetUserActor()
[AI] Returns the player-controlled ("user") actor.
Definition: legomain.h:383
LegoSoundManager * GetSoundManager()
[AI] Returns the sound manager, cast to LegoSoundManager.
Definition: legomain.h:347
[AI] An actor that moves along a predefined path, supporting boundary transitions,...
Definition: legopathactor.h:32
[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.
Definition: legoroi.h:43
[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...
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.
Definition: legoworld.h:49
[AI] Atomized (unique) string identifier, managed by reference counting.
Definition: mxatom.h:124
[AI] Background music manager that handles playback, volume, state transitions, and notifications for...
MxResult PlayMusic(MxDSAction &p_action, undefined4 p_speed, MxPresenter::TickleState p_tickleState)
[AI] Initiates playback of a new background music action with specified speed and target tickle state...
[AI] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
Definition: mxdsaction.h:17
virtual void SetAtomId(MxAtomId p_atomId)
[AI] Sets the atom id for this object instance, used for indexing or lookup.
Definition: mxdsobject.h:118
void SetUnknown24(MxS16 p_unk0x24)
[AI] Sets the unknown field at 0x24 (possibly version/state).
Definition: mxdsobject.h:151
void SetObjectId(MxU32 p_objectId)
[AI] Sets the object id (for serialization or lookup).
Definition: mxdsobject.h:147
@ e_repeating
[AI] Presentation is repeating (e.g., looping media).
Definition: mxpresenter.h:28
[AI] Handles screen transitions and animations (such as dissolve, mosaic, wipe, etc....
void SetVisibility(unsigned char p_visible)
[AI] Sets the visibility flag to the provided value.
Definition: roi.h:235
[AI] Manages the lifecycle, lookup, and sharing of ViewLODList instances for different ROI names.
Definition: viewlodlist.h:111
[AI] Manages all ViewROI objects that are rendered in a given scene, handles frustum culling,...
Definition: viewmanager.h:16
#define TRUE
Definition: d3drmdef.h:28
#define NULL
[AI] Null pointer value (C/C++ semantics).
Definition: legotypes.h:26
LegoGameState * GameState()
[AI] Accessor for the game's central game state controller. [AI]
Definition: misc.cpp:61
MxResult StartActionIfUnknown0x13c(MxDSAction &p_dsAction)
[AI] Triggers a DSAction if a certain unknown flag (0x13c) is set.
Definition: misc.cpp:175
LegoVideoManager * VideoManager()
[AI] Accessor for the game's LegoVideoManager subsystem. Used for managing 3D/video hardware....
Definition: misc.cpp:29
LegoCharacterManager * CharacterManager()
[AI] Accessor for the character manager, which manages in-game characters/NPCs. [AI]
Definition: misc.cpp:101
LegoAnimationManager * AnimationManager()
[AI] Accessor for the animation manager, which controls Lego character/world animation state....
Definition: misc.cpp:69
void DeleteObjects(MxAtomId *p_id, MxS32 p_first, MxS32 p_last)
[AI] Batch deletes objects, given by atom id, and within the entity id range [p_first,...
Definition: misc.cpp:237
LegoBuildingManager * BuildingManager()
[AI] Accessor for the building manager, handles constructible buildings and structures....
Definition: misc.cpp:123
LegoSoundManager * SoundManager()
[AI] Accessor for the game's LegoSoundManager subsystem from the global LegoOmni instance....
Definition: misc.cpp:22
MxTransitionManager * TransitionManager()
[AI] Accessor for the MxTransitionManager, handling level transitions, fades, and world changes....
Definition: misc.cpp:208
ViewLODListManager * GetViewLODListManager()
[AI] Returns the global ViewLODListManager for view LOD (Level of Detail) resources....
Definition: misc.cpp:136
MxBackgroundAudioManager * BackgroundAudioManager()
[AI] Accessor for the background audio manager. Used for background music and ambient sounds....
Definition: misc.cpp:37
ViewManager * GetViewManager()
[AI] Accessor for the current ViewManager, managing rendering views/cameras. [AI]
Definition: misc.cpp:108
void SetUserActor(LegoPathActor *p_userActor)
[AI] Sets the user-controlled LegoPathActor in the engine.
Definition: misc.cpp:168
MxBool g_isWorldActive
Global variable indicating whether the current LegoWorld is considered active.
Definition: misc.cpp:13
MxDSAction & GetCurrentAction()
[AI] Accessor for the currently running MxDSAction (e.g.
Definition: misc.cpp:195
LegoPlantManager * PlantManager()
[AI] Accessor for the plant manager, handling in-game foliage and plants. [AI]
Definition: misc.cpp:115
LegoWorld * FindWorld(const MxAtomId &p_atom, MxS32 p_entityid)
[AI] Searches for or retrieves a LegoWorld instance based on an atom id and entity id.
Definition: misc.cpp:188
LegoControlManager * ControlManager()
[AI] Accessor for the control manager through the input manager; manages higher-level user/game contr...
Definition: misc.cpp:53
LegoWorld * CurrentWorld()
[AI] Accessor for the currently active LegoWorld instance. [AI]
Definition: misc.cpp:93
void FUN_10015820(MxBool p_disable, MxU16 p_flags)
[AI] Utility for enabling or disabling functionality in LegoOmni based on certain flags.
Definition: misc.cpp:143
void SetCurrentWorld(LegoWorld *p_world)
[AI] Sets the current LegoWorld used for all world/scene logic.
Definition: misc.cpp:201
LegoNavController * NavController()
[AI] Accessor for the navigation controller, managing player/camera navigation. [AI]
Definition: misc.cpp:77
void SetROIVisible(const char *p_name, MxBool p_visible)
[AI] Utility for setting the visibility flag of a named ROI object.
Definition: misc.cpp:158
void PlayMusic(JukeboxScript::Script p_objectId)
[AI] Starts music playback by scripting the background audio manager to play the music piece referenc...
Definition: misc.cpp:216
LegoOmni * Lego()
[AI] Retrieves the global LegoOmni singleton instance, providing access to core subsystems.
Definition: misc.cpp:16
LegoTextureContainer * TextureContainer()
[AI] Accessor for the texture container used for global texture management. [AI]
Definition: misc.cpp:130
LegoPathActor * UserActor()
[AI] Accessor for the user (player-controllable) LegoPathActor. [AI]
Definition: misc.cpp:85
void SetIsWorldActive(MxBool p_isWorldActive)
[AI] Toggles whether the world should be considered active (enables/disables camera/user control etc)...
Definition: misc.cpp:228
LegoInputManager * InputManager()
[AI] Accessor for the input manager, which handles keyboard, mouse, and controller input....
Definition: misc.cpp:45
void DeleteAction()
[AI] Deletes (or cancels) the currently running DSAction/cutscene/event logic. [AI]
Definition: misc.cpp:181
LegoROI * FindROI(const char *p_name)
[AI] Looks up a LegoROI (Real-time Object Instance) by name in the current world or global registry.
Definition: misc.cpp:151
void DeleteObject(MxDSAction &p_dsAction)
[AI] Deletes the specified action object, removing it from the global action list.
Definition: mxmisc.cpp:105
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
MxLong MxResult
[AI]
Definition: mxtypes.h:106
signed int MxS32
[AI]
Definition: mxtypes.h:38
unsigned short MxU16
[AI]
Definition: mxtypes.h:20
[AI] Contains global script AtomId pointers and utility functions for managing script AtomIds in LEGO...
MxAtomId * g_jukeboxScript
[AI] Script AtomId for the Jukebox entity/event script.
Definition: scripts.cpp:70