From ada44a30e8074bc4b5dc3e11d3c69965b5348969 Mon Sep 17 00:00:00 2001 From: jonschz <17198703+jonschz@users.noreply.github.com> Date: Mon, 9 Dec 2024 14:57:45 +0100 Subject: [PATCH 1/3] Fix name ambiguities (#1202) Co-authored-by: jonschz --- LEGO1/lego/legoomni/include/legoanimactor.h | 2 +- LEGO1/lego/legoomni/include/legocharactermanager.h | 2 +- LEGO1/lego/legoomni/include/legoextraactor.h | 2 +- LEGO1/lego/legoomni/include/legopathboundary.h | 13 ++++++++----- LEGO1/lego/legoomni/include/legopathcontroller.h | 6 +++--- LEGO1/lego/legoomni/include/legoworld.h | 2 +- LEGO1/mxgeometry/mxgeometry3d.h | 4 ++-- 7 files changed, 17 insertions(+), 14 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legoanimactor.h b/LEGO1/lego/legoomni/include/legoanimactor.h index ebdc4099..9a983120 100644 --- a/LEGO1/lego/legoomni/include/legoanimactor.h +++ b/LEGO1/lego/legoomni/include/legoanimactor.h @@ -101,7 +101,7 @@ class LegoAnimActor : public virtual LegoPathActor { // uninitialized_fill_n // TEMPLATE: LEGO1 0x1001ca10 -// uninitialized_copy +// ?uninitialized_copy@@YAPAPAULegoAnimActorStruct@@PAPAU1@00@Z // clang-format on #endif // LEGOANIMACTOR_H diff --git a/LEGO1/lego/legoomni/include/legocharactermanager.h b/LEGO1/lego/legoomni/include/legocharactermanager.h index a013ed2d..117b9f82 100644 --- a/LEGO1/lego/legoomni/include/legocharactermanager.h +++ b/LEGO1/lego/legoomni/include/legocharactermanager.h @@ -101,7 +101,7 @@ class LegoCharacterManager { // list >::_Buynode // TEMPLATE: LEGO1 0x10035790 -// _Construct +// ?_Construct@@YAXPAPAVROI@@ABQAV1@@Z // TEMPLATE: LEGO1 0x10082b90 // _Tree,map >::_Kfn,LegoCharacterComparator,allocator >::~_Tree,map >::_Kfn,LegoCharacterComparator,allocator > diff --git a/LEGO1/lego/legoomni/include/legoextraactor.h b/LEGO1/lego/legoomni/include/legoextraactor.h index 54e3b1f8..a9d9f2d1 100644 --- a/LEGO1/lego/legoomni/include/legoextraactor.h +++ b/LEGO1/lego/legoomni/include/legoextraactor.h @@ -87,6 +87,6 @@ class LegoExtraActor : public virtual LegoAnimActor { // vector >::size // TEMPLATE: LEGO1 0x1002b720 -// uninitialized_copy +// ?uninitialized_copy@@YAPAPAEPAPAE00@Z #endif // LEGOEXTRAACTOR_H diff --git a/LEGO1/lego/legoomni/include/legopathboundary.h b/LEGO1/lego/legoomni/include/legopathboundary.h index ad2a216a..020bd3c6 100644 --- a/LEGO1/lego/legoomni/include/legopathboundary.h +++ b/LEGO1/lego/legoomni/include/legopathboundary.h @@ -85,7 +85,10 @@ class LegoPathBoundary : public LegoWEGEdge { // _Tree >::_Kfn,LegoPathActorSetCompare,allocator >::find // TEMPLATE: LEGO1 0x1002c4c0 -// _Tree >::_Kfn,LegoPathActorSetCompare,allocator >::_Copy +// ?_Copy@?$_Tree@PAVLegoPathActor@@PAV1@U_Kfn@?$set@PAVLegoPathActor@@ULegoPathActorSetCompare@@V?$allocator@PAVLegoPathActor@@@@@@ULegoPathActorSetCompare@@V?$allocator@PAVLegoPathActor@@@@@@IAEXABV1@@Z + +// TEMPLATE: LEGO1 0x1002c5b0 +// ?_Copy@?$_Tree@PAVLegoPathActor@@PAV1@U_Kfn@?$set@PAVLegoPathActor@@ULegoPathActorSetCompare@@V?$allocator@PAVLegoPathActor@@@@@@ULegoPathActorSetCompare@@V?$allocator@PAVLegoPathActor@@@@@@IAEPAU_Node@1@PAU21@0@Z // TEMPLATE: LEGO1 0x1002c630 // _Tree >::_Kfn,LegoPathActorSetCompare,allocator >::_Erase @@ -122,7 +125,7 @@ class LegoPathBoundary : public LegoWEGEdge { // _Tree >::_Kfn,LegoPathActorSetCompare,allocator >::_Rrotate // TEMPLATE: LEGO1 0x1004a7a0 -// _Construct +// ?_Construct@@YAXPAPAVMxCore@@ABQAV1@@Z // TEMPLATE: LEGO1 0x10056c20 // _Tree >::_Kfn,LegoAnimPresenterSetCompare,allocator >::~_Tree >::_Kfn,LegoAnimPresenterSetCompare,allocator >::iterator::_Inc // TEMPLATE: LEGO1 0x10056d30 -// _Tree >::_Kfn,LegoAnimPresenterSetCompare,allocator >::erase +// ?erase@?$_Tree@PAVLegoAnimPresenter@@PAV1@U_Kfn@?$set@PAVLegoAnimPresenter@@ULegoAnimPresenterSetCompare@@V?$allocator@PAVLegoAnimPresenter@@@@@@ULegoAnimPresenterSetCompare@@V?$allocator@PAVLegoAnimPresenter@@@@@@QAE?AViterator@1@V21@@Z // TEMPLATE: LEGO1 0x10057180 // _Tree >::_Kfn,LegoAnimPresenterSetCompare,allocator >::_Erase @@ -167,7 +170,7 @@ class LegoPathBoundary : public LegoWEGEdge { // _Tree >::_Kfn,LegoAnimPresenterSetCompare,allocator >::_Rrotate // TEMPLATE: LEGO1 0x10058820 -// _Tree >::_Kfn,LegoAnimPresenterSetCompare,allocator >::erase +// ?erase@?$_Tree@PAVLegoAnimPresenter@@PAV1@U_Kfn@?$set@PAVLegoAnimPresenter@@ULegoAnimPresenterSetCompare@@V?$allocator@PAVLegoAnimPresenter@@@@@@ULegoAnimPresenterSetCompare@@V?$allocator@PAVLegoAnimPresenter@@@@@@QAE?AViterator@1@V21@0@Z // TEMPLATE: LEGO1 0x100588e0 // _Tree >::_Kfn,LegoAnimPresenterSetCompare,allocator >::equal_range @@ -176,7 +179,7 @@ class LegoPathBoundary : public LegoWEGEdge { // _Tree >::_Kfn,LegoAnimPresenterSetCompare,allocator >::_Lbound // TEMPLATE: LEGO1 0x10058980 -// _Construct +// ?_Construct@@YAXPAPAVLegoAnimPresenter@@ABQAV1@@Z // TEMPLATE: LEGO1 0x100589a0 // _Distance diff --git a/LEGO1/lego/legoomni/include/legopathcontroller.h b/LEGO1/lego/legoomni/include/legopathcontroller.h index 4bcf17c9..79106e4f 100644 --- a/LEGO1/lego/legoomni/include/legopathcontroller.h +++ b/LEGO1/lego/legoomni/include/legopathcontroller.h @@ -188,7 +188,7 @@ class LegoPathController : public MxCore { // _Tree >::_Kfn,LegoPathCtrlEdgeCompare,allocator >::iterator::_Inc // TEMPLATE: LEGO1 0x100452b0 -// _Tree >::_Kfn,LegoPathCtrlEdgeCompare,allocator >::erase +// ?erase@?$_Tree@PAULegoPathCtrlEdge@@PAU1@U_Kfn@?$set@PAULegoPathCtrlEdge@@ULegoPathCtrlEdgeCompare@@V?$allocator@PAULegoPathCtrlEdge@@@@@@ULegoPathCtrlEdgeCompare@@V?$allocator@PAULegoPathCtrlEdge@@@@@@QAE?AViterator@1@V21@@Z // TEMPLATE: LEGO1 0x10045700 // _Tree >::_Kfn,LegoPathCtrlEdgeCompare,allocator >::_Erase @@ -308,10 +308,10 @@ class LegoPathController : public MxCore { // multiset >::~multiset > // TEMPLATE: LEGO1 0x1004a760 -// _Construct +// ?_Construct@@YAXPAPAULegoBEWithFloat@@ABQAU1@@Z // TEMPLATE: LEGO1 0x1004a780 -// _Construct +// ?_Construct@@YAXPAPAULegoPathCtrlEdge@@ABQAU1@@Z // GLOBAL: LEGO1 0x100f4360 // _Tree >::_Kfn,LegoPathCtrlEdgeCompare,allocator >::_Nil diff --git a/LEGO1/lego/legoomni/include/legoworld.h b/LEGO1/lego/legoomni/include/legoworld.h index e2aaf8f4..7a3e6d76 100644 --- a/LEGO1/lego/legoomni/include/legoworld.h +++ b/LEGO1/lego/legoomni/include/legoworld.h @@ -193,7 +193,7 @@ class LegoWorld : public LegoEntity { // _Tree >::_Kfn,CoreSetCompare,allocator >::find // TEMPLATE: LEGO1 0x10022360 -// ?_Construct@@YAXPAPAVMxCore@@ABQAV1@@Z +// ?_Construct@@YAXPAPAVLegoPathActor@@ABQAV1@@Z // GLOBAL: LEGO1 0x100f11a0 // _Tree >::_Kfn,CoreSetCompare,allocator >::_Nil diff --git a/LEGO1/mxgeometry/mxgeometry3d.h b/LEGO1/mxgeometry/mxgeometry3d.h index 3e72db9a..d3deb523 100644 --- a/LEGO1/mxgeometry/mxgeometry3d.h +++ b/LEGO1/mxgeometry/mxgeometry3d.h @@ -44,7 +44,7 @@ class Mx3DPointFloat : public Vector3 { float& index_operator(int idx) { return m_data[idx]; } // SYNTHETIC: LEGO1 0x10010c00 - // Mx3DPointFloat::operator= + // ??4Mx3DPointFloat@@QAEAAV0@ABV0@@Z private: float m_elements[3]; // 0x08 @@ -80,7 +80,7 @@ class Mx4DPointFloat : public Vector4 { // SYNTHETIC: LEGO1 0x10064b20 // SYNTHETIC: BETA10 0x10070420 - // Mx4DPointFloat::operator= + // ??4Mx4DPointFloat@@QAEAAV0@ABV0@@Z private: float m_elements[4]; // 0x08 From 6681f4aaaea8fee078140062b8fd54fdbf6de26a Mon Sep 17 00:00:00 2001 From: Ramen2X Date: Mon, 9 Dec 2024 10:46:03 -0500 Subject: [PATCH 2/3] fix erroneous README labeling of CONFIG file type [skip ci] CONFIG.DLL -> CONFIG.EXE --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 55e74dd1..3293e97f 100644 --- a/README.md +++ b/README.md @@ -58,8 +58,10 @@ If you're interested in helping or contributing to this project, check out the [ ### Which version of LEGO Island do I have? -Right click on `LEGO1.DLL`, select `Properties`, and switch to the `Details` tab. Under `Version` you should either see `1.0.0.0` (1.0) or `1.1.0.0` (1.1). Additionally, you can look at the game disc files; 1.0's files will all say August 8, 1997, and 1.1's files will all say September 8, 1997. Version 1.1 is by far the most common, especially if you're not using the English or Japanese versions, so that's most likely the version you have. Please note that some localized versions of LEGO Island were recompiled with small changes despite maintaining a version number parallel with other versions; this decompilation is specifically targeting the English release of version 1.1 of LEGO Island. You can verify you have the correct version using the checksums below: +Right click on `LEGO1.DLL`, select `Properties`, and switch to the `Details` tab. Under `Version` you should either see `1.0.0.0` (1.0) or `1.1.0.0` (1.1). Additionally, you can look at the game disc files; 1.0's files will all say August 8, 1997, and 1.1's files will all say September 8, 1997. Version 1.1 is by far the most common, especially if you're not using the English or Japanese versions, so that's most likely the version you have. + +Please note that some localized versions of LEGO Island were recompiled with small changes despite maintaining a version number parallel with other versions; this decompilation is specifically targeting the English release of version 1.1 of LEGO Island. You can verify you have the correct version using the checksums below: * ISLE.EXE `md5: f6da12249e03eed1c74810cd23beb9f5` * LEGO1.DLL `md5: 4e2f6d969ea2ef8655ba3fc221a0c8fe` -* CONFIG.DLL `md5: 92d958a64a273662c591c88b09100f4a` +* CONFIG.EXE `md5: 92d958a64a273662c591c88b09100f4a` From 07def56326a40edeef72dfb9ea4f59bb22b89917 Mon Sep 17 00:00:00 2001 From: jonschz <17198703+jonschz@users.noreply.github.com> Date: Mon, 9 Dec 2024 22:05:08 +0100 Subject: [PATCH 3/3] Implement `Act2Actor::VTable0x70` (#1201) * Implement draft of `Act2Actor::VTable0x70` * Fix CI errors * Implement `Act2Actor::FUN_100199f0` * WIP: cleanup * Address review comments * Run formatter --------- Co-authored-by: jonschz --- LEGO1/lego/legoomni/include/act2actor.h | 13 +- LEGO1/lego/legoomni/include/legoact2.h | 19 +- LEGO1/lego/legoomni/src/actors/act2actor.cpp | 282 +++++++++++++++++- LEGO1/lego/legoomni/src/entity/legoworld.cpp | 1 + LEGO1/lego/legoomni/src/main/legomain.cpp | 4 +- .../lego/legoomni/src/paths/legoanimactor.cpp | 5 +- .../lego/legoomni/src/paths/legopathactor.cpp | 1 + .../legoomni/src/video/legoanimpresenter.cpp | 1 + LEGO1/lego/legoomni/src/worlds/legoact2.cpp | 14 + LEGO1/lego/sources/3dmanager/lego3dview.h | 2 +- LEGO1/mxgeometry/mxmatrix.h | 1 + LEGO1/viewmanager/viewmanager.h | 2 + 12 files changed, 325 insertions(+), 20 deletions(-) diff --git a/LEGO1/lego/legoomni/include/act2actor.h b/LEGO1/lego/legoomni/include/act2actor.h index cf8ed507..905743fb 100644 --- a/LEGO1/lego/legoomni/include/act2actor.h +++ b/LEGO1/lego/legoomni/include/act2actor.h @@ -28,8 +28,11 @@ class Act2Actor : public LegoAnimActor { MxS32 VTable0xa0() override; // vtable+0xa0 void FUN_10018980(); + void FUN_10019250(MxFloat p_speed, MxFloat p_param2); void FUN_10019520(); void FUN_10019560(); + undefined4 FUN_10019700(MxFloat p_param); + void FUN_100199f0(MxS8 p_param); void FUN_100192a0(undefined4 p_param); // SYNTHETIC: LEGO1 0x1001a0a0 @@ -44,16 +47,16 @@ class Act2Actor : public LegoAnimActor { MxS8 m_unk0x1d; // 0x1d undefined m_unk0x1e; // 0x1e MxBool m_unk0x1f; // 0x1f - undefined4 m_unk0x20; // 0x20 - undefined4 m_unk0x24; // 0x24 + MxFloat m_unk0x20; // 0x20 + MxFloat m_unk0x24; // 0x24 MxS8 m_unk0x28; // 0x28 - undefined4 m_unk0x2c; // 0x2c - undefined4 m_unk0x30; // 0x30 + MxFloat m_unk0x2c; // 0x2c + MxFloat m_unk0x30; // 0x30 LegoAnimActorStruct* m_shootAnim; // 0x34 LegoCacheSound* m_unk0x38; // 0x38 undefined4 m_unk0x3c; // 0x3c undefined m_unk0x40; // 0x40 - undefined4 m_unk0x44; // 0x44 + MxFloat m_unk0x44; // 0x44 MxS8 m_unk0x48; // 0x48 undefined4 m_unk0x4c; // 0x4c }; diff --git a/LEGO1/lego/legoomni/include/legoact2.h b/LEGO1/lego/legoomni/include/legoact2.h index 797b2249..e43c3a7a 100644 --- a/LEGO1/lego/legoomni/include/legoact2.h +++ b/LEGO1/lego/legoomni/include/legoact2.h @@ -68,6 +68,17 @@ class LegoAct2 : public LegoWorld { void SetUnknown0x1138(Act2Actor* p_unk0x1138) { m_unk0x1138 = p_unk0x1138; } void SetDestLocation(LegoGameState::Area p_destLocation) { m_destLocation = p_destLocation; } + MxResult FUN_100516b0(); + void FUN_100517b0(); + MxResult FUN_10052560( + Act2mainScript::Script p_objectId, + MxBool p_param2, + MxBool p_param3, + Mx3DPointFloat* p_location, + Mx3DPointFloat* p_direction, + Mx3DPointFloat* p_param6 + ); + // SYNTHETIC: LEGO1 0x1004fe20 // LegoAct2::`scalar deleting destructor' @@ -83,14 +94,6 @@ class LegoAct2 : public LegoWorld { void SpawnBricks(); void FUN_10051fa0(MxS32 p_param1); void FUN_100521f0(MxS32 p_param1); - MxResult FUN_10052560( - Act2mainScript::Script p_objectId, - MxBool p_param2, - MxBool p_param3, - Mx3DPointFloat* p_location, - Mx3DPointFloat* p_direction, - Mx3DPointFloat* p_param6 - ); MxResult FUN_10052800(); Act2Brick m_bricks[10]; // 0x00f8 diff --git a/LEGO1/lego/legoomni/src/actors/act2actor.cpp b/LEGO1/lego/legoomni/src/actors/act2actor.cpp index 1d29f18b..f70788d5 100644 --- a/LEGO1/lego/legoomni/src/actors/act2actor.cpp +++ b/LEGO1/lego/legoomni/src/actors/act2actor.cpp @@ -1,11 +1,19 @@ #include "act2actor.h" +#include "3dmanager/lego3dmanager.h" +#include "act2main_actions.h" +#include "legoact2.h" #include "legocachesoundmanager.h" #include "legopathcontroller.h" #include "legopathedgecontainer.h" #include "legosoundmanager.h" +#include "legovideomanager.h" +#include "legoworld.h" #include "misc.h" #include "roi/legoroi.h" +#include "viewmanager/viewmanager.h" + +#include DECOMP_SIZE_ASSERT(Act2Actor, 0x1a8) DECOMP_SIZE_ASSERT(Act2Actor::UnknownListStructure, 0x20) @@ -26,6 +34,21 @@ Act2Actor::UnknownListStructure g_unk0x100f0db8[] = { {{-44.6, 0.1, 45.3}, {0.95, 0.0, -0.3}, "edg00_154", FALSE}, }; +// GLOBAL: LEGO1 0x100f0f1c +MxFloat g_unk0x100f0f1c = 0.0f; + +// GLOBAL: LEGO1 0x10102b1c +// GLOBAL: BETA10 0x10209f60 +undefined4 g_nextHeadWavIndex = 0; + +// GLOBAL: LEGO1 0x10102b20 +// GLOBAL: BETA10 0x10209f64 +undefined4 g_nextBehindWavIndex = 0; + +// GLOBAL: LEGO1 0x10102b24 +// GLOBAL: BETA10 0x10209f68 +undefined4 g_nextInterruptWavIndex = 0; + // FUNCTION: LEGO1 0x100187e0 // FUNCTION: BETA10 0x1000c7fb Act2Actor::Act2Actor() @@ -115,11 +138,186 @@ MxResult Act2Actor::VTable0x9c() } } -// STUB: LEGO1 0x10018c30 -// STUB: BETA10 0x1000cb52 +// FUNCTION: LEGO1 0x10018c30 +// FUNCTION: BETA10 0x1000cb52 void Act2Actor::VTable0x70(float p_time) { - // TODO + int dummy1; // for BETA10, not sure what it is being used for + +#ifdef NDEBUG + MxFloat local48float = 0.0f; + if (g_unk0x100f0f1c != 0.0f) { + local48float = p_time - g_unk0x100f0f1c; + } + + g_unk0x100f0f1c = p_time; +#endif + + LegoAnimActor::VTable0x70(p_time); + + if (m_unk0x44 != 0.0f && m_unk0x44 < p_time) { + SetWorldSpeed(m_unk0x28); + } + + if (m_unk0x1f) { + if (m_unk0x20 > 600.0f) { + m_unk0x1f = FALSE; + m_unk0x20 = 0; + } + else { +#ifdef NDEBUG + m_unk0x20 += local48float; +#endif + MxMatrix matrix = m_roi->GetLocal2World(); + matrix[3][1] += 3.0f; + m_roi->UpdateTransformationRelativeToParent(matrix); + +#ifdef NDEBUG + LegoROI* brickstrROI = FindROI("brickstr"); + MxMatrix brickstrMatrix = brickstrROI->GetLocal2World(); + brickstrMatrix[3][1] += 3.0f; + brickstrROI->UpdateTransformationRelativeToParent(brickstrMatrix); +#endif + return; + } + } + + if (!m_grec) { + if (m_unk0x1e == 2) { + m_unk0x1e = 0; + m_unk0x2c = m_shootAnim->GetDuration() + p_time; + m_unk0x30 = m_unk0x2c - 1300.0f; + SetWorldSpeed(0); + m_unk0x1c = FALSE; + } + else if (m_unk0x1e == 1) { + FindROI("pwrbrik")->SetVisibility(FALSE); + FindROI("debrick")->SetVisibility(FALSE); + FindROI("ray")->SetVisibility(FALSE); + m_unk0x4c = 0; + m_unk0x1e = 2; + VTable0xa0(); + FUN_10019250(m_unk0x28 + 3, p_time + 3000.0f); + } + else if (m_unk0x1e == 0) { + if (m_unk0x40) { + m_unk0x40 = 0; + m_unk0x2c = m_shootAnim->GetDuration() + p_time; + m_unk0x30 = m_unk0x2c - 1300.0f; + } + + if (FUN_10019700(p_time) == 1) { + return; + } + } + else if (m_unk0x1e == 5) { + FindROI("brickstr")->SetVisibility(FALSE); + GetROI()->SetVisibility(FALSE); + CurrentWorld()->RemoveActor(this); + return; + } +#ifdef NDEBUG + else if (m_unk0x1e == 4) { + if (m_worldSpeed == 0.0f) { + return; + } + + SetWorldSpeed(0.0f); + ((LegoAct2*) CurrentWorld())->FUN_100517b0(); + return; + } +#endif + } + + if (m_unk0x1e == 5 || m_unk0x1e == 4) { + return; + } + + if (m_unk0x1e == 3) { + if (p_time - m_unk0x24 > 600.0f) { + m_unk0x1e = 2; + FUN_10019250(m_unk0x28 + 4, p_time + 15000.0f); + } + } + else { + LegoROI* roiPepper = FindROI("pepper"); + + if (roiPepper) { + ViewManager* vm = VideoManager()->Get3DManager()->GetLego3DView()->GetViewManager(); + assert(vm); + + MxU32 inFrustum = vm->IsBoundingBoxInFrustum(m_roi->GetWorldBoundingBox()); + + if (inFrustum) { + Mx3DPointFloat local18(roiPepper->GetWorldDirection()); + Mx3DPointFloat local30(m_roi->GetWorldPosition()); + Mx3DPointFloat local60(roiPepper->GetWorldPosition()); + local30 -= local60; + local30.Unitize(); + + MxFloat dotproduct = local18.Dot(&local30, &local18); + + if (dotproduct >= 0.0) { + const MxFloat* pepperWorldPosition = roiPepper->GetWorldPosition(); + const MxFloat* worldPosition = m_roi->GetWorldPosition(); + + MxFloat distance1 = DISTSQRD3(pepperWorldPosition, worldPosition); + + if (distance1 < 75.0f) { + if (!m_unk0x1c) { + m_unk0x1c = 1; + + if (!m_unk0x1e) { + FUN_100199f0(2); + m_unk0x1e = 1; + } + else { + LegoROI* childROI = m_roi->FindChildROI("windsd", m_roi); + const MxFloat* childPosition = childROI->GetWorldPosition(); + MxFloat distance2 = DISTSQRD3(pepperWorldPosition, childPosition); + + childROI = m_roi->FindChildROI("reardr", m_roi); + childPosition = childROI->GetWorldPosition(); + MxFloat distance3 = DISTSQRD3(pepperWorldPosition, childPosition); + + if (distance3 > distance2) { + FUN_100199f0(0); + } + else +#ifdef NDEBUG + if (p_time - m_unk0x24 > 3000.0f) { +#endif + SetWorldSpeed(m_unk0x28 - 1); + m_unk0x1e = 3; + m_unk0x24 = p_time; + + if (!((LegoAct2*) CurrentWorld())->FUN_100516b0()) { + FUN_100199f0(1); + } +#ifdef NDEBUG + } +#endif + } + } + } + else { + if (m_unk0x1c) { + m_unk0x1c = 0; + } + } + } + } + } + } +} + +// FUNCTION: LEGO1 0x10019250 +// FUNCTION: BETA10 0x1000d45c +void Act2Actor::FUN_10019250(MxFloat p_speed, MxFloat p_param2) +{ + // The arguments have been changed from BETA10 to LEGO1 + SetWorldSpeed(p_speed); + m_unk0x44 = p_param2; } // FUNCTION: LEGO1 0x10019280 @@ -298,6 +496,84 @@ MxS32 Act2Actor::VTable0xa0() } } +// STUB: LEGO1 0x10019700 +// STUB: BETA10 0x1000dd27 +undefined4 Act2Actor::FUN_10019700(MxFloat p_param) +{ + // TODO + return 0; +} + +// FUNCTION: LEGO1 0x100199f0 +// FUNCTION: BETA10 0x1000e11a +void Act2Actor::FUN_100199f0(MxS8 p_param) +{ + switch (p_param) { + case 0: + switch (g_nextHeadWavIndex) { + case 0: + ((LegoAct2*) CurrentWorld()) + ->FUN_10052560(Act2mainScript::c_VOhead0_PlayWav, FALSE, FALSE, NULL, NULL, NULL); + + g_nextHeadWavIndex++; + break; + default: + ((LegoAct2*) CurrentWorld()) + ->FUN_10052560(Act2mainScript::c_VOhead1_PlayWav, FALSE, FALSE, NULL, NULL, NULL); + g_nextHeadWavIndex = 0; + break; + } + break; + case 1: + switch (g_nextBehindWavIndex) { + case 0: + ((LegoAct2*) CurrentWorld()) + ->FUN_10052560(Act2mainScript::c_VObehind0_PlayWav, FALSE, TRUE, NULL, NULL, NULL); + g_nextBehindWavIndex++; + break; + case 1: + ((LegoAct2*) CurrentWorld()) + ->FUN_10052560(Act2mainScript::c_VObehind1_PlayWav, FALSE, TRUE, NULL, NULL, NULL); + g_nextBehindWavIndex++; + break; + case 2: + ((LegoAct2*) CurrentWorld()) + ->FUN_10052560(Act2mainScript::c_VObehind2_PlayWav, FALSE, TRUE, NULL, NULL, NULL); + g_nextBehindWavIndex++; + break; + default: + ((LegoAct2*) CurrentWorld()) + ->FUN_10052560(Act2mainScript::c_VObehind3_PlayWav, FALSE, TRUE, NULL, NULL, NULL); + g_nextBehindWavIndex = 0; + break; + } + break; + case 2: + switch (g_nextInterruptWavIndex) { + case 0: + ((LegoAct2*) CurrentWorld()) + ->FUN_10052560(Act2mainScript::c_VOinterrupt0_PlayWav, FALSE, FALSE, NULL, NULL, NULL); + g_nextInterruptWavIndex++; + break; + case 1: + ((LegoAct2*) CurrentWorld()) + ->FUN_10052560(Act2mainScript::c_VOinterrupt1_PlayWav, FALSE, FALSE, NULL, NULL, NULL); + g_nextInterruptWavIndex++; + break; + case 2: + ((LegoAct2*) CurrentWorld()) + ->FUN_10052560(Act2mainScript::c_VOinterrupt2_PlayWav, FALSE, FALSE, NULL, NULL, NULL); + g_nextInterruptWavIndex++; + break; + default: + ((LegoAct2*) CurrentWorld()) + ->FUN_10052560(Act2mainScript::c_VOinterrupt3_PlayWav, FALSE, FALSE, NULL, NULL, NULL); + g_nextInterruptWavIndex = 0; + break; + } + } +} + // FUNCTION: LEGO1 0x1001a180 MxS32 Act2Actor::VTable0x68(Vector3& p_v1, Vector3& p_v2, Vector3& p_v3) { diff --git a/LEGO1/lego/legoomni/src/entity/legoworld.cpp b/LEGO1/lego/legoomni/src/entity/legoworld.cpp index 88023db9..2dbcce2e 100644 --- a/LEGO1/lego/legoomni/src/entity/legoworld.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoworld.cpp @@ -339,6 +339,7 @@ MxResult LegoWorld::PlaceActor( } // FUNCTION: LEGO1 0x1001fc80 +// FUNCTION: BETA10 0x100da4bf void LegoWorld::RemoveActor(LegoPathActor* p_actor) { LegoPathControllerListCursor cursor(&m_list0x68); diff --git a/LEGO1/lego/legoomni/src/main/legomain.cpp b/LEGO1/lego/legoomni/src/main/legomain.cpp index 7fc35185..4a751ab7 100644 --- a/LEGO1/lego/legoomni/src/main/legomain.cpp +++ b/LEGO1/lego/legoomni/src/main/legomain.cpp @@ -408,8 +408,8 @@ void LegoOmni::DeleteObject(MxDSAction& p_dsAction) // FUNCTION: BETA10 0x1008ea6d LegoROI* LegoOmni::FindROI(const char* p_name) { - ViewManager* viewManager = GetVideoManager()->Get3DManager()->GetLego3DView()->GetViewManager(); - const CompoundObject& rois = viewManager->GetROIs(); + const CompoundObject& rois = + ((LegoVideoManager*) m_videoManager)->Get3DManager()->GetLego3DView()->GetViewManager()->GetROIs(); if (p_name != NULL && *p_name != '\0' && rois.size() > 0) { for (CompoundObject::const_iterator it = rois.begin(); it != rois.end(); it++) { diff --git a/LEGO1/lego/legoomni/src/paths/legoanimactor.cpp b/LEGO1/lego/legoomni/src/paths/legoanimactor.cpp index 6001212b..234bf344 100644 --- a/LEGO1/lego/legoomni/src/paths/legoanimactor.cpp +++ b/LEGO1/lego/legoomni/src/paths/legoanimactor.cpp @@ -30,7 +30,7 @@ LegoAnimActorStruct::~LegoAnimActorStruct() } // FUNCTION: LEGO1 0x1001c130 -// FUNCTION: BETA10 0x1003df5f +// FUNCTION: BETA10 0x1003df3a float LegoAnimActorStruct::GetDuration() { assert(m_AnimTreePtr); @@ -70,8 +70,11 @@ void LegoAnimActor::VTable0x74(Matrix4& p_transform) } // FUNCTION: LEGO1 0x1001c290 +// FUNCTION: BETA10 0x1003e144 void LegoAnimActor::VTable0x70(float p_time) { + assert(m_roi); + if (m_lastTime == 0) { m_lastTime = p_time - 1.0f; } diff --git a/LEGO1/lego/legoomni/src/paths/legopathactor.cpp b/LEGO1/lego/legoomni/src/paths/legopathactor.cpp index 1d5bb959..3c859936 100644 --- a/LEGO1/lego/legoomni/src/paths/legopathactor.cpp +++ b/LEGO1/lego/legoomni/src/paths/legopathactor.cpp @@ -380,6 +380,7 @@ void LegoPathActor::VTable0x74(Matrix4& p_transform) } // FUNCTION: LEGO1 0x1002e790 +// FUNCTION: BETA10 0x100af208 void LegoPathActor::VTable0x70(float p_time) { MxMatrix transform; diff --git a/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp b/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp index 15140eca..c827043f 100644 --- a/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp @@ -289,6 +289,7 @@ void LegoAnimPresenter::FUN_100692b0() } // FUNCTION: LEGO1 0x100695c0 +// FUNCTION: BETA10 0x1004f359 void LegoAnimPresenter::FUN_100695c0() { m_unk0x70 = new LegoROIList(); diff --git a/LEGO1/lego/legoomni/src/worlds/legoact2.cpp b/LEGO1/lego/legoomni/src/worlds/legoact2.cpp index 9119eb1b..f25a77ab 100644 --- a/LEGO1/lego/legoomni/src/worlds/legoact2.cpp +++ b/LEGO1/lego/legoomni/src/worlds/legoact2.cpp @@ -659,6 +659,20 @@ MxLong LegoAct2::HandlePathStruct(LegoPathStructNotificationParam& p_param) return 0; } +// STUB: LEGO1 0x100516b0 +// STUB: BETA10 0x1003bcbc +MxResult LegoAct2::FUN_100516b0() +{ + // TODO + return SUCCESS; +} + +// STUB: LEGO1 0x100517b0 +void LegoAct2::FUN_100517b0() +{ + // TODO +} + // FUNCTION: LEGO1 0x10051840 void LegoAct2::PlayMusic(JukeboxScript::Script p_objectId) { diff --git a/LEGO1/lego/sources/3dmanager/lego3dview.h b/LEGO1/lego/sources/3dmanager/lego3dview.h index 9e0f69eb..1f878a53 100644 --- a/LEGO1/lego/sources/3dmanager/lego3dview.h +++ b/LEGO1/lego/sources/3dmanager/lego3dview.h @@ -46,7 +46,7 @@ class Lego3DView : public LegoView1 { // // Lego3DView implementation -// FUNCTION: BETA10 0x100576b0 +// FUNCTION: BETA10 0x10011810 inline ViewManager* Lego3DView::GetViewManager() { return m_pViewManager; diff --git a/LEGO1/mxgeometry/mxmatrix.h b/LEGO1/mxgeometry/mxmatrix.h index 55a17da1..9f1aa59f 100644 --- a/LEGO1/mxgeometry/mxmatrix.h +++ b/LEGO1/mxgeometry/mxmatrix.h @@ -13,6 +13,7 @@ class MxMatrix : public Matrix4 { MxMatrix() : Matrix4(m_elements) {} // FUNCTION: LEGO1 0x10032770 + // FUNCTION: BETA10 0x1001ff30 MxMatrix(const MxMatrix& p_matrix) : Matrix4(m_elements) { Equals(p_matrix); } // FUNCTION: BETA10 0x1000fc20 diff --git a/LEGO1/viewmanager/viewmanager.h b/LEGO1/viewmanager/viewmanager.h index 92236873..051fe0fa 100644 --- a/LEGO1/viewmanager/viewmanager.h +++ b/LEGO1/viewmanager/viewmanager.h @@ -39,7 +39,9 @@ class ViewManager { inline static int CalculateLODLevel(float p_und1, float p_und2, ViewROI* p_roi); inline static int IsROIVisibleAtLOD(ViewROI* p_roi); + // FUNCTION: BETA10 0x100576b0 const CompoundObject& GetROIs() { return rois; } + void Add(ViewROI* p_roi) { rois.push_back(p_roi); } // SYNTHETIC: LEGO1 0x100a6000