Isle
Loading...
Searching...
No Matches
legoworld.cpp
Go to the documentation of this file.
1#include "legoworld.h"
2
3#include "anim/legoanim.h"
5#include "legoanimpresenter.h"
10#include "legogamestate.h"
11#include "legoinputmanager.h"
13#include "legonavcontroller.h"
14#include "legoplantmanager.h"
15#include "legosoundmanager.h"
16#include "legoutils.h"
17#include "legovideomanager.h"
18#include "misc.h"
20#include "mxcontrolpresenter.h"
21#include "mxmisc.h"
23#include "mxnotificationparam.h"
24#include "mxticklemanager.h"
25#include "mxutilities.h"
27
33
34// FUNCTION: LEGO1 0x1001ca40
35LegoWorld::LegoWorld() : m_pathControllerList(TRUE)
36{
37 m_startupTicks = e_four;
38 m_cameraController = NULL;
39 m_entityList = NULL;
40 m_cacheSoundList = NULL;
41 m_destroyed = FALSE;
42 m_hideAnim = NULL;
43 m_worldStarted = FALSE;
44
46}
47
48// FUNCTION: LEGO1 0x1001dfa0
50{
52
55}
56
57// FUNCTION: LEGO1 0x1001e0b0
59{
60 MxEntity::Create(p_dsAction);
61
63
64 if (!m_entityList) {
65 return FAILURE;
66 }
67
69
70 if (!m_cacheSoundList) {
71 return FAILURE;
72 }
73
74 if (!VTable0x54()) {
75 return FAILURE;
76 }
77
78 if (p_dsAction.GetFlags() & MxDSAction::c_enabled) {
79 if (CurrentWorld()) {
81 }
82
83 SetCurrentWorld(this);
85 }
86
89 return SUCCESS;
90}
91
92// FUNCTION: LEGO1 0x1001e9d0
93// FUNCTION: BETA10 0x100d99ea
94void LegoWorld::Destroy(MxBool p_fromDestructor)
95{
97
98 if (CurrentWorld() == this) {
101 }
102
104
105 if (m_cameraController) {
106 delete m_cameraController;
108 }
109
110 MxPresenterListCursor animPresenterCursor(&m_animPresenters);
111 MxPresenter* presenter;
112
113 while (animPresenterCursor.First(presenter)) {
114 animPresenterCursor.Detach();
115
116 MxDSAction* action = presenter->GetAction();
117 if (action) {
118 if (presenter->IsA("LegoLocomotionAnimPresenter")) {
119 LegoLocomotionAnimPresenter* animPresenter = (LegoLocomotionAnimPresenter*) presenter;
120
121 animPresenter->DecrementUnknown0xd4();
122 if (animPresenter->GetUnknown0xd4() == 0) {
124 presenter->EndAction();
125 }
126 }
127 else {
129 presenter->EndAction();
130 }
131 }
132 }
133
134 while (!m_set0xa8.empty()) {
135 MxCoreSet::iterator it = m_set0xa8.begin();
136 MxCore* object = *it;
137 m_set0xa8.erase(it);
138
139 if (object->IsA("MxPresenter")) {
140 MxPresenter* presenter = (MxPresenter*) object;
141 MxDSAction* action = presenter->GetAction();
142
143 if (action) {
145 presenter->EndAction();
146 }
147 }
148 else {
149 delete object;
150 }
151 }
152
153 MxPresenterListCursor controlPresenterCursor(&m_controlPresenters);
154
155 while (controlPresenterCursor.First(presenter)) {
156 controlPresenterCursor.Detach();
157
158 MxDSAction* action = presenter->GetAction();
159 if (action) {
161 presenter->EndAction();
162 }
163 }
164
165 if (m_worldId != LegoOmni::e_undefined && m_set0xd0.empty()) {
168 }
169
170 if (m_entityList) {
172 LegoEntity* entity;
173
174 while (cursor.First(entity)) {
175 cursor.Detach();
176
177 if (!(entity->GetFlags() & LegoEntity::c_managerOwned)) {
178 delete entity;
179 }
180 }
181
182 delete m_entityList;
184 }
185
186 if (m_cacheSoundList) {
188 LegoCacheSound* sound;
189
190 while (cursor.First(sound)) {
191 cursor.Detach();
193 }
194
195 delete m_cacheSoundList;
197 }
198
199 while (!m_roiList.empty()) {
200 LegoROI* roi = m_roiList.front();
201 m_roiList.pop_front();
202 delete roi;
203 }
204
205 if (!p_fromDestructor) {
207 }
208}
209
210// FUNCTION: LEGO1 0x1001f5e0
211// FUNCTION: BETA10 0x100d9f5f
213{
214 MxLong result = 0;
215
216 switch (((MxNotificationParam&) p_param).GetNotification()) {
218 MxPresenter* presenter = (MxPresenter*) ((MxEndActionNotificationParam&) p_param).GetSender();
219 Remove(presenter);
220 result = 1;
221 break;
222 }
224 TickleManager()->RegisterClient(this, 100);
225 break;
226 }
227
228 return result;
229}
230
231// FUNCTION: LEGO1 0x1001f630
232// FUNCTION: BETA10 0x100d9fc2
234{
235 MxBool success = FALSE;
236
237 if (!VideoManager()) {
238 goto done;
239 }
241 goto done;
242 }
244 goto done;
245 }
246
248 VideoManager()->GetVideoParam().GetRect().GetWidth(),
249 VideoManager()->GetVideoParam().GetRect().GetHeight()
250 );
251
252 success = TRUE;
253
254done:
255 if (!success) {
256 if (m_cameraController) {
257 delete m_cameraController;
259 }
260 }
261
262 return m_cameraController;
263}
264
265// FUNCTION: LEGO1 0x1001f720
266// FUNCTION: BETA10 0x100da24b
268 LegoPathActor* p_actor,
269 const char* p_name,
270 MxS32 p_src,
271 float p_srcScale,
272 MxS32 p_dest,
273 float p_destScale
274)
275{
277 LegoPathController* controller;
278
279 while (cursor.Next(controller)) {
280 if (controller->PlaceActor(p_actor, p_name, p_src, p_srcScale, p_dest, p_destScale) == SUCCESS) {
281 return SUCCESS;
282 }
283 }
284
285 return FAILURE;
286}
287
288// FUNCTION: LEGO1 0x1001fa70
290{
292 LegoPathController* controller;
293
294 while (cursor.Next(controller)) {
295 if (controller->PlaceActor(p_actor) == SUCCESS) {
296 return SUCCESS;
297 }
298 }
299
300 return FAILURE;
301}
302
303// FUNCTION: LEGO1 0x1001fb70
305 LegoPathActor* p_actor,
306 LegoAnimPresenter* p_presenter,
307 Vector3& p_position,
308 Vector3& p_direction
309)
310{
312 LegoPathController* controller;
313
314 while (cursor.Next(controller)) {
315 if (controller->PlaceActor(p_actor, p_presenter, p_position, p_direction) == SUCCESS) {
316 return SUCCESS;
317 }
318 }
319
320 return FAILURE;
321}
322
323// FUNCTION: LEGO1 0x1001fc80
324// FUNCTION: BETA10 0x100da4bf
326{
328 LegoPathController* controller;
329
330 while (cursor.Next(controller)) {
331 if (controller->RemoveActor(p_actor) == SUCCESS) {
332 break;
333 }
334 }
335}
336
337// FUNCTION: BETA10 0x100da560
339{
341 LegoPathController* controller;
342
343 while (cursor.Next(controller)) {
344 if (controller->ActorExists(p_actor) == TRUE) {
345 return TRUE;
346 }
347 }
348
349 return FALSE;
350}
351
352// FUNCTION: LEGO1 0x1001fda0
353// FUNCTION: BETA10 0x100da621
355{
357 LegoPathController* controller;
358
359 while (cursor.Next(controller)) {
360 controller->FUN_100468f0(p_presenter);
361 }
362}
363
364// FUNCTION: LEGO1 0x1001fe90
365// FUNCTION: BETA10 0x100da6b5
367{
369 LegoPathController* controller;
370
371 while (cursor.Next(controller)) {
372 controller->FUN_10046930(p_presenter);
373 }
374}
375
376// FUNCTION: LEGO1 0x1001ff80
378{
379 p_controller->FUN_10046bb0(this);
380 m_pathControllerList.Append(p_controller);
381}
382
383// FUNCTION: LEGO1 0x10020020
384// FUNCTION: BETA10 0x100da77c
386{
388 LegoPathController* controller;
389
390 while (cursor.Next(controller)) {
391 LegoPathBoundary* boundary = controller->GetPathBoundary(p_name);
392
393 if (boundary) {
394 return boundary;
395 }
396 }
397
398 return NULL;
399}
400
401// FUNCTION: LEGO1 0x10020120
403{
405 LegoPathController* controller;
406
407 cursor.Next(controller);
408
409 if (!controller) {
410 return FAILURE;
411 }
412
413 return controller->FUN_10046b30(*p_boundaries, p_numL);
414}
415
416// FUNCTION: LEGO1 0x10020220
417// FUNCTION: BETA10 0x100da90b
418void LegoWorld::Add(MxCore* p_object)
419{
420 if (p_object == NULL || p_object->IsA("LegoWorld") || p_object->IsA("LegoWorldPresenter")) {
421 return;
422 }
423
424#ifndef BETA10
425 if (p_object->IsA("LegoAnimPresenter")) {
426 if (!strcmpi(((LegoAnimPresenter*) p_object)->GetAction()->GetObjectName(), "ConfigAnimation")) {
427 FUN_1003e050((LegoAnimPresenter*) p_object);
428 ((LegoAnimPresenter*) p_object)
429 ->GetAction()
430 ->SetDuration(((LegoAnimPresenter*) p_object)->GetAnimation()->GetDuration());
431 }
432 }
433#endif
434
435 if (p_object->IsA("MxControlPresenter")) {
437
438 if (cursor.Find((MxPresenter*) p_object)) {
439 assert(0);
440 return;
441 }
442
444 }
445 else if (p_object->IsA("MxEntity")) {
447
448 if (cursor.Find((LegoEntity*) p_object)) {
449 assert(0);
450 return;
451 }
452
453 m_entityList->Append((LegoEntity*) p_object);
454 }
455 else if (p_object->IsA("LegoLocomotionAnimPresenter") || p_object->IsA("LegoHideAnimPresenter") || p_object->IsA("LegoLoopingAnimPresenter")) {
457
458 if (cursor.Find((MxPresenter*) p_object)) {
459 assert(0);
460 return;
461 }
462
463 ((MxPresenter*) p_object)->SendToCompositePresenter(Lego());
464 m_animPresenters.Append(((MxPresenter*) p_object));
465
466 if (p_object->IsA("LegoHideAnimPresenter")) {
467 m_hideAnim = (LegoHideAnimPresenter*) p_object;
468 }
469 }
470#ifndef BETA10
471 else if (p_object->IsA("LegoCacheSound")) {
473
474 if (cursor.Find((LegoCacheSound*) p_object)) {
475 assert(0); // ?
476 return;
477 }
478
480 }
481#endif
482 else {
483 MxCoreSet::iterator it = m_set0xa8.find(p_object);
484 if (it == m_set0xa8.end()) {
485#ifdef BETA10
486 if (p_object->IsA("MxPresenter")) {
487 assert(static_cast<MxPresenter*>(p_object)->GetAction());
488 }
489#endif
490
491 m_set0xa8.insert(p_object);
492 }
493 else {
494 assert(0);
495 }
496 }
497
498 if (m_set0xd0.size() != 0 && p_object->IsA("MxPresenter")) {
499 if (((MxPresenter*) p_object)->IsEnabled()) {
500 ((MxPresenter*) p_object)->Enable(FALSE);
501 m_set0xd0.insert(p_object);
502 }
503 }
504}
505
506// FUNCTION: LEGO1 0x10020f10
507// FUNCTION: BETA10 0x100dad2a
509{
510 MxCoreSet::iterator it;
511
512 if (p_object == NULL) {
513 return;
514 }
515
516 if (p_object->IsA("MxControlPresenter")) {
518
519 if (cursor.Find((MxControlPresenter*) p_object)) {
520 cursor.Detach();
521 ((MxControlPresenter*) p_object)->GetAction()->SetOrigin(Lego());
522 ((MxControlPresenter*) p_object)->VTable0x68(TRUE);
523 }
524 }
525 else if (p_object->IsA("LegoLocomotionAnimPresenter") || p_object->IsA("LegoHideAnimPresenter") || p_object->IsA("LegoLoopingAnimPresenter")) {
527
528 if (cursor.Find((MxPresenter*) p_object)) {
529 cursor.Detach();
530 }
531
532 if (p_object->IsA("LegoHideAnimPresenter")) {
534 }
535 }
536 else if (p_object->IsA("MxEntity")) {
537 if (p_object->IsA("LegoPathActor")) {
538 RemoveActor((LegoPathActor*) p_object);
539 }
540
541 if (m_entityList) {
543
544 if (cursor.Find((LegoEntity*) p_object)) {
545 cursor.Detach();
546 }
547 }
548 }
549#ifndef BETA10
550 else if (p_object->IsA("LegoCacheSound")) {
552
553 if (cursor.Find((LegoCacheSound*) p_object)) {
554 cursor.Detach();
555 }
556 }
557#endif
558 else {
559 it = m_set0xa8.find(p_object);
560 if (it != m_set0xa8.end()) {
561 m_set0xa8.erase(it);
562 }
563 }
564
565 it = m_set0xd0.find(p_object);
566 if (it != m_set0xd0.end()) {
567 m_set0xd0.erase(it);
568 }
569}
570
571// FUNCTION: LEGO1 0x100213a0
572// FUNCTION: BETA10 0x100db027
573MxCore* LegoWorld::Find(const char* p_class, const char* p_name)
574{
575 if (!strcmp(p_class, "MxControlPresenter")) {
577 MxPresenter* presenter;
578
579 while (cursor.Next(presenter)) {
580 if (!strcmp(presenter->GetAction()->GetObjectName(), p_name)) {
581 return presenter;
582 }
583 }
584
585 return NULL;
586 }
587
588 if (!strcmp(p_class, "MxEntity")) {
590 LegoEntity* entity;
591
592 while (cursor.Next(entity)) {
593 if (!p_name) {
594 return entity;
595 }
596
597 LegoROI* roi = entity->GetROI();
598 if (roi && !strcmpi(roi->GetName(), p_name)) {
599 return entity;
600 }
601 }
602
603 return NULL;
604 }
605
606 if (!strcmp(p_class, "LegoAnimPresenter")) {
608 MxPresenter* presenter;
609
610 while (cursor.Next(presenter)) {
611 if (!strcmpi(((LegoAnimPresenter*) presenter)->GetActionObjectName(), p_name)) {
612 return presenter;
613 }
614 }
615
616 return NULL;
617 }
618
619 for (MxCoreSet::iterator i = m_set0xa8.begin(); i != m_set0xa8.end(); i++) {
620 if ((*i)->IsA(p_class) && (*i)->IsA("MxPresenter")) {
621 assert(((MxPresenter*) (*i))->GetAction());
622
623 if (!strcmp(((MxPresenter*) (*i))->GetAction()->GetObjectName(), p_name)) {
624 return *i;
625 }
626 }
627 }
628
629 return NULL;
630}
631
632// FUNCTION: LEGO1 0x10021790
633// FUNCTION: BETA10 0x100db3de
634MxCore* LegoWorld::Find(const MxAtomId& p_atom, MxS32 p_entityId)
635{
637 LegoEntity* entity;
638
639 while (entityCursor.Next(entity)) {
640 if (entity->GetAtomId() == p_atom && entity->GetEntityId() == p_entityId) {
641 return entity;
642 }
643 }
644
645 MxPresenterListCursor controlPresenterCursor(&m_controlPresenters);
646 MxPresenter* presenter;
647
648 while (controlPresenterCursor.Next(presenter)) {
649 MxDSAction* action = presenter->GetAction();
650
651 if (action->GetAtomId() == p_atom && action->GetObjectId() == p_entityId) {
652 return presenter;
653 }
654 }
655
656 MxPresenterListCursor animPresenterCursor(&m_animPresenters);
657
658 while (animPresenterCursor.Next(presenter)) {
659 MxDSAction* action = presenter->GetAction();
660
661 if (action && action->GetAtomId() == p_atom && action->GetObjectId() == p_entityId) {
662 return presenter;
663 }
664 }
665
666 for (MxCoreSet::iterator it = m_set0xa8.begin(); it != m_set0xa8.end(); it++) {
667 MxCore* core = *it;
668
669 if (core->IsA("MxPresenter")) {
670 MxPresenter* presenter = (MxPresenter*) *it;
671 MxDSAction* action = presenter->GetAction();
672
673 if (action->GetAtomId() == p_atom && action->GetObjectId() == p_entityId) {
674 return *it;
675 }
676 }
677 }
678
679 return NULL;
680}
681
682// FUNCTION: LEGO1 0x10021a70
683// FUNCTION: BETA10 0x100db758
685{
686 MxCoreSet::iterator it;
687
688 if (p_enable && m_set0xd0.size() != 0) {
689 if (CurrentWorld() == this) {
690 return;
691 }
692 if (CurrentWorld()) {
695
697 LegoEntity* entity;
698
699 while (cursor.Next(entity)) {
700 assert(entity->GetROI());
701
702 if (entity->GetROI()) {
703#ifndef BETA10
704 entity->GetROI()->SetEntity(entity);
705#endif
706 GetViewManager()->Add(entity->GetROI());
707 }
708 }
709 }
710
711 while (m_set0xd0.size() != 0) {
712 it = m_set0xd0.begin();
713
714 if ((*it)->IsA("MxPresenter")) {
715 ((MxPresenter*) *it)->Enable(TRUE);
716 }
717 else if ((*it)->IsA("LegoPathController")) {
718 ((LegoPathController*) *it)->Enable(TRUE);
719 }
720
721 m_set0xd0.erase(it);
722 }
723
724 SetCurrentWorld(this);
727
728 if (m_cameraController) {
731 }
732
738 }
739
740 GameState()->ResetROI();
741#ifndef BETA10
743#endif
744 }
745 else if (!p_enable && m_set0xd0.size() == 0) {
746 MxPresenter* presenter;
747 LegoPathController* controller;
748 LegoPathActor* actor = UserActor();
749
750 if (actor) {
751 RemoveActor(actor);
752 }
753
755 m_set0xd0.insert(this);
756
759#ifndef BETA10
761#endif
762 }
763
764 MxPresenterListCursor controlPresenterCursor(&m_controlPresenters);
765
766 while (controlPresenterCursor.Next(presenter)) {
767 if (presenter->IsEnabled()) {
768 m_set0xd0.insert(presenter);
769 presenter->Enable(FALSE);
770 }
771 }
772
773 for (MxCoreSet::iterator it = m_set0xa8.begin(); it != m_set0xa8.end(); it++) {
774 if ((*it)->IsA("LegoActionControlPresenter") ||
775 ((*it)->IsA("MxPresenter") && ((MxPresenter*) *it)->IsEnabled())) {
776 m_set0xd0.insert(*it);
777 ((MxPresenter*) *it)->Enable(FALSE);
778 }
779 }
780
781 if (CurrentWorld() && CurrentWorld() == this) {
784 }
785
786 if (InputManager()->GetCamera() == m_cameraController) {
788 }
789
790 if (m_cameraController) {
792
795 }
796 }
797
799
800 while (pathControllerCursor.Next(controller)) {
801 controller->Enable(FALSE);
802 m_set0xd0.insert(controller);
803 }
804
806 }
807}
808
809// FUNCTION: LEGO1 0x10022080
811{
812 if (!m_worldStarted) {
813 switch (m_startupTicks) {
814 case e_start:
817 ReadyWorld();
818 return TRUE;
819 case e_two:
820 if (PresentersPending() == TRUE) {
821 break;
822 }
823 default:
825 }
826 }
827
828 return TRUE;
829}
830
831// FUNCTION: LEGO1 0x100220e0
833{
834 MxPresenterListCursor controlPresenterCursor(&m_controlPresenters);
835 MxPresenter* presenter;
836
837 while (controlPresenterCursor.Next(presenter)) {
838 if (presenter->IsEnabled() && !presenter->HasTickleStatePassed(MxPresenter::e_starting)) {
839 return TRUE;
840 }
841 }
842
843 MxPresenterListCursor animPresenterCursor(&m_animPresenters);
844
845 while (animPresenterCursor.Next(presenter)) {
846 if (presenter->IsEnabled()) {
847 if (presenter->IsA("LegoLocomotionAnimPresenter")) {
849 return TRUE;
850 }
851 }
852 else {
854 return TRUE;
855 }
856 }
857 }
858 }
859
860 for (MxCoreSet::iterator it = m_set0xa8.begin(); it != m_set0xa8.end(); it++) {
861 if ((*it)->IsA("MxPresenter")) {
862 presenter = (MxPresenter*) *it;
863
864 if (presenter->IsEnabled() && !presenter->HasTickleStatePassed(MxPresenter::e_starting)) {
865 return TRUE;
866 }
867 }
868 }
869
870 return FALSE;
871}
872
873// FUNCTION: LEGO1 0x10022340
875{
877}
[AI] Handles playback and synchronization of animated LEGO objects, including variable substitution,...
void Reset(MxBool p_und)
[AI] Resets all internal state; optionally resets animation state too.
void FUN_10061010(MxBool p_und)
[AI] Cancels all camera/transition animations and resets camera after completion.
MxResult LoadWorldInfo(LegoOmni::World p_worldId)
[AI] Loads all world animation and extra info.
void Resume()
[AI] Resumes animation manager from suspension, restoring all previously suspended state.
void Reset()
[AI] Removes all building-state links to world entities and cancels/cleans any scheduled animation en...
void LoadWorldInfo()
[AI] Loads/creates building models for the current world, sets up variants appropriately for current ...
[AI] Cursor/iterator class for traversing a LegoCacheSoundList.
[AI] Specialized pointer list for managing a collection of LegoCacheSound objects,...
void Destroy(LegoCacheSound *&p_sound)
[AI] Destroys (deletes and removes) the specified sound object from all tracking.
Sound cache object managing DirectSound buffers and 3D positioning for preloaded sound data.
Definition: legocachsound.h:17
Camera controller for 3D scenes, handles interactive camera manipulation and view transformation.
virtual MxResult Create()
Registers the camera controller with input manager and initializes state with current view.
void FUN_10028df0(MxPresenterList *p_presenterList)
[AI] Assigns the active presenter list to this control manager.
[AI] Cursor class for iterating through a LegoEntityList.
[AI] A strongly typed list for holding LegoEntity pointers.
[AI] Represents an entity that can be placed and managed in the LEGO Island world.
Definition: legoentity.h:16
LegoROI * GetROI()
[AI] Gets the ROI (Realtime Object Instance) associated with this entity. [AI]
Definition: legoentity.h:161
virtual void Destroy(MxBool p_fromDestructor)
[AI] Cleans up the entity, detaching ROI and releasing references.
Definition: legoentity.cpp:94
MxU8 GetFlags()
[AI] Returns the value of the flag byte. [AI]
Definition: legoentity.h:155
@ c_managerOwned
[AI] Indicates this entity is managed/owned by an entity manager [AI]
Definition: legoentity.h:30
void ResetROI()
Re-applies the current actor's ROI to the 3D world (remove/add for update). [AI].
[AI] Presenter class responsible for controlling animations that hide or show actors based on animati...
void ClearCamera()
[AI] Remove any assigned camera controller, disabling camera navigation responses....
void UnRegister(MxCore *)
[AI] Unregister a previously registered recipient so it will no longer receive input notifications.
void SetCamera(LegoCameraController *p_camera)
[AI] Assigns a new camera controller for mouse/look operations.
void Register(MxCore *)
[AI] Register a core object as a recipient for keyboard events; safe for concurrent multi-threading.
[AI] Specialized presenter class for handling locomotion animation playback and state in the LEGO Isl...
void DecrementUnknown0xd4()
[AI] Decrements the reference/lightweight counter controlling an internal streaming/cleanup state.
undefined2 GetUnknown0xd4()
[AI] Accessor for m_unk0xd4, a lightweight counter used internally to gate certain state transitions.
void SetNavController(LegoNavController *p_navController)
[AI] Sets the navigation controller.
Definition: legomain.h:443
@ e_undefined
[AI] No world specified. [AI]
Definition: legomain.h:58
void SetCurrentWorld(LegoWorld *p_currentWorld)
[AI] Sets the current world pointer for global context.
Definition: legomain.h:455
[AI] An actor that moves along a predefined path, supporting boundary transitions,...
Definition: legopathactor.h:32
[AI] Represents a path segment or boundary in the navigation network for actors (vehicles,...
Cursor/iterator for traversing a LegoPathControllerList.
[AI] Manager for controlling actors' movement along predefined geometric paths.
MxBool ActorExists(LegoPathActor *p_actor)
[AI] Checks whether an actor is contained in the controller's actor set.
void FUN_100468f0(LegoAnimPresenter *p_presenter)
[AI] Processes all boundaries except those with bit3 set, invoking FUN_10057fe0 for the provided anim...
MxResult FUN_10046b30(LegoPathBoundary *&p_boundaries, MxS32 &p_numL)
[AI] Provides current array of boundaries and count as output parameters, for external queries.
LegoPathBoundary * GetPathBoundary(const char *p_name)
[AI] Searches for a path boundary by name among owned boundaries.
MxResult RemoveActor(LegoPathActor *p_actor)
[AI] Removes an actor from the controller, detaches it from controlled boundaries,...
MxResult PlaceActor(LegoPathActor *p_actor, const char *p_name, MxS32 p_src, float p_srcScale, MxS32 p_dest, float p_destScale)
[AI] Places an actor on a boundary at given source/destination edge indices, commonly for track segme...
void Enable(MxBool p_enable)
[AI] Enables or disables the controller's registration with the tickle manager, controlling per-frame...
void FUN_10046bb0(LegoWorld *p_world)
[AI] Assigns the provided world pointer to all struct triggers owned by this path controller.
void FUN_10046930(LegoAnimPresenter *p_presenter)
[AI] Invokes FUN_100586e0 for each boundary, with the provided animation presenter.
void LoadWorldInfo(LegoOmni::World p_worldId)
[AI] Loads all plant objects/entities for the requested world, instantiates requisite ROIs and entiti...
void Reset(LegoOmni::World p_worldId)
[AI] Completely resets (removes) all plant objects for the supplied world.
LegoNavController * GetNavController()
[AI] Accessor for the navigation controller associated with this point-of-view controller.
void OnViewSize(int p_width, int p_height)
[AI] Updates the controller's internal state for a view size change, such as resizing the 3D viewport...
[AI] Represents a Real-time Object Instance enriched with LEGO-specific functionality.
Definition: legoroi.h:43
void SetEntity(LegoEntity *p_entity)
[AI] Associates a LegoEntity with this ROI (typically called by parent entity/logic).
Definition: legoroi.h:305
const LegoChar * GetName() const
[AI] Gets this ROI's name.
Definition: legoroi.h:287
LegoCacheSoundManager * GetCacheSoundManager()
[AI] Returns the cache sound manager used to cache and reuse sound effects.
Represents the active 3D world, holding all entity, animation, sound, path, and ROI objects.
Definition: legoworld.h:49
void Remove(MxCore *p_object)
Removes an object from all relevant world-managed lists or sets, and also detaches if needed.
Definition: legoworld.cpp:508
virtual void ReadyWorld()
Called when the world is ready to be used—typically for custom scene setup after startup.
Definition: legoworld.cpp:874
LegoOmni::World m_worldId
Currently assigned world id, corresponding to an enum in LegoOmni.
Definition: legoworld.h:373
MxResult GetCurrPathInfo(LegoPathBoundary **p_boundaries, MxS32 &p_numL)
Gets information about the currently active path and boundaries.
Definition: legoworld.cpp:402
LegoCacheSoundList * m_cacheSoundList
List of cached sounds for faster access during this world's lifetime.
Definition: legoworld.h:342
MxResult PlaceActor(LegoPathActor *p_actor, const char *p_name, MxS32 p_src, float p_srcScale, MxS32 p_dest, float p_destScale)
Places an actor along a path, from source to destination, using named references and scaling.
Definition: legoworld.cpp:267
LegoHideAnimPresenter * m_hideAnim
Animation presenter for ROI hide (vanish, fade, etc.) sequences.
Definition: legoworld.h:378
MxBool PresentersPending()
Checks if there are any presenters pending to fully enter their tickle (animation) state.
Definition: legoworld.cpp:832
LegoPathControllerList m_pathControllerList
List of all path controllers currently managing pathing in this world.
Definition: legoworld.h:322
MxCoreSet m_set0xd0
Set of currently paused/disconnected objects when world is disabled.
Definition: legoworld.h:363
virtual void Add(MxCore *p_object)
Adds an object (entity, presenter, ROI, etc.) to the appropriate world-managed list or set.
Definition: legoworld.cpp:418
virtual void Enable(MxBool p_enable)
Enables or disables (pauses) the world and its main components.
Definition: legoworld.cpp:684
MxBool ActorExists(LegoPathActor *p_actor)
Determines if an actor already exists in any controller in this world.
Definition: legoworld.cpp:338
MxResult Tickle() override
Main world tick/update, especially manages startup countdown.
Definition: legoworld.cpp:810
LegoPathBoundary * FindPathBoundary(const char *p_name)
Finds a path boundary in all path controllers by name.
Definition: legoworld.cpp:385
MxCoreSet m_set0xa8
Set of 'auxiliary' objects, including presenters, that aren't core entity or animation,...
Definition: legoworld.h:352
void FUN_1001fda0(LegoAnimPresenter *p_presenter)
Forwards a presenter to all path controllers to perform a custom action (possibly hide,...
Definition: legoworld.cpp:354
list< LegoROI * > m_roiList
List of all visible LegoROI objects in the world, used for rendering and selection.
Definition: legoworld.h:368
LegoCameraController * m_cameraController
Camera controller for world's main view.
Definition: legoworld.h:332
MxS16 m_startupTicks
Current world startup tick countdown—controls staged world startup logic.
Definition: legoworld.h:383
MxBool m_worldStarted
Indicates if the world has successfully started and is considered active.
Definition: legoworld.h:388
@ e_start
Start tick, world is ready to be started. [AI].
Definition: legoworld.h:55
@ e_two
Countdown tick 2. [AI].
Definition: legoworld.h:57
void Destroy(MxBool p_fromDestructor) override
Destroys the world and its contents, optionally called from the destructor.
Definition: legoworld.cpp:94
MxBool m_destroyed
Indicates if the world has been destroyed or is pending destruction.
Definition: legoworld.h:347
void FUN_1001fe90(LegoAnimPresenter *p_presenter)
Forwards a presenter to all path controllers for another custom or state change action.
Definition: legoworld.cpp:366
MxCore * Find(const char *p_class, const char *p_name)
Finds an object of a given class and name in the world.
Definition: legoworld.cpp:573
LegoEntityList * m_entityList
List of all main world entities, such as actors and objects.
Definition: legoworld.h:337
MxLong Notify(MxParam &p_param) override
Notification callback responding to registered events such as EndAction and NewPresenter.
Definition: legoworld.cpp:212
virtual LegoCameraController * VTable0x54()
Initializes and returns the camera controller for the world; may create it on-demand.
Definition: legoworld.cpp:233
MxPresenterList m_animPresenters
List of active animation presenters (anims, hide/show, looping, etc.).
Definition: legoworld.h:327
void RemoveActor(LegoPathActor *p_actor)
Removes an actor from all known path controllers.
Definition: legoworld.cpp:325
MxResult Create(MxDSAction &p_dsAction) override
Initializes the world using an action, creating entity and sound lists, and camera controller.
Definition: legoworld.cpp:58
MxPresenterList m_controlPresenters
List of control presenters (UI, input, cutscene control, etc.).
Definition: legoworld.h:357
void AddPath(LegoPathController *p_controller)
Adds a path controller to the world and calls its initialization with this.
Definition: legoworld.cpp:377
~LegoWorld() override
Cleans up the world, destroying all held entities, presenters, and controllers.
Definition: legoworld.cpp:49
[AI] Atomized (unique) string identifier, managed by reference counting.
Definition: mxatom.h:124
[AI] Presenter for UI controls, supporting toggles, grids, and "map" style controls with multiple int...
[AI] Base virtual class for all Mindscape engine (Mx) objects.
Definition: mxcore.h:15
virtual MxBool IsA(const char *p_name) const
[AI] Checks whether this object's class type or parents match the given name.
Definition: mxcore.h:46
[AI] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
Definition: mxdsaction.h:17
MxU32 GetFlags()
[AI] Returns the flag field for this action (bitmask).
Definition: mxdsaction.h:177
@ c_world
[AI] Action is described in world-space coordinates [AI]
Definition: mxdsaction.h:27
@ c_enabled
[AI] Action is currently enabled [AI]
Definition: mxdsaction.h:25
const char * GetObjectName() const
[AI] Returns the object name string.
Definition: mxdsobject.h:127
const MxAtomId & GetAtomId()
[AI] Returns a const-reference to the object's atom identifier.
Definition: mxdsobject.h:133
MxU32 GetObjectId()
[AI] Returns the object id numeric value.
Definition: mxdsobject.h:130
[AI] Notification parameter marking the end of an action, specialization of MxActionNotificationParam...
MxAtomId & GetAtomId()
Returns a reference to the entity AtomId.
Definition: mxentity.h:98
MxS32 GetEntityId()
Returns the current entity ID.
Definition: mxentity.h:93
virtual MxResult Create(MxS32 p_entityId, const MxAtomId &p_atomId)
Initializes the entity from a given entity ID and AtomId.
Definition: mxentity.h:69
MxBool Next()
[AI]
void Detach()
[AI]
MxBool Find(T p_obj)
[AI]
MxBool First(T &p_obj)
[AI]
void DeleteAll()
[AI]
void Append(T p_obj)
[AI]
Definition: mxlist.h:100
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.
[AI] Parameter object representing a single notification or event, carrying an identifier and sender ...
[AI] MxParam serves as a polymorphic base class for parameter passing in event and notification syste...
Definition: mxparam.h:7
[AI] Cursor/iterator for traversing an MxPresenterList.
[AI] Abstract base class for all presenter types in the LEGO Island engine, responsible for managing ...
Definition: mxpresenter.h:20
virtual void EndAction()
[AI] Terminates the current action, notifies listeners and resets state.
Definition: mxpresenter.cpp:59
virtual void Enable(MxBool p_enable)
[AI] Enables or disables this presenter (controls action flags accordingly).
MxBool IsEnabled()
[AI] Returns whether this presenter is logically enabled (based on the associated action's flags).
virtual MxBool HasTickleStatePassed(TickleState p_tickleState)
[AI] Checks if the specified tickle state has ever been passed since last reset.
Definition: mxpresenter.h:105
@ e_ready
[AI] Prepared to start processing an action.
Definition: mxpresenter.h:25
@ e_starting
[AI] In the process of starting playback/presentation.
Definition: mxpresenter.h:26
MxBool IsA(const char *p_name) const override
[AI] Determines if this object is of (or inherits) the specified named class.
Definition: mxpresenter.h:141
MxDSAction * GetAction() const
[AI] Returns the current action being presented.
Definition: mxpresenter.h:175
virtual void UnregisterClient(MxCore *p_client)
[AI] Unregisters (marks for destruction) a previously registered client.
virtual void RegisterClient(MxCore *p_client, MxTime p_interval)
[AI] Registers an MxCore object to receive periodic tickles.
[AI] 3D vector class, providing vector and cross-product operations in 3D space.
Definition: vector.h:249
void Add(ViewROI *p_roi)
[AI] Adds a ViewROI object to the list of managed ROI objects.
Definition: viewmanager.h:161
void RemoveAll(ViewROI *p_roi)
[AI] Recursively removes all ViewROI objects.
#define TRUE
Definition: d3drmdef.h:28
#define FALSE
Definition: d3drmdef.h:27
#define DECOMP_SIZE_ASSERT(T, S)
Definition: decomp.h:19
#define NULL
[AI] Null pointer value (C/C++ semantics).
Definition: legotypes.h:26
#define FAILURE
[AI] Used to indicate a failed operation in result codes.
Definition: legotypes.h:34
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
Definition: legotypes.h:30
void SetAppCursor(Cursor p_cursor)
[AI] Sets the in-game cursor to a specified type.
Definition: legoutils.cpp:566
void FUN_1003e050(LegoAnimPresenter *p_presenter)
[AI] Repositions the camera and updates the view matrix using a LegoAnimPresenter's animation nodes n...
Definition: legoutils.cpp:176
@ e_cursorArrow
[AI] Standard arrow cursor. [AI]
Definition: legoutils.h:23
LegoGameState * GameState()
[AI] Accessor for the game's central game state controller. [AI]
Definition: misc.cpp:61
LegoVideoManager * VideoManager()
[AI] Accessor for the game's LegoVideoManager subsystem. Used for managing 3D/video hardware....
Definition: misc.cpp:29
LegoAnimationManager * AnimationManager()
[AI] Accessor for the animation manager, which controls Lego character/world animation state....
Definition: misc.cpp:69
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
ViewManager * GetViewManager()
[AI] Accessor for the current ViewManager, managing rendering views/cameras. [AI]
Definition: misc.cpp:108
LegoPlantManager * PlantManager()
[AI] Accessor for the plant manager, handling in-game foliage and plants. [AI]
Definition: misc.cpp:115
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 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
LegoOmni * Lego()
[AI] Retrieves the global LegoOmni singleton instance, providing access to core subsystems.
Definition: misc.cpp:16
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
MxNotificationManager * NotificationManager()
[AI] Returns the notification manager for system-wide state/update notifications.
Definition: mxmisc.cpp:17
MxTickleManager * TickleManager()
[AI] Provides access to the global tickle manager.
Definition: mxmisc.cpp:25
@ c_notificationNewPresenter
[AI] Notification about a new Presenter object [AI]
@ c_notificationEndAction
[AI] Indicates the end of an action [AI]
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
MxLong MxResult
[AI]
Definition: mxtypes.h:106
int MxLong
[AI]
Definition: mxtypes.h:83
signed int MxS32
[AI]
Definition: mxtypes.h:38
void FUN_100b7220(MxDSAction *p_action, MxU32 p_newFlags, MxBool p_setFlags)
Recursively sets or clears flags for an MxDSAction and all sub-actions if applicable.