diff --git a/LEGO1/lego/legoomni/include/act2brick.h b/LEGO1/lego/legoomni/include/act2brick.h index 26c51f8c..e2a62ca1 100644 --- a/LEGO1/lego/legoomni/include/act2brick.h +++ b/LEGO1/lego/legoomni/include/act2brick.h @@ -8,6 +8,13 @@ // SIZE 0x194 class Act2Brick : public LegoPathActor { public: + enum { + e_removed = 0, + e_created = 1, + e_placed = 2, + e_atRest = 3, + }; + Act2Brick(); ~Act2Brick() override; // vtable+0x00 @@ -35,7 +42,7 @@ public: MxResult Create(MxS32 p_index); void Remove(); - void FUN_1007a670(MxMatrix& p_param1, MxMatrix& p_param2, LegoPathBoundary* p_boundary); + void Place(MxMatrix& p_localToWorld, MxMatrix& p_endLocalToWorld, LegoPathBoundary* p_boundary); void PlayWhistleSound(); void StopWhistleSound(); void Mute(MxBool p_muted); @@ -44,12 +51,12 @@ private: static const LegoChar* g_lodNames[]; static MxLong g_lastHitActorTime; - LegoCacheSound* m_whistleSound; // 0x154 - undefined m_unk0x158[0x0c]; // 0x158 - undefined4 m_unk0x164; // 0x164 - Mx3DPointFloat m_unk0x168; // 0x168 - Mx3DPointFloat m_unk0x17c; // 0x17c - MxS32 m_unk0x190; // 0x190 + LegoCacheSound* m_whistleSound; // 0x154 + undefined m_unk0x158[0x0c]; // 0x158 + MxU32 m_state; // 0x164 + Mx3DPointFloat m_localToWorldMovementStep; // 0x168 + Mx3DPointFloat m_endLocalToWorld; // 0x17c + MxS32 m_step; // 0x190 }; #endif // ACT2BRICK_H diff --git a/LEGO1/lego/legoomni/src/entity/act2brick.cpp b/LEGO1/lego/legoomni/src/entity/act2brick.cpp index 16e0d2eb..7fc1d64c 100644 --- a/LEGO1/lego/legoomni/src/entity/act2brick.cpp +++ b/LEGO1/lego/legoomni/src/entity/act2brick.cpp @@ -31,7 +31,7 @@ MxLong Act2Brick::g_lastHitActorTime = 0; Act2Brick::Act2Brick() { m_whistleSound = NULL; - m_unk0x164 = 0; + m_state = Act2Brick::e_removed; } // FUNCTION: LEGO1 0x1007a470 @@ -72,7 +72,7 @@ MxResult Act2Brick::Create(MxS32 p_index) m_roi->SetEntity(this); CurrentWorld()->Add(this); - m_unk0x164 = 1; + m_state = Act2Brick::e_created; return SUCCESS; } @@ -88,27 +88,27 @@ void Act2Brick::Remove() m_roi = NULL; } - m_unk0x164 = 0; + m_state = Act2Brick::e_removed; } // FUNCTION: LEGO1 0x1007a670 // FUNCTION: BETA10 0x10012c04 -void Act2Brick::FUN_1007a670(MxMatrix& p_param1, MxMatrix& p_param2, LegoPathBoundary* p_boundary) +void Act2Brick::Place(MxMatrix& p_localToWorld, MxMatrix& p_endLocalToWorld, LegoPathBoundary* p_boundary) { - m_unk0x17c = p_param2[3]; - m_unk0x168 = p_param2[3]; - m_unk0x168 -= p_param1[3]; - m_unk0x168 /= 8.0f; + m_endLocalToWorld = p_endLocalToWorld[3]; + m_localToWorldMovementStep = p_endLocalToWorld[3]; + m_localToWorldMovementStep -= p_localToWorld[3]; + m_localToWorldMovementStep /= 8.0f; - m_unk0x190 = 0; + m_step = 0; TickleManager()->RegisterClient(this, 20); - m_unk0x164 = 2; + m_state = Act2Brick::e_placed; CurrentWorld()->PlaceActor(this); p_boundary->AddActor(this); SetActorState(c_disabled); - m_roi->SetLocal2World(p_param1); + m_roi->SetLocal2World(p_localToWorld); m_roi->WrappedUpdateWorldData(); m_roi->SetVisibility(TRUE); } @@ -136,15 +136,15 @@ MxResult Act2Brick::HitActor(LegoPathActor* p_actor, MxBool) MxResult Act2Brick::Tickle() { MxMatrix local2world(m_roi->GetLocal2World()); - m_unk0x190++; + m_step++; - if (m_unk0x190 >= 8) { - local2world.SetTranslation(m_unk0x17c[0], m_unk0x17c[1], m_unk0x17c[2]); - m_unk0x164 = 3; + if (m_step >= 8) { + local2world.SetTranslation(m_endLocalToWorld[0], m_endLocalToWorld[1], m_endLocalToWorld[2]); + m_state = Act2Brick::e_atRest; TickleManager()->UnregisterClient(this); } else { - VPV3(local2world[3], local2world[3], m_unk0x168); + VPV3(local2world[3], local2world[3], m_localToWorldMovementStep); } m_roi->SetLocal2World(local2world); @@ -165,7 +165,7 @@ MxLong Act2Brick::Notify(MxParam& p_param) StopWhistleSound(); } - MxNotificationParam param(c_notificationType22, this); + MxNotificationParam param(c_notificationAct2Brick, this); NotificationManager()->Send(CurrentWorld(), param); return 1; } diff --git a/LEGO1/lego/legoomni/src/worlds/legoact2.cpp b/LEGO1/lego/legoomni/src/worlds/legoact2.cpp index 5314ccad..a1bf0736 100644 --- a/LEGO1/lego/legoomni/src/worlds/legoact2.cpp +++ b/LEGO1/lego/legoomni/src/worlds/legoact2.cpp @@ -294,7 +294,7 @@ MxLong LegoAct2::Notify(MxParam& p_param) result = 1; break; } - case c_notificationType22: + case c_notificationAct2Brick: SoundManager()->GetCacheSoundManager()->Play("28bng", NULL, FALSE); m_unk0x10c1++; @@ -647,7 +647,7 @@ MxLong LegoAct2::HandlePathStruct(LegoPathStructNotificationParam& p_param) local2world[3][1] += 1.5; local2world2[3][1] -= 0.1; - m_bricks[m_nextBrick - 1].FUN_1007a670(local2world, local2world2, boundary); + m_bricks[m_nextBrick - 1].Place(local2world, local2world2, boundary); } return 0; @@ -671,7 +671,7 @@ MxResult LegoAct2::FUN_100516b0() local2world[3][1] += 1.3; local2world2[3][1] -= 0.1; - brick.FUN_1007a670(local2world, local2world2, boundary); + brick.Place(local2world, local2world2, boundary); m_nextBrick++; m_unk0x10c4 = 9; m_unk0x10d0 = 0; diff --git a/LEGO1/omni/include/mxnotificationparam.h b/LEGO1/omni/include/mxnotificationparam.h index c2a95de8..a7c8fc19 100644 --- a/LEGO1/omni/include/mxnotificationparam.h +++ b/LEGO1/omni/include/mxnotificationparam.h @@ -29,7 +29,7 @@ enum NotificationId { c_notificationPathStruct = 19, // 100d6230 c_notificationType20 = 20, c_notificationNewPresenter = 21, - c_notificationType22 = 22, + c_notificationAct2Brick = 22, c_notificationType23 = 23, c_notificationTransitioned = 24 };