From 5b714b0650849b0cff767c45ffb2420e81cb14f0 Mon Sep 17 00:00:00 2001 From: fallenoak Date: Thu, 27 Nov 2025 11:29:12 -0600 Subject: [PATCH] feat(sound): add SI2::StopOrFadeOut --- src/sound/SI2.cpp | 18 +++++++++++++++++- src/sound/SI2.hpp | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/sound/SI2.cpp b/src/sound/SI2.cpp index df38bdc..e5dcc28 100644 --- a/src/sound/SI2.cpp +++ b/src/sound/SI2.cpp @@ -992,7 +992,7 @@ void SI2::StartGlueMusic(const char* name) { // Stop playing credits music EventUnregister(EVENT_ID_POLL, &SI2::CreditsMusicUpdate); - // TODO SI2::Sub4C6390(&s_CreditsMusicObject, 0, 3.0, 1); + SI2::StopOrFadeOut(&s_CreditsMusicObject, 0, 3.0f, 1); if (!name) { return; @@ -1017,3 +1017,19 @@ void SI2::StartGlueMusic(const char* name) { EventRegister(EVENT_ID_POLL, &SI2::GlueMusicUpdate); } + +int32_t SI2::StopOrFadeOut(SOUNDKITOBJECT* object, int32_t stop, float fadeOutTime, int32_t a4) { + auto userData = static_cast(object->m_sound.GetUserData()); + + if (userData) { + // TODO + } + + object->m_sound.StopOrFadeOut(stop, fadeOutTime); + + if (a4) { + // TODO + } + + return 0; +} diff --git a/src/sound/SI2.hpp b/src/sound/SI2.hpp index 957c78a..5c58f45 100644 --- a/src/sound/SI2.hpp +++ b/src/sound/SI2.hpp @@ -36,6 +36,7 @@ class SI2 { static void RegisterUserCVars(); static void RegisterScriptFunctions(); static void StartGlueMusic(const char* name); + static int32_t StopOrFadeOut(SOUNDKITOBJECT* object, int32_t stop, float fadeOutTime, int32_t a4); }; #endif