Isle
Loading...
Searching...
No Matches
legoanimpresenter.cpp
Go to the documentation of this file.
1#include "legoanimpresenter.h"
2
4#include "anim/legoanim.h"
5#include "define.h"
11#include "legopathboundary.h"
12#include "legovideomanager.h"
13#include "legoworld.h"
14#include "misc.h"
15#include "mxautolock.h"
17#include "mxdsanim.h"
18#include "mxdssubscriber.h"
19#include "mxmisc.h"
21#include "mxstreamchunk.h"
22#include "mxtimer.h"
23#include "mxutilities.h"
24#include "mxvariabletable.h"
25#include "mxvideomanager.h"
26#include "realtime/realtime.h"
28
30
31// FUNCTION: LEGO1 0x10068420
32// FUNCTION: BETA10 0x1004e5f0
34{
35 Init();
36}
37
38// FUNCTION: LEGO1 0x10068670
40{
42}
43
44// FUNCTION: LEGO1 0x100686f0
46{
47 m_anim = NULL;
48 m_roiMap = NULL;
49 m_roiMapSize = 0;
53 m_flags = 0;
55 m_unk0xa4 = 0;
58 m_worldId = -1;
61 m_unk0x9c = 0;
64 m_unk0x94 = 0;
67}
68
69// FUNCTION: LEGO1 0x10068770
70// FUNCTION: BETA10 0x1004e833
71void LegoAnimPresenter::Destroy(MxBool p_fromDestructor)
72{
73 {
75
76 if (m_anim != NULL) {
77 delete m_anim;
78 }
79
80 if (m_roiMap != NULL) {
81 delete[] m_roiMap;
82 }
83
84 if (m_unk0x70 != NULL) {
85 delete m_unk0x70;
86 }
87
88 if (m_unk0x74 != NULL) {
90 delete m_unk0x74;
91 }
92
93 if (m_unk0x78 != NULL) {
94 delete m_unk0x78;
95 }
96
97 if (m_substMap != NULL) {
98 MxVariableTable* variableTable = VariableTable();
99
100 for (LegoAnimSubstMap::iterator it = m_substMap->begin(); it != m_substMap->end(); it++) {
101 variableTable->SetVariable((*it).first, "");
102
103 delete[] const_cast<char*>((*it).first);
104 delete[] const_cast<char*>((*it).second);
105 }
106
107 delete m_substMap;
108 }
109
110 if (m_unk0x90 != NULL) {
111 for (MxS32 i = 0; i < m_unk0x94; i++) {
112 if (m_unk0x90[i] != NULL) {
113 delete[] m_unk0x90[i];
114 }
115 }
116
117 delete[] m_unk0x90;
118 }
119
120 if (m_unk0x8c != NULL) {
121 delete[] m_unk0x8c;
122 }
123
124 if (m_unk0xa0 != NULL) {
125 delete m_unk0xa0;
126 }
127
128 Init();
129 }
130
131 if (!p_fromDestructor) {
133 }
134}
135
136// FUNCTION: LEGO1 0x10068fb0
138{
139 MxResult result = FAILURE;
140 LegoMemory storage(p_chunk->GetData());
141 MxS32 magicSig;
142 LegoS32 parseScene = 0;
143 MxS32 val3;
144
145 if (storage.Read(&magicSig, sizeof(magicSig)) != SUCCESS || magicSig != 0x11) {
146 goto done;
147 }
148 if (storage.Read(&m_unk0xa4, sizeof(m_unk0xa4)) != SUCCESS) {
149 goto done;
150 }
151 if (storage.Read(&m_unk0xa8[0], sizeof(m_unk0xa8[0])) != SUCCESS) {
152 goto done;
153 }
154 if (storage.Read(&m_unk0xa8[1], sizeof(m_unk0xa8[1])) != SUCCESS) {
155 goto done;
156 }
157 if (storage.Read(&m_unk0xa8[2], sizeof(m_unk0xa8[2])) != SUCCESS) {
158 goto done;
159 }
160 if (storage.Read(&parseScene, sizeof(parseScene)) != SUCCESS) {
161 goto done;
162 }
163 if (storage.Read(&val3, sizeof(val3)) != SUCCESS) {
164 goto done;
165 }
166
167 m_anim = new LegoAnim();
168 if (!m_anim) {
169 goto done;
170 }
171
172 if (m_anim->Read(&storage, parseScene) != SUCCESS) {
173 goto done;
174 }
175
176 result = SUCCESS;
177
178done:
179 if (result != SUCCESS) {
180 delete m_anim;
181 Init();
182 }
183
184 return result;
185}
186
187// FUNCTION: LEGO1 0x10069150
189{
190 LegoChar* str;
191
192 if (LegoCharacterManager::IsActor(p_und1 + 1)) {
193 str = new LegoChar[strlen(p_und1)];
194
195 if (str != NULL) {
196 strcpy(str, p_und1 + 1);
197 }
198 }
199 else {
200 LegoChar buffer[32];
201 sprintf(buffer, "%d", m_action->GetUnknown24());
202 str = new LegoChar[strlen(p_und1) + strlen(buffer) + strlen(GetActionObjectName()) + 1];
203
204 if (str != NULL) {
205 strcpy(str, p_und1);
206 strcat(str, buffer);
207 strcat(str, GetActionObjectName());
208 }
209 }
210
211 return str;
212}
213
214// FUNCTION: LEGO1 0x100692b0
216{
217 m_unk0x74 = new LegoROIList();
218
219 if (m_unk0x74) {
220 LegoU32 numActors = m_anim->GetNumActors();
221
222 for (LegoU32 i = 0; i < numActors; i++) {
225 LegoROI* roi = NULL;
226
227 if (unk0x04 == 2) {
228 LegoChar* src;
229 if (str[0] == '*') {
230 src = str + 1;
231 }
232 else {
233 src = str;
234 }
235
236 roi = CharacterManager()->GetActorROI(src, TRUE);
237
238 if (roi != NULL && str[0] == '*') {
239 roi->SetVisibility(FALSE);
240 }
241 }
242 else if (unk0x04 == 4) {
243 LegoChar* baseName = new LegoChar[strlen(str)];
244 strcpy(baseName, str + 1);
245 strlwr(baseName);
246
247 LegoChar* und = FUN_10069150(str);
248 roi = CharacterManager()->FUN_10085a80(und, baseName, TRUE);
249
250 if (roi != NULL) {
251 roi->SetVisibility(FALSE);
252 }
253
254 delete[] baseName;
255 delete[] und;
256 }
257 else if (unk0x04 == 3) {
258 LegoChar* lodName = new LegoChar[strlen(str)];
259 strcpy(lodName, str + 1);
260
261 for (LegoChar* i = &lodName[strlen(lodName) - 1]; i > lodName; i--) {
262 if ((*i < '0' || *i > '9') && *i != '_') {
263 break;
264 }
265
266 *i = '\0';
267 }
268
269 strlwr(lodName);
270
271 LegoChar* und = FUN_10069150(str);
272 roi = CharacterManager()->CreateAutoROI(und, lodName, TRUE);
273
274 if (roi != NULL) {
275 roi->SetVisibility(FALSE);
276 }
277
278 delete[] lodName;
279 delete[] und;
280 }
281
282 if (roi != NULL) {
283 m_unk0x74->Append(roi);
284 }
285
286 delete[] str;
287 }
288 }
289}
290
291// FUNCTION: LEGO1 0x100695c0
292// FUNCTION: BETA10 0x1004f359
294{
295 m_unk0x70 = new LegoROIList();
296
297 if (m_unk0x70) {
299 LegoU32 numActors = m_anim->GetNumActors();
300
301 for (LegoU32 i = 0; i < numActors; i++) {
302 if (FUN_100698b0(rois, m_anim->GetActorName(i)) == FALSE) {
304
305 if (unk0x04 == 5 || unk0x04 == 6) {
306 LegoChar lodName[256];
307 const LegoChar* actorName = m_anim->GetActorName(i);
308
309 LegoU32 len = strlen(actorName);
310 strcpy(lodName, actorName);
311
312 for (LegoChar* i = &lodName[len - 1]; isdigit(*i) || *i == '_'; i--) {
313 *i = '\0';
314 }
315
316 strlwr(lodName);
317
318 CharacterManager()->CreateAutoROI(actorName, lodName, FALSE);
319 FUN_100698b0(rois, actorName);
320 }
321 }
322 }
323 }
324}
325
326// FUNCTION: LEGO1 0x100697c0
328{
329 const LegoChar* str = p_und1;
330 const char* var = VariableTable()->GetVariable(p_und1);
331
332 if (*var) {
333 str = var;
334 }
335
336 LegoU32 len = strlen(str) + (p_und2 ? strlen(p_und2) : 0) + 2;
337 LegoChar* result = new LegoChar[len];
338
339 if (result != NULL) {
340 *result = '\0';
341
342 if (p_und2) {
343 strcpy(result, p_und2);
344 strcat(result, ":");
345 }
346
347 strcat(result, str);
348 }
349
350 return result;
351}
352
353// FUNCTION: LEGO1 0x100698b0
355{
356 LegoBool result = FALSE;
357
358 LegoChar* str;
359 if (*(str = FUN_100697c0(p_und2, NULL)) == '*') {
360 LegoChar* tmp = FUN_10069150(str);
361 delete[] str;
362 str = tmp;
363 }
364
365 if (str != NULL && *str != '\0' && p_rois.size() > 0) {
366 for (CompoundObject::const_iterator it = p_rois.begin(); it != p_rois.end(); it++) {
367 LegoROI* roi = (LegoROI*) *it;
368 const char* name = roi->GetName();
369
370 if (name != NULL) {
371 if (!strcmpi(name, str)) {
372 m_unk0x70->Append(roi);
373 result = TRUE;
374 break;
375 }
376 }
377 }
378 }
379
380 delete[] str;
381 return result;
382}
383
384// FUNCTION: LEGO1 0x100699e0
386{
388 LegoROI* roi;
389
390 while (cursor.Next(roi)) {
391 LegoChar* und = FUN_100697c0(roi->GetName(), NULL);
392
393 if (und != NULL && !strcmpi(und, p_und)) {
394 delete[] und;
395 return roi;
396 }
397
398 delete[] und;
399 }
400
401 return NULL;
402}
403
404// FUNCTION: LEGO1 0x10069b10
406{
407 LegoAnimStructMap anims;
408
409 if (m_unk0x8c != NULL) {
410 memset(m_unk0x8c, 0, m_unk0x94 * sizeof(*m_unk0x8c));
411 }
412
413 FUN_1006a3c0(anims, m_anim->GetRoot(), NULL);
414
415 if (m_roiMap != NULL) {
416 delete[] m_roiMap;
417 m_roiMapSize = 0;
418 }
419
420 m_roiMapSize = 0;
421 m_roiMap = new LegoROI*[anims.size() + 1];
422 memset(m_roiMap, 0, (anims.size() + 1) * sizeof(*m_roiMap));
423
424 for (LegoAnimStructMap::iterator it = anims.begin(); it != anims.end();) {
425 MxU32 index = (*it).second.m_index;
426 m_roiMap[index] = (*it).second.m_roi;
427
428 if (m_roiMap[index]->GetName() != NULL) {
429 for (MxS32 i = 0; i < m_unk0x94; i++) {
430 if (m_unk0x8c[i] == NULL && m_unk0x90[i] != NULL) {
431 if (!strcmpi(m_unk0x90[i], m_roiMap[index]->GetName())) {
432 m_unk0x8c[i] = m_roiMap[index];
433 break;
434 }
435 }
436 }
437 }
438
439 delete[] const_cast<char*>((*it).first);
440 it++;
441 m_roiMapSize++;
442 }
443}
444
445// FUNCTION: LEGO1 0x1006a3c0
447{
448 LegoROI* roi = p_roi;
449 LegoChar* und = NULL;
450 LegoChar* und2 = NULL;
451 LegoAnimNodeData* data = (LegoAnimNodeData*) p_node->GetData();
452 const LegoChar* name = data->GetName();
453
454 if (name != NULL && *name != '-') {
455 if (*name == '*') {
456 name = und2 = FUN_10069150(name);
457 }
458
459 und = FUN_100697c0(name, p_roi != NULL ? p_roi->GetName() : NULL);
460
461 if (p_roi == NULL) {
462 roi = FUN_100699e0(und);
463
464 if (roi != NULL) {
465 FUN_1006a4f0(p_map, data, und, roi);
466 }
467 else {
468 data->SetUnknown0x20(0);
469 }
470 }
471 else {
472 LegoROI* child = p_roi->FindChildROI(name, p_roi);
473
474 if (child != NULL) {
475 FUN_1006a4f0(p_map, data, und, child);
476 }
477 else {
478 if (FUN_100699e0(name) != NULL) {
479 FUN_1006a3c0(p_map, p_node, NULL);
480 delete[] und;
481 delete[] und2;
482 return;
483 }
484 }
485 }
486 }
487
488 delete[] und;
489 delete[] und2;
490
491 MxS32 count = p_node->GetNumChildren();
492 for (MxS32 i = 0; i < count; i++) {
493 FUN_1006a3c0(p_map, p_node->GetChild(i), roi);
494 }
495}
496
497// FUNCTION: LEGO1 0x1006a4f0
499 LegoAnimStructMap& p_map,
500 LegoAnimNodeData* p_data,
501 const LegoChar* p_und,
502 LegoROI* p_roi
503)
504{
505 LegoAnimStructMap::iterator it;
506
507 it = p_map.find(p_und);
508 if (it == p_map.end()) {
509 LegoAnimStruct animStruct;
510 animStruct.m_index = p_map.size() + 1;
511 animStruct.m_roi = p_roi;
512
513 p_data->SetUnknown0x20(animStruct.m_index);
514
515 LegoChar* und = new LegoChar[strlen(p_und) + 1];
516 strcpy(und, p_und);
517
518 p_map[und] = animStruct;
519 }
520 else {
521 p_data->SetUnknown0x20((*it).second.m_index);
522 }
523}
524
525// FUNCTION: LEGO1 0x1006aa60
526// FUNCTION: BETA10 0x1004feee
528{
530 LegoROI* roi;
531
532 while (cursor.Next(roi)) {
533 const char* name = roi->GetName();
534
535 if (m_unk0x96 || !CharacterManager()->IsActor(name)) {
537 }
538 }
539}
540
541// FUNCTION: LEGO1 0x1006ab70
543{
544 if (m_unk0x96) {
546 }
547 else {
549 }
550}
551
552// FUNCTION: LEGO1 0x1006aba0
554{
555 return FUN_1006abb0(m_anim->GetRoot(), 0);
556}
557
558// FUNCTION: LEGO1 0x1006abb0
560{
561 MxBool result = FALSE;
562 LegoROI* roi = p_roi;
563 LegoChar* und = NULL;
564 const LegoChar* name = ((LegoAnimNodeData*) p_node->GetData())->GetName();
565 MxS32 i, count;
566
567 if (name != NULL && *name != '-') {
568 und = FUN_100697c0(name, p_roi != NULL ? p_roi->GetName() : NULL);
569
570 if (p_roi == NULL) {
571 roi = FUN_100699e0(und);
572
573 if (roi == NULL) {
574 goto done;
575 }
576 }
577 else {
578 LegoROI* child = p_roi->FindChildROI(name, p_roi);
579
580 if (child == NULL) {
581 if (FUN_100699e0(name) != NULL) {
582 if (FUN_1006abb0(p_node, NULL)) {
583 result = TRUE;
584 }
585 }
586
587 goto done;
588 }
589 }
590 }
591
592 count = p_node->GetNumChildren();
593 for (i = 0; i < count; i++) {
594 if (!FUN_1006abb0(p_node->GetChild(i), roi)) {
595 goto done;
596 }
597 }
598
599 result = TRUE;
600
601done:
602 if (und != NULL) {
603 delete[] und;
604 }
605
606 return result;
607}
608
609// FUNCTION: LEGO1 0x1006ac90
610// FUNCTION: BETA10 0x1005022e
612{
613 if (m_substMap != NULL) {
614 MxVariableTable* variableTable = VariableTable();
615
616 for (LegoAnimSubstMap::iterator it = m_substMap->begin(); it != m_substMap->end(); it++) {
617 variableTable->SetVariable((*it).first, (*it).second);
618 }
619 }
620}
621
622// FUNCTION: LEGO1 0x1006ad30
624{
626 MxLong time;
627
630 }
631 else {
632 time = 0;
633 }
634
636
638 for (MxS32 i = 0; i < m_unk0x94; i++) {
639 if (m_unk0x8c[i] != NULL) {
640 MxMatrix mat(m_unk0x8c[i]->GetLocal2World());
641
642 Vector3 pos(mat[0]);
643 Vector3 dir(mat[1]);
644 Vector3 up(mat[2]);
645 Vector3 und(mat[3]);
646
647 float possqr = sqrt(pos.LenSquared());
648 float dirsqr = sqrt(dir.LenSquared());
649 float upsqr = sqrt(up.LenSquared());
650
651 up = und;
652
654 dir /= dirsqr;
655 pos.EqualsCross(dir, up);
656 pos.Unitize();
657 up.EqualsCross(pos, dir);
658 pos *= possqr;
659 dir *= dirsqr;
660 up *= upsqr;
661
662 m_unk0x8c[i]->FUN_100a58f0(mat);
663 m_unk0x8c[i]->VTable0x14();
664 }
665 }
666 }
667 }
668}
669
670// FUNCTION: LEGO1 0x1006afc0
671// FUNCTION: BETA10 0x1005059a
673{
674 MxU32 length = m_roiMapSize + 1;
675 p_matrix = new MxMatrix[length];
676
677 MxS32 i;
678 for (i = 1; i < length; i++) {
679 if (m_roiMap[i] != NULL) {
680 p_matrix[i] = m_roiMap[i]->GetLocal2World();
681 }
682 }
683
685
686 for (i = 1; i < length; i++) {
687 MxMatrix mat;
688
689 if (m_roiMap[i] != NULL) {
690 mat = p_matrix[i];
691 p_matrix[i] = m_roiMap[i]->GetLocal2World();
692 m_roiMap[i]->FUN_100a58f0(mat);
693 }
694 }
695
696 return SUCCESS;
697}
698
699// FUNCTION: LEGO1 0x1006b140
700// FUNCTION: BETA10 0x100507e0
702{
703 if (p_roi == NULL) {
704 return FAILURE;
705 }
706
707 Matrix4* mn = new MxMatrix();
708 assert(mn);
709
710 MxMatrix local58;
711 const Matrix4& local2world = p_roi->GetLocal2World();
712 MxMatrix* local5c;
713 MxU32 i;
714
715 if (FUN_1006afc0(local5c, 0.0f) != SUCCESS) {
716 goto done;
717 }
718
719 for (i = 1; i <= m_roiMapSize; i++) {
720 if (m_roiMap[i] == p_roi) {
721 if (local5c[i].BETA_1005a590(local58) != SUCCESS) {
722 goto done;
723 }
724
725 break;
726 }
727 }
728
729 {
730 mn->Product(local58, local2world);
731 SetUnknown0xa0(mn);
732 delete[] local5c;
734
735 MxMatrix local140(*m_unk0x78);
736 MxMatrix localf8;
737
738 localf8.Product(local140, *m_unk0xa0);
739 *m_unk0x78 = localf8;
740 return SUCCESS;
741 }
742
743done:
744 if (mn != NULL) {
745 delete mn;
746 }
747
748 if (local5c != NULL) {
749 delete[] local5c;
750 }
751
752 return FAILURE;
753}
754
755// FUNCTION: LEGO1 0x1006b550
756// FUNCTION: BETA10 0x10050a9c
758{
760
761 if (m_currentWorld) {
763
764 if (chunk && chunk->GetTime() + m_action->GetStartTime() <= m_action->GetElapsedTime()) {
765 chunk = m_subscriber->PopData();
766 MxResult result = CreateAnim(chunk);
768
769 if (result == SUCCESS) {
771 ParseExtra();
772 }
773 else {
774 EndAction();
775 }
776 }
777 }
778}
779
780// FUNCTION: LEGO1 0x1006b5e0
781// FUNCTION: BETA10 0x10050b85
783{
785 FUN_100692b0();
786 FUN_100695c0();
787
788 if (m_flags & c_mustSucceed && !FUN_1006aba0()) {
789 goto done;
790 }
791
792 FUN_10069b10();
794
795 if (m_unk0x78 == NULL) {
796 if (fabs(m_action->GetDirection()[0]) >= 0.00000047683716F ||
797 fabs(m_action->GetDirection()[1]) >= 0.00000047683716F ||
798 fabs(m_action->GetDirection()[2]) >= 0.00000047683716F) {
799 m_unk0x78 = new MxMatrix();
801 }
802 else if (m_roiMap != NULL) {
803 LegoROI* roi = m_roiMap[1];
804
805 if (roi != NULL) {
806 MxMatrix mat;
807 mat = roi->GetLocal2World();
808 m_unk0x78 = new MxMatrix(mat);
809 }
810 }
811 }
812
813 if ((m_action->GetDuration() == -1 || ((MxDSMediaAction*) m_action)->GetSustainTime() == -1) &&
816 }
817 else {
818 m_action->SetUnknown90(Timer()->GetTime());
819 }
820
822
823 if (m_compositePresenter && m_compositePresenter->IsA("LegoAnimMMPresenter")) {
826 }
827
828 VTable0x8c();
829
830done:
831 if (m_unk0x70 != NULL) {
832 delete m_unk0x70;
833 m_unk0x70 = NULL;
834 }
835}
836
837// FUNCTION: LEGO1 0x1006b840
839{
840 if (m_subscriber->PeekData()) {
843 }
844
845 if (m_unk0x95) {
848 if (m_compositePresenter->IsA("LegoAnimMMPresenter")) {
850 }
851 }
852 }
853 else {
855 m_unk0x95 = TRUE;
856 }
857 }
858}
859
860// FUNCTION: LEGO1 0x1006b8c0
862{
864}
865
866// FUNCTION: LEGO1 0x1006b8d0
868{
870}
871
872// FUNCTION: LEGO1 0x1006b8e0
874{
875 Destroy(FALSE);
876}
877
878// FUNCTION: LEGO1 0x1006b8f0
880{
881 return m_action->GetObjectName();
882}
883
884// FUNCTION: LEGO1 0x1006b900
885// FUNCTION: BETA10 0x100510d8
887{
888 LegoTreeNode* root = p_anim->GetRoot();
889 MxMatrix mat;
890 LegoAnimNodeData* data = (LegoAnimNodeData*) root->GetData();
891
892 if (p_matrix != NULL) {
893 mat = *p_matrix;
894 }
895 else {
896 LegoROI* roi = m_roiMap[data->GetUnknown0x20()];
897
898 if (roi != NULL) {
899 mat = roi->GetLocal2World();
900 }
901 else {
902 mat.SetIdentity();
903 }
904 }
905
906 LegoROI::FUN_100a8fd0(root, mat, p_time, m_roiMap);
907}
908
909// FUNCTION: LEGO1 0x1006b9a0
910// FUNCTION: BETA10 0x1005118b
912{
913 LegoTreeNode* root = p_anim->GetRoot();
914 MxMatrix mat;
915 LegoAnimNodeData* data = (LegoAnimNodeData*) root->GetData();
916
917 if (p_matrix != NULL) {
918 mat = *p_matrix;
919 }
920 else {
921 LegoROI* roi = m_roiMap[data->GetUnknown0x20()];
922
923 if (roi != NULL) {
924 mat = roi->GetLocal2World();
925 }
926 else {
927 mat.SetIdentity();
928 }
929 }
930
931 if (p_anim->GetCamAnim() != NULL) {
932 MxMatrix transform(mat);
933 p_anim->GetCamAnim()->FUN_1009f490(p_time, transform);
934
937 }
938 }
939
940 LegoROI::FUN_100a8e80(root, mat, p_time, m_roiMap);
941}
942
943// FUNCTION: LEGO1 0x1006bac0
944// FUNCTION: BETA10 0x100512e1
946{
947 MxU16 extraLength;
948 char* extraData;
949 m_action->GetExtra(extraLength, extraData);
950
951 if (extraLength) {
952 char extraCopy[256];
953 memcpy(extraCopy, extraData, extraLength);
954 extraCopy[extraLength] = '\0';
955
956 char output[256];
958 m_compositePresenter->GetAction()->GetExtra(extraLength, extraData);
959
960 if (extraLength) {
961 memcpy(extraCopy, extraData, extraLength);
962 extraCopy[extraLength] = '\0';
963 }
964 }
965
966 if (KeyValueStringParse(output, g_strHIDE_ON_STOP, extraCopy)) {
968 }
969
970 if (KeyValueStringParse(output, g_strMUST_SUCCEED, extraCopy)) {
972 }
973
974 if (KeyValueStringParse(output, g_strSUBST, extraCopy)) {
976
977 char* substToken = output;
978 char *key, *value;
979
980 while ((key = strtok(substToken, g_parseExtraTokens))) {
981 substToken = NULL;
982
983 if ((value = strtok(NULL, g_parseExtraTokens))) {
984 char* keyCopy = new char[strlen(key) + 1];
985 strcpy(keyCopy, key);
986 char* valueCopy = new char[strlen(value) + 1];
987 strcpy(valueCopy, value);
988 (*m_substMap)[keyCopy] = valueCopy;
989 }
990 }
991 }
992
993 if (KeyValueStringParse(output, g_strWORLD, extraCopy)) {
994 char* token = strtok(output, g_parseExtraTokens);
996
997 token = strtok(NULL, g_parseExtraTokens);
998 m_worldId = atoi(token);
999 }
1000
1001 if (KeyValueStringParse(output, g_strPTATCAM, extraCopy)) {
1002 list<char*> tmp;
1003
1004 if (m_unk0x90 != NULL) {
1005 for (MxS32 i = 0; i < m_unk0x94; i++) {
1006 if (m_unk0x90[i] != NULL) {
1007 // (modernization) critical bug: wrong free
1008 delete[] m_unk0x90;
1009 }
1010 }
1011
1012 delete[] m_unk0x90;
1013 m_unk0x90 = NULL;
1014 }
1015
1016 if (m_unk0x8c != NULL) {
1017 delete[] m_unk0x8c;
1018 m_unk0x8c = NULL;
1019 }
1020
1021 char* token = strtok(output, g_parseExtraTokens);
1022 while (token != NULL) {
1023 char* valueCopy = new char[strlen(token) + 1];
1024 strcpy(valueCopy, token);
1025 tmp.push_back(valueCopy);
1026 token = strtok(NULL, g_parseExtraTokens);
1027 }
1028
1029 m_unk0x94 = tmp.size();
1030 if (m_unk0x94 != 0) {
1031 m_unk0x8c = new LegoROI*[m_unk0x94];
1032 m_unk0x90 = new char*[m_unk0x94];
1033 memset(m_unk0x8c, 0, sizeof(*m_unk0x8c) * m_unk0x94);
1034 memset(m_unk0x90, 0, sizeof(*m_unk0x90) * m_unk0x94);
1035
1036 MxS32 i = 0;
1037 for (list<char*>::iterator it = tmp.begin(); it != tmp.end(); it++, i++) {
1038 m_unk0x90[i] = *it;
1039 }
1040 }
1041 }
1042 }
1043}
1044
1045// FUNCTION: LEGO1 0x1006c570
1046// FUNCTION: BETA10 0x10051ab3
1048{
1049 if (m_unk0x78 != NULL) {
1050 delete m_unk0x78;
1051 }
1052
1053 m_unk0x78 = new MxMatrix(p_matrix);
1054}
1055
1056// FUNCTION: LEGO1 0x1006c620
1058{
1059 MxResult result = MxVideoPresenter::StartAction(p_controller, p_action);
1060 m_displayZ = 0;
1061 return result;
1062}
1063
1064// FUNCTION: LEGO1 0x1006c640
1065// FUNCTION: BETA10 0x10051b7a
1067{
1068 undefined4 unused; // required for match
1069
1070 if (m_action == NULL) {
1071 return;
1072 }
1073
1074 LegoWorld* world = CurrentWorld();
1075
1076 if (world != NULL) {
1078 NotificationManager()->Send(world, param);
1079 }
1080
1081 if (m_anim != NULL) {
1083 }
1084
1085 if (m_roiMapSize != 0 && m_roiMap != NULL && m_roiMap[1] != NULL && m_flags & c_hideOnStop) {
1086 for (MxS16 i = 1; i <= m_roiMapSize; i++) {
1087 if (m_roiMap[i] != NULL) {
1089 }
1090 }
1091 }
1092
1094 FUN_1006ab70();
1095 VTable0x90();
1096
1097 if (m_currentWorld != NULL) {
1098 m_currentWorld->Remove(this);
1099 }
1100
1102}
1103
1104// FUNCTION: LEGO1 0x1006c7a0
1105// FUNCTION: BETA10 0x10051da6
1107{
1108 if (m_anim != NULL) {
1110 }
1111
1112 m_unk0x95 = TRUE;
1113}
1114
1115// FUNCTION: LEGO1 0x1006c7d0
1116// FUNCTION: BETA10 0x10051e07
1118{
1119 if (m_unk0x78) {
1120 m_unk0xa8 += (*m_unk0x78)[3];
1121 }
1122 else {
1124 }
1125
1126 if (m_currentWorld == NULL) {
1128 }
1129
1130 if (m_currentWorld) {
1132 if (!m_compositePresenter || !m_compositePresenter->IsA("LegoAnimMMPresenter")) {
1133 m_currentWorld->Add(this);
1134 }
1135 }
1136}
1137
1138// FUNCTION: LEGO1 0x1006c860
1139// FUNCTION: BETA10 0x10051f45
1141{
1142 if (m_currentWorld != NULL) {
1144
1145 if (m_compositePresenter != NULL && m_compositePresenter->IsA("LegoAnimMMPresenter")) {
1146 return;
1147 }
1148
1149 m_currentWorld->Remove(this);
1150 }
1151}
1152
1153// FUNCTION: LEGO1 0x1006c8a0
1155{
1156 if (m_roiMapSize != 0 && m_roiMap != NULL) {
1157 for (MxU32 i = 1; i <= m_roiMapSize; i++) {
1158 LegoEntity* entity = m_roiMap[i]->GetEntity();
1159
1160 if (entity != NULL) {
1161 if (p_bool) {
1163 }
1164 else {
1166 }
1167 }
1168 }
1169 }
1170}
1171
1172// FUNCTION: LEGO1 0x1006c8f0
1173// FUNCTION: BETA10 0x1005206c
1174MxU32 LegoAnimPresenter::VTable0x94(Vector3& p_v1, Vector3& p_v2, float p_f1, float p_f2, Vector3& p_v3)
1175{
1176 Mx3DPointFloat a, b;
1177
1178 b = p_v2;
1179 b *= p_f1;
1180 b += p_v1;
1181
1182 a = b;
1183 a -= m_unk0xa8;
1184
1185 float len = a.LenSquared();
1186 if (len <= 0.0f) {
1187 return TRUE;
1188 }
1189
1190 len = sqrt(len);
1191 if (len <= m_unk0xa4 + p_f2 && m_roiMapSize != 0 && m_roiMap != NULL) {
1192 for (MxU32 i = 1; i <= m_roiMapSize; i++) {
1193 if (m_roiMap[i]->GetLODCount() != 0 && m_roiMap[i]->FUN_100a9410(p_v1, p_v2, p_f1, p_f2, p_v3, FALSE)) {
1194 return TRUE;
1195 }
1196 }
1197 }
1198
1199 return FALSE;
1200}
1201
1202// FUNCTION: LEGO1 0x1006ca50
1203// FUNCTION: BETA10 0x100521d0
1205{
1206 for (MxU32 i = 1; i <= m_roiMapSize; i++) {
1207 LegoEntity* entity = m_roiMap[i]->GetEntity();
1208
1209 if (entity != NULL) {
1210 p_boundary->AddActor((LegoPathActor*) entity);
1211 }
1212 }
1213
1214 return SUCCESS;
1215}
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] Composite presenter class that manages a multi-media animation sequence.
[AI] Holds per-node animation data for a model's animation tree.
Definition: legoanim.h:144
void SetUnknown0x20(LegoU16 p_unk0x20)
[AI] Sets unknown parameter (possibly camera/scene state).
Definition: legoanim.h:200
LegoU16 GetUnknown0x20()
[AI] Unknown, used in scene/camera calculations (purpose unclear).
Definition: legoanim.h:180
LegoChar * GetName()
[AI] Name of this animation node (used for lookup/mapping to scene graph).
Definition: legoanim.h:163
[AI] Handles playback and synchronization of animated LEGO objects, including variable substitution,...
MxBool m_unk0x96
[AI] Boolean/mode: influences actor release vs animation manager cleanup selection (see FUN_1006ab70)...
MxS16 m_unk0x9c
[AI] Int16 state flag, set via SetUnknown0x0cTo1().
LegoROIList * m_unk0x70
[AI] List of ROIs used during preprocessing, actor matching, or variable substitution (purpose varies...
void Init()
[AI] Allocates and resets all internal presenter state.
void StartingTickle() override
[AI] Called at the "Starting" tickle state.
char ** m_unk0x90
[AI] Array of char* names used for selecting camera attached ROIs (from ptatcam extra parameter).
LegoROI * FUN_100699e0(const LegoChar *p_und)
[AI] Looks up an ROI in m_unk0x70 by substituted name.
MxU32 m_flags
[AI] Animation presenter flags (hide-on-stop, must-succeed, etc).
void FUN_1006c8a0(MxBool p_bool)
[AI] Enables or disables internal state (LegoEntity c_altBit1) on all animated entities.
void FUN_10069b10()
[AI] Builds mapping from animation node data names to ROIs, fills m_roiMap and m_roiMapSize.
LegoBool FUN_1006aba0()
[AI] Returns TRUE if every animation actor/ROI node is bound successfully.
void ParseExtra() override
[AI] Extra data parser for animation presenter.
virtual MxResult CreateAnim(MxStreamChunk *p_chunk)
[AI] Creates/loads the LegoAnim resource instance from a stream chunk buffer.
virtual MxU32 VTable0x94(Vector3 &p_v1, Vector3 &p_v2, float p_f1, float p_f2, Vector3 &p_v3)
[AI] Tests if a swept segment (defined by v1, v2, f1, f2) collides any of this presenter's animated R...
virtual void VTable0x90()
[AI] Virtual callback for future expansion.
virtual void VTable0x8c()
[AI] Virtual callback for future expansion.
@ c_hideOnStop
Hide animated objects after stopping [AI].
@ c_mustSucceed
Require all animation targets be satisfied [AI].
void FUN_1006aa60()
[AI] Releases all actors in m_unk0x74 via CharacterManager, respecting state flag m_unk0x96.
LegoROI ** m_unk0x8c
[AI] Lookup array for secondary ROI objects (used for e.g.
LegoAnim * m_anim
[AI] Animation resource currently being played back.
void ReadyTickle() override
[AI] Called when the presenter is in the "Ready" tickle state.
Mx3DPointFloat m_unk0xa8
[AI] 3D float property, used for animation base position offset.
void SetUnknown0x0cTo1()
[AI] Sets the value of internal flag m_unk0x9c to 1.
MxU32 m_roiMapSize
[AI] Number of valid entries in m_roiMap (excluding 0th index).
virtual void VTable0xa0(Matrix4 &p_matrix)
[AI] Sets the baseline transform for the animation.
float m_unk0xa4
[AI] Animation touch radius for path boundary checks and state (set from resource).
LegoAnimSubstMap * m_substMap
[AI] Table of macro/variable substitutions to apply before animation begins (from resource "subst" fi...
void Destroy() override
[AI] Releases all internal resources, actors, maps, and presenter state.
LegoChar * FUN_10069150(const LegoChar *p_und1)
[AI] [Internal] String construction utility used in actor/ROI naming substitution.
void FUN_1006a3c0(LegoAnimStructMap &p_map, LegoTreeNode *p_node, LegoROI *p_roi)
[AI] Recursive helper for building ROI map: walks animation node tree, matching names to ROIs at each...
void EndAction() override
[AI] Completes playback action, triggers world notification and resets/hides all animated actors depe...
void FUN_1006a4f0(LegoAnimStructMap &p_map, LegoAnimNodeData *p_data, const LegoChar *p_und, LegoROI *p_roi)
[AI] Helper to insert an animation node's data into the map (adding new struct if not already inserte...
void FUN_1006b900(LegoAnim *p_anim, MxLong p_time, Matrix4 *p_matrix)
[AI] Steps animation nodes to 'p_time' using transform 'p_matrix', using fast path for tree traversal...
MxS32 m_worldId
[AI] Numeric world ID for world selection/lookup.
void FUN_100692b0()
[AI] Populates m_unk0x74 with all relevant ROIs/actors for this animation by iterating actors in the ...
void SubstituteVariables()
[AI] Applies all queued variable substitutions in the animation resource by setting corresponding Var...
LegoChar * FUN_100697c0(const LegoChar *p_und1, const LegoChar *p_und2)
[AI] Returns a composed name string for combining variable substitution and direct actor references f...
MxBool FUN_1006abb0(LegoTreeNode *p_node, LegoROI *p_roi)
[AI] Recursively validates correct ROI matching/binding in animation tree (helper for FUN_1006aba0).
LegoROI ** m_roiMap
[AI] Lookup array to map animation node indices to scene ROIs (1-based index).
virtual MxResult VTable0x98(LegoPathBoundary *p_boundary)
[AI] Adds all actor ROIs, associated with this animation, to the provided path boundary for grouping ...
Matrix4 * m_unk0xa0
[AI] Optional pointer to a matrix storing a blended/baseline local-to-world transform.
MxAtomId m_worldAtom
[AI] String identifier for the target world (if set in animation resource via extra data).
void SetUnknown0xa0(Matrix4 *p_unk0xa0)
[AI] Sets a pointer to the baseline animation transform.
void FUN_1006ab70()
[AI] Invokes end-of-animation logic via AnimationManager, depending on mode flag m_unk0x96.
MxResult StartAction(MxStreamController *p_controller, MxDSAction *p_action) override
[AI] Begin playback action using a stream and a given action descriptor.
LegoBool FUN_100698b0(const CompoundObject &p_rois, const LegoChar *p_und2)
[AI] Locates (and adds to m_unk0x70) an ROI in a compound object by substituted name,...
const char * GetActionObjectName()
[AI] Gets the name of the object associated with the current animation action.
MxU8 m_unk0x94
[AI] Count of valid camera attached ROI names in m_unk0x90 / m_unk0x8c.
MxResult FUN_1006afc0(MxMatrix *&p_matrix, float p_und)
[AI] Fills a matrix array with each node's local-to-world transform after animation advance (for stat...
void FUN_1006b9a0(LegoAnim *p_anim, MxLong p_time, Matrix4 *p_matrix)
[AI] Like FUN_1006b900, but also processes associated camera animation if present.
~LegoAnimPresenter() override
[AI] Destructor for LegoAnimPresenter.
void FUN_1006c7a0()
[AI] Immediately completes this animation, updates all ROIs to their final pose.
void DoneTickle() override
[AI] Called when animation streaming completes; triggers notification and wraps up state.
void FUN_100695c0()
[AI] Scans the world view compound objects to find and collect relevant ROIs for animation,...
void PutFrame() override
[AI] Called once per frame to push updated animation information (transform, position,...
LegoROIList * m_unk0x74
[AI] List of actors/ROIs created or acquired for this animation instance.
MxBool m_unk0x95
[AI] Boolean: indicates streaming/animation is finished and presenter should progress to Done state.
Matrix4 * m_unk0x78
[AI] Pointer to root/offset MxMatrix used for transform computations.
MxResult AddToManager() override
[AI] Adds this presenter instance to the relevant presenter/notification manager.
void StreamingTickle() override
[AI] Tickle function during streaming (active animation).
MxResult FUN_1006b140(LegoROI *p_roi)
[AI] Calculates a blended transformation for a target ROI and applies as base transform for this anim...
LegoWorld * m_currentWorld
[AI] Reference to the world in which this presenter is currently placed/active.
LegoResult FUN_1009f490(LegoFloat p_time, Matrix4 &p_matrix)
[AI] Evaluates this scene's animation at the given time, updating the passed matrix.
Definition: legoanim.cpp:202
[AI] Root class for all node-based animation blending/structure.
Definition: legoanim.h:356
LegoTime GetDuration()
[AI] Duration (in time units) of the animation.
Definition: legoanim.h:361
virtual LegoResult Read(LegoStorage *p_storage, LegoS32 p_parseScene)
[AI] Loads model and animation data from storage, optionally including scene/camera animation.
Definition: legoanim.cpp:1038
undefined4 GetActorUnknown0x04(LegoU32 p_index)
[AI] Gets the actor's "unk0x04" property at a given index.
Definition: legoanim.cpp:1161
LegoU32 GetNumActors()
[AI] Number of animated actors/models in the animation.
Definition: legoanim.h:362
const LegoChar * GetActorName(LegoU32 p_index)
[AI] Gets the name of the actor at a given index.
Definition: legoanim.cpp:1150
LegoAnimScene * GetCamAnim()
[AI] Gets the optional camera/scene animation track.
Definition: legoanim.h:378
void FUN_10063780(LegoROIList *p_list)
[AI] Examines an ROI list and adds all actors of type to internal "pending" list for extras.
void FUN_10063270(LegoROIList *p_list, LegoAnimPresenter *p_presenter)
[AI] Handles "extras" onboarding by evaluating visibility and position for presenter-based animation.
void FUN_100123e0(const Matrix4 &p_transform, MxU32 p_und)
Sets the camera's transformation matrix in the 3D view, optionally applying a blend with the internal...
Mx3DPointFloat GetWorldLocation()
Gets the camera's current world-space location.
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.
static MxBool IsActor(const char *p_name)
[AI] Checks if the given name matches an actor in the global actor table (case-insensitive).
void ReleaseActor(const char *p_name)
[AI] Releases a character/ROI by name, decrementing its reference count and deleting if zero.
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.
LegoROI * FUN_10085a80(const char *p_name, const char *p_lodName, MxBool p_createEntity)
[AI] Helper function that delegates to CreateAutoROI.
Notification parameter for signaling the end of an animation in the LEGO Island engine.
[AI] Represents an entity that can be placed and managed in the LEGO Island world.
Definition: legoentity.h:16
void ClearUnknown0x10Flag(MxU8 p_flag)
[AI] Clears the given bit in the unknown flag byte.
Definition: legoentity.h:187
void SetUnknown0x10Flag(MxU8 p_flag)
[AI] Sets the given bit in the unknown (usually internal action suppression) flag byte.
Definition: legoentity.h:183
@ c_altBit1
[AI] Used to prevent repeat sound/animation actions while one is in progress [AI]
Definition: legoentity.h:35
Implementation of LegoStorage for memory-backed buffers.
Definition: legostorage.h:317
LegoResult Read(void *p_buffer, LegoU32 p_size) override
Reads bytes from memory buffer at current position.
Definition: legostorage.cpp:20
[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,...
MxResult AddActor(LegoPathActor *p_actor)
[AI] Adds the given actor to this path boundary and sets its boundary pointer.
[AI] A typed list cursor for iterating over a LegoROIList.
Definition: legoroilist.h:53
[AI] A specialized pointer list for managing LegoROI instances.
Definition: legoroilist.h:25
[AI] Represents a Real-time Object Instance enriched with LEGO-specific functionality.
Definition: legoroi.h:43
static void FUN_100a8e80(LegoTreeNode *p_node, Matrix4 &p_matrix, LegoTime p_time, LegoROI **p_roiMap)
[AI] [Static] Recursively evaluates animation nodes, updating the transformation matrices and visibil...
Definition: legoroi.cpp:414
LegoROI * FindChildROI(const LegoChar *p_name, LegoROI *p_roi)
[AI] Recursively searches for a child ROI by name, starting at the given ROI.
Definition: legoroi.cpp:349
static void FUN_100a8fd0(LegoTreeNode *p_node, Matrix4 &p_matrix, LegoTime p_time, LegoROI **p_roiMap)
[AI] [Static] Similar to FUN_100a8e80, but only updates transformation matrices, not visibility or in...
Definition: legoroi.cpp:445
const LegoChar * GetName() const
[AI] Gets this ROI's name.
Definition: legoroi.h:287
LegoEntity * GetEntity()
[AI] Gets the entity associated with this ROI (or NULL).
Definition: legoroi.h:293
[AI] Represents a node within a general, N-ary tree structure.
Definition: legotree.h:44
LegoTreeNodeData * GetData()
[AI] Returns the data payload stored at this node (may be nullptr). [AI]
Definition: legotree.h:54
LegoU32 GetNumChildren()
[AI] Returns the number of direct children of this node. [AI]
Definition: legotree.h:63
LegoTreeNode * GetChild(LegoU32 p_i)
[AI] Gets the child node at the specified index (no bounds checking).
Definition: legotree.h:72
LegoTreeNode * GetRoot()
[AI] Returns a pointer to the root node of the tree. [AI]
Definition: legotree.h:112
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
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 Add(MxCore *p_object)
Adds an object (entity, presenter, ROI, etc.) to the appropriate world-managed list or set.
Definition: legoworld.cpp:418
void FUN_1001fda0(LegoAnimPresenter *p_presenter)
Forwards a presenter to all path controllers to perform a custom action (possibly hide,...
Definition: legoworld.cpp:354
void FUN_1001fe90(LegoAnimPresenter *p_presenter)
Forwards a presenter to all path controllers for another custom or state change action.
Definition: legoworld.cpp:366
LegoCameraController * GetCameraController()
Returns the current camera controller for the world.
Definition: legoworld.h:277
4x4 Matrix class with virtual interface for manipulation and transformation.
Definition: matrix.h:24
virtual void Product(float(*p_a)[4], float(*p_b)[4])
Multiplies two 4x4 float matrices, storing result in this.
virtual void SetIdentity()
Sets this matrix to identity (diagonal 1, others 0).
[AI] Represents a 3D point with floating-point precision, inheriting from Vector3.
Definition: mxgeometry3d.h:14
[AI] Atomized (unique) string identifier, managed by reference counting.
Definition: mxatom.h:124
void Clear()
[AI] Disassociates the atom ID from any atom (decrements reference count, sets internal pointer to NU...
Definition: mxatom.cpp:122
MxBool IsA(const char *p_name) const override
[AI] Runtime type checking for presenter class hierarchy, supporting parent/child class checks.
virtual void VTable0x60(MxPresenter *p_presenter)
[AI] Advance sequencing for serial multi-actions: promotes the next presenter in sequence to e_ready ...
[AI] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
Definition: mxdsaction.h:17
MxLong GetStartTime() const
[AI] Gets the nominal start time for the action, as loaded or scheduled.
Definition: mxdsaction.h:198
void GetExtra(MxU16 &p_extraLength, char *&p_extraData)
[AI] Retrieves the extra data and its length for this action.
Definition: mxdsaction.h:168
virtual void SetUnknown90(MxLong p_unk0x90)
[AI] Set unknown value at offset 0x90, used as baseline in GetElapsedTime.
Definition: mxdsaction.cpp:60
const Vector3 & GetLocation()
[AI] Gets the location vector for this action (world or local space).
Definition: mxdsaction.h:215
const Vector3 & GetUp()
[AI] Gets the up vector for this action (global or local).
Definition: mxdsaction.h:225
const Vector3 & GetDirection()
[AI] Gets the direction vector (typically forward vector) for this action.
Definition: mxdsaction.h:220
virtual MxLong GetDuration()
[AI] Gets the duration for which this action is intended to run.
Definition: mxdsaction.cpp:39
virtual MxLong GetElapsedTime()
[AI] Gets elapsed time for this action since the last time field 0x90 was set.
Definition: mxdsaction.cpp:159
MxLong GetTime()
[AI] Returns the time (timestamp or tick) associated with this chunk. [AI]
Definition: mxdschunk.h:102
MxU8 * GetData()
[AI] Returns a pointer to the start of the data payload. [AI]
Definition: mxdschunk.h:108
MxDSMediaAction extends MxDSAction to add media-specific playback properties and management.
const char * GetObjectName() const
[AI] Returns the object name string.
Definition: mxdsobject.h:127
MxS16 GetUnknown24()
[AI] Returns the unknown 0x24 value (may be data version or usage state). [AI]
Definition: mxdsobject.h:136
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).
MxBool Next()
[AI]
void Append(T p_obj)
[AI]
Definition: mxlist.h:100
[AI] Represents a 4x4 transformation matrix, specialized for the LEGO Island engine and derived from ...
Definition: mxmatrix.h:16
void DoneTickle() override
[AI] Per-frame update for the "done" state; transitions this presenter to idle and ends the action.
MxDSSubscriber * m_subscriber
[AI] Subscriber that provides the stream data (e.g., audio/video chunks) for this presenter.
MxResult StartAction(MxStreamController *, MxDSAction *) override
[AI] Begins a new media playback action, wiring up the stream and chunk lists as needed.
MxResult Send(MxCore *p_listener, const MxNotificationParam &p_param)
[AI] Queues a notification to be sent to a specific registered listener.
MxS32 m_displayZ
[AI] Z-order value for display stacking.
Definition: mxpresenter.h:208
void ProgressTickleState(TickleState p_tickleState)
[AI] Helper for advancing the presenter's tickle state and updating transition history.
Definition: mxpresenter.h:72
MxDSAction * m_action
[AI] The associated action currently being presented by this presenter.
Definition: mxpresenter.h:211
TickleState m_currentTickleState
[AI] Current state in the tickle lifecycle.
Definition: mxpresenter.h:199
@ e_done
[AI] Completed processing the current action.
Definition: mxpresenter.h:30
@ e_starting
[AI] In the process of starting playback/presentation.
Definition: mxpresenter.h:26
@ e_streaming
[AI] Streaming or rendering actively.
Definition: mxpresenter.h:27
MxCriticalSection m_criticalSection
[AI] Thread synchronization for presenter state and data.
Definition: mxpresenter.h:214
MxCompositePresenter * m_compositePresenter
[AI] Owner composite presenter, if any.
Definition: mxpresenter.h:217
MxDSAction * GetAction() const
[AI] Returns the current action being presented.
Definition: mxpresenter.h:175
[AI] Represents a streamable chunk of data, typically sourced from a media buffer and designed for no...
Definition: mxstreamchunk.h:19
[AI] Controller for streaming and managing multimedia resources and actions during gameplay.
MxVariableTable is a specialized hash table for storing key/value string variables used by the LEGO I...
const char * GetVariable(const char *p_key)
Returns the value for the variable with a given key, or an empty string if not found.
void SetVariable(const char *p_key, const char *p_value)
Sets a variable by key and value, replacing or updating if it exists.
void EndAction() override
Signals the end of the current playback action.
MxResult AddToManager() override
Adds this presenter to the global video manager.
void Destroy() override
Destroys internal resources for the presenter.
const Matrix4 & GetLocal2World() const
Accessor for the current local-to-world transformation matrix.
virtual void VTable0x14()
[AI] Calls VTable0x1c().
Definition: orientableroi.h:64
void FUN_100a58f0(const Matrix4 &p_transform)
Assigns the given matrix as the local-to-world transformation and enables some internal flags.
void SetVisibility(unsigned char p_visible)
[AI] Sets the visibility flag to the provided value.
Definition: roi.h:235
virtual int Unitize()
[AI] Scales the vector so its norm is 1 (unit vector).
[AI] 3D vector class, providing vector and cross-product operations in 3D space.
Definition: vector.h:249
void Clear() override
[AI] Sets every coordinate (x, y, z) to zero.
float LenSquared() const override
[AI] Computes the squared magnitude (x^2 + y^2 + z^2) of this vector.
virtual void EqualsCross(const Vector3 &p_a, const Vector3 &p_b)
[AI] Sets this vector to be the cross product of p_a and p_b.
const CompoundObject & GetROIs()
[AI] Returns the internal CompoundObject list of all managed ViewROI objects for iteration or queries...
Definition: viewmanager.h:155
#define TRUE
Definition: d3drmdef.h:28
#define FALSE
Definition: d3drmdef.h:27
#define DECOMP_SIZE_ASSERT(T, S)
Definition: decomp.h:19
unsigned int undefined4
Definition: decomp.h:28
const char * g_strHIDE_ON_STOP
[AI] Script keyword to hide an object upon completion or stoppage of an event or animation.
Definition: define.cpp:57
const char * g_strMUST_SUCCEED
[AI] Indicates that a command, script, or resource must complete successfully for script flow.
Definition: define.cpp:69
const char * g_parseExtraTokens
[AI] Delimiter tokens for parsing extra parameters in scripts or command strings.
Definition: define.cpp:141
const char * g_strPTATCAM
[AI] Used to denote a script operation/keyword relating to the PTATCAM feature or module.
Definition: define.cpp:85
const char * g_strFROM_PARENT
[AI] String indicating the data for fetching properties or configuration from a parent object.
Definition: define.cpp:53
const char * g_strSUBST
[AI] Used to specify substitutions of names or resources in script or object instantiation.
Definition: define.cpp:105
const char * g_strWORLD
[AI] Symbolic name used to reference a "WORLD" entity or property in scripts and object definitions.
Definition: define.cpp:125
map< const char *, const char *, LegoAnimSubstComparator > LegoAnimSubstMap
[AI] Mapping for macro or variable substitutions in animation resource parsing.
map< const char *, LegoAnimStruct, LegoAnimStructComparator > LegoAnimStructMap
[AI] Mapping from string names to LegoAnimStruct.
#define NULL
[AI] Null pointer value (C/C++ semantics).
Definition: legotypes.h:26
unsigned long LegoU32
[AI] Unsigned 32-bit integer type for cross-platform compatibility.
Definition: legotypes.h:71
char LegoChar
[AI] Alias for char, for use in character/byte data and string handling.
Definition: legotypes.h:83
#define FAILURE
[AI] Used to indicate a failed operation in result codes.
Definition: legotypes.h:34
long LegoS32
[AI] Signed 32-bit integer type for cross-platform compatibility.
Definition: legotypes.h:65
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
Definition: legotypes.h:30
LegoU8 LegoBool
[AI] Boolean value used throughout the codebase.
Definition: legotypes.h:89
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
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
LegoWorld * CurrentWorld()
[AI] Accessor for the currently active LegoWorld instance. [AI]
Definition: misc.cpp:93
@ e_lowerCase2
[AI] Alternative or legacy lower case mode, functionally equivalent to e_lowerCase.
Definition: mxatom.h:109
#define AUTOLOCK(CS)
[AI] Macro for automatic locking using the MxAutoLock class. This macro instantiates an MxAutoLock ob...
Definition: mxautolock.h:5
MxTimer * Timer()
[AI] Returns the global simulation timer.
Definition: mxmisc.cpp:33
MxVariableTable * VariableTable()
[AI] Returns the variable table used for script variables and global key/value state.
Definition: mxmisc.cpp:73
MxNotificationManager * NotificationManager()
[AI] Returns the notification manager for system-wide state/update notifications.
Definition: mxmisc.cpp:17
@ c_notificationEndAnim
[AI] End of an animation [AI]
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
MxLong MxResult
[AI]
Definition: mxtypes.h:106
int MxLong
[AI]
Definition: mxtypes.h:83
signed short MxS16
[AI]
Definition: mxtypes.h:26
signed int MxS32
[AI]
Definition: mxtypes.h:38
unsigned short MxU16
[AI]
Definition: mxtypes.h:20
unsigned int MxU32
[AI]
Definition: mxtypes.h:32
MxBool KeyValueStringParse(char *, const char *, const char *)
Searches p_string for a key command and copies its associated value to p_output.
Definition: mxutilities.cpp:85
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.
Definition: realtime.cpp:7
list< ROI * > CompoundObject
Definition: roi.h:135
[AI] Maps an ROI and index for animation nodes/actors.
LegoROI * m_roi
Associated LEGO Region of Interest (ROI) for animation [AI].
MxU32 m_index
Index value for lookup or ordering [AI].