diff --git a/LEGO1/lego/legoomni/include/legoanimationmanager.h b/LEGO1/lego/legoomni/include/legoanimationmanager.h index 62aa66eb..148b3750 100644 --- a/LEGO1/lego/legoomni/include/legoanimationmanager.h +++ b/LEGO1/lego/legoomni/include/legoanimationmanager.h @@ -125,6 +125,7 @@ class LegoAnimationManager : public MxCore { MxBool FUN_10062710(AnimInfo& p_info); void FUN_10063aa0(); void FUN_100648f0(LegoTranInfo*, MxLong); + void FUN_10064b50(undefined4); MxS32 m_scriptIndex; // 0x08 MxU16 m_animCount; // 0x0c @@ -132,7 +133,7 @@ class LegoAnimationManager : public MxCore { MxU16 m_unk0x10; // 0x10 AnimInfo* m_anims; // 0x14 undefined2 m_unk0x18; // 0x18 - undefined m_unk0x1a; // 0x1a + MxBool m_unk0x1a; // 0x1a MxU32 m_unk0x1c; // 0x1c LegoTranInfoList* m_tranInfoList; // 0x20 LegoTranInfoList* m_tranInfoList2; // 0x24 @@ -159,8 +160,8 @@ class LegoAnimationManager : public MxCore { MxBool m_unk0x429; // 0x429 undefined m_unk0x42a; // 0x42a MxBool m_suspended; // 0x42b - undefined4 m_unk0x42c; // 0x42c - undefined m_unk0x430; // 0x430 + LegoTranInfo* m_unk0x42c; // 0x42c + MxBool m_unk0x430; // 0x430 undefined4 m_unk0x434[2]; // 0x434 MxMatrix m_unk0x43c; // 0x43c MxMatrix m_unk0x484; // 0x484 diff --git a/LEGO1/lego/legoomni/include/legotraninfo.h b/LEGO1/lego/legoomni/include/legotraninfo.h index c15617e8..93a56e2c 100644 --- a/LEGO1/lego/legoomni/include/legotraninfo.h +++ b/LEGO1/lego/legoomni/include/legotraninfo.h @@ -31,6 +31,8 @@ struct LegoTranInfo { m_unk0x2c.SetIdentity(); } + ~LegoTranInfo() { delete m_unk0x0c; } + AnimInfo* m_animInfo; // 0x00 MxU32 m_index; // 0x04 LegoROI* m_unk0x08; // 0x08 diff --git a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp index 52f71ef9..37f130bb 100644 --- a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp +++ b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp @@ -235,7 +235,7 @@ void LegoAnimationManager::Suspend() } m_unk0x18 = 0; - m_unk0x1a = 0; + m_unk0x1a = FALSE; m_unk0x3a = FALSE; m_unk0x400 = FALSE; m_unk0x414 = 0; @@ -270,7 +270,7 @@ void LegoAnimationManager::Init() m_animCount = 0; m_anims = NULL; m_unk0x18 = 0; - m_unk0x1a = 0; + m_unk0x1a = FALSE; m_tranInfoList = NULL; m_tranInfoList2 = NULL; m_unk0x41c = g_legoAnimationManagerConfig <= 1 ? 10 : 20; @@ -299,8 +299,8 @@ void LegoAnimationManager::Init() m_unk0x10 = 0; m_unk0x401 = 0; m_suspended = FALSE; - m_unk0x430 = 0; - m_unk0x42c = 0; + m_unk0x430 = FALSE; + m_unk0x42c = NULL; m_unk0x408 = m_unk0x40c = m_unk0x404 = Timer()->GetTime(); m_unk0x410 = 5000; @@ -374,8 +374,8 @@ MxResult LegoAnimationManager::LoadScriptInfo(MxS32 p_scriptIndex) m_unk0x38 = FALSE; m_unk0x39 = FALSE; - m_unk0x430 = 0; - m_unk0x42c = 0; + m_unk0x430 = FALSE; + m_unk0x42c = NULL; for (j = 0; j < (MxS32) _countof(g_characters); j++) { g_characters[j].m_active = FALSE; @@ -923,10 +923,68 @@ LegoTranInfo* LegoAnimationManager::GetTranInfo(MxU32 p_index) return NULL; } -// STUB: LEGO1 0x100619f0 +// FUNCTION: LEGO1 0x100619f0 +// FUNCTION: BETA10 0x100426b1 MxLong LegoAnimationManager::Notify(MxParam& p_param) { - // TODO + if (((MxNotificationParam&) p_param).GetSender() == this) { + if (((MxNotificationParam&) p_param).GetType() == c_notificationType18) { + FUN_100605e0(m_unk0x18, TRUE, NULL, TRUE, NULL, FALSE, TRUE, TRUE, TRUE); + } + } + else if (((MxNotificationParam&) p_param).GetType() == c_notificationType18 && m_tranInfoList != NULL) { + LegoTranInfoListCursor cursor(m_tranInfoList); + LegoTranInfo* tranInfo; + + MxU32 index = ((MxType18NotificationParam&) p_param).GetUnknown0x0c(); + MxBool found = FALSE; + + while (cursor.Next(tranInfo)) { + if (tranInfo->m_index == index) { + if (m_unk0x430 && m_unk0x42c == tranInfo) { + FUN_10064b50(-1); + } + + if (tranInfo->m_flags & LegoTranInfo::c_bit2) { + BackgroundAudioManager()->RaiseVolume(); + } + + m_unk0x39 = FALSE; + m_unk0x404 = Timer()->GetTime(); + + found = TRUE; + cursor.Detach(); + delete tranInfo; + + for (MxS32 i = 0; i < (MxS32) _countof(m_unk0x3c); i++) { + LegoROI* roi = m_unk0x3c[i].m_roi; + + if (roi != NULL) { + LegoExtraActor* actor = CharacterManager()->GetActor(roi->GetName()); + + if (actor != NULL) { + actor->Restart(); + } + } + } + + break; + } + } + + if (m_unk0x1a && found) { + m_unk0x18++; + + if (m_animCount <= m_unk0x18) { + m_unk0x1a = FALSE; + } + else { + MxType18NotificationParam param(c_notificationType18, this, 0); + NotificationManager()->Send(this, param); + } + } + } + return 0; } @@ -1057,3 +1115,10 @@ void LegoAnimationManager::FUN_100648f0(LegoTranInfo*, MxLong) { // TODO } + +// STUB: LEGO1 0x10064b50 +// FUNCTION: BETA10 0x10045f14 +void LegoAnimationManager::FUN_10064b50(undefined4) +{ + // TODO +} diff --git a/LEGO1/omni/include/mxtype18notificationparam.h b/LEGO1/omni/include/mxtype18notificationparam.h index 77d3ecb9..cd5cd835 100644 --- a/LEGO1/omni/include/mxtype18notificationparam.h +++ b/LEGO1/omni/include/mxtype18notificationparam.h @@ -19,6 +19,8 @@ class MxType18NotificationParam : public MxNotificationParam { return new MxType18NotificationParam(m_type, m_sender, m_unk0x0c); } // vtable+0x04 + inline undefined4 GetUnknown0x0c() { return m_unk0x0c; } + protected: undefined4 m_unk0x0c; // 0x0c };