diff --git a/LEGO1/lego/legoomni/include/legoactor.h b/LEGO1/lego/legoomni/include/legoactor.h index 267de5a0..026f5885 100644 --- a/LEGO1/lego/legoomni/include/legoactor.h +++ b/LEGO1/lego/legoomni/include/legoactor.h @@ -53,7 +53,7 @@ public: static const char* GetActorName(MxU8 p_id); protected: - void FUN_1002d6e0(MxBool); + void Mute(MxBool p_muted); MxFloat m_frequencyFactor; // 0x68 LegoCacheSound* m_sound; // 0x6c diff --git a/LEGO1/lego/legoomni/include/legocachsound.h b/LEGO1/lego/legoomni/include/legocachsound.h index b80ded36..de312a93 100644 --- a/LEGO1/lego/legoomni/include/legocachsound.h +++ b/LEGO1/lego/legoomni/include/legocachsound.h @@ -44,6 +44,7 @@ public: void FUN_10006b80(); void FUN_10006be0(); void SetDistance(MxS32 p_min, MxS32 p_max); + void Mute(MxBool p_mute); // SYNTHETIC: LEGO1 0x10006610 // LegoCacheSound::`scalar deleting destructor' @@ -66,7 +67,7 @@ private: MxS32 m_volume; // 0x6c MxBool m_unk0x70; // 0x70 MxString m_unk0x74; // 0x74 - undefined m_unk0x84; // 0x84 + MxBool m_muted; // 0x84 }; #endif // LEGOCACHSOUND_H diff --git a/LEGO1/lego/legoomni/src/audio/legocachsound.cpp b/LEGO1/lego/legoomni/src/audio/legocachsound.cpp index 457e51f4..7665e5d7 100644 --- a/LEGO1/lego/legoomni/src/audio/legocachsound.cpp +++ b/LEGO1/lego/legoomni/src/audio/legocachsound.cpp @@ -29,7 +29,7 @@ void LegoCacheSound::Init() m_unk0x70 = FALSE; m_looping = TRUE; m_volume = 79; - m_unk0x84 = 0; + m_muted = FALSE; } // FUNCTION: LEGO1 0x10006710 @@ -226,7 +226,7 @@ void LegoCacheSound::FUN_10006be0() } } - if (m_unk0x74.GetLength() != 0 && !m_unk0x84) { + if (m_unk0x74.GetLength() != 0 && !m_muted) { if (!m_sound.UpdatePosition(m_dsBuffer)) { if (m_unk0x6a) { return; @@ -253,6 +253,22 @@ void LegoCacheSound::FUN_10006cd0(undefined4, undefined4) { } +// FUNCTION: LEGO1 0x10006d40 +// FUNCTION: BETA10 0x10066ec8 +void LegoCacheSound::Mute(MxBool p_muted) +{ + if (m_muted != p_muted) { + m_muted = p_muted; + + if (m_muted) { + m_dsBuffer->Stop(); + } + else { + m_dsBuffer->Play(0, 0, m_looping); + } + } +} + // FUNCTION: LEGO1 0x10006d80 // FUNCTION: BETA10 0x100670e7 MxString LegoCacheSound::FUN_10006d80(const MxString& p_str) diff --git a/LEGO1/lego/legoomni/src/entity/legoactor.cpp b/LEGO1/lego/legoomni/src/entity/legoactor.cpp index d7d79e1a..2377302e 100644 --- a/LEGO1/lego/legoomni/src/entity/legoactor.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoactor.cpp @@ -107,7 +107,7 @@ void LegoActor::ParseAction(char* p_extra) } if (KeyValueStringParse(value, g_strMUTE, p_extra)) { - FUN_1002d6e0(TRUE); + Mute(TRUE); } if (KeyValueStringParse(value, g_strVISIBILITY, p_extra)) { @@ -139,8 +139,10 @@ void LegoActor::SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2) LegoEntity::SetROI(p_roi, p_bool1, p_bool2); } -// STUB: LEGO1 0x1002d6e0 -void LegoActor::FUN_1002d6e0(MxBool) +// FUNCTION: LEGO1 0x1002d6e0 +void LegoActor::Mute(MxBool p_muted) { - // TODO + if (m_sound != NULL) { + m_sound->Mute(p_muted); + } }