mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 16:22:45 +03:00
feat(sound): add SI2::StopGlueMusic
This commit is contained in:
parent
5b714b0650
commit
485a93aa30
@ -1018,6 +1018,18 @@ void SI2::StartGlueMusic(const char* name) {
|
|||||||
EventRegister(EVENT_ID_POLL, &SI2::GlueMusicUpdate);
|
EventRegister(EVENT_ID_POLL, &SI2::GlueMusicUpdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32_t SI2::StopGlueMusic(float fadeOutTime) {
|
||||||
|
EventUnregister(EVENT_ID_POLL, &SI2::GlueMusicUpdate);
|
||||||
|
|
||||||
|
s_GlueMusicName[0] = '\0';
|
||||||
|
|
||||||
|
if (fadeOutTime < 0.0f) {
|
||||||
|
fadeOutTime = -1.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
return SI2::StopOrFadeOut(&s_GlueMusicObject, 0, fadeOutTime, 1);
|
||||||
|
}
|
||||||
|
|
||||||
int32_t SI2::StopOrFadeOut(SOUNDKITOBJECT* object, int32_t stop, float fadeOutTime, int32_t a4) {
|
int32_t SI2::StopOrFadeOut(SOUNDKITOBJECT* object, int32_t stop, float fadeOutTime, int32_t a4) {
|
||||||
auto userData = static_cast<SI2USERDATA*>(object->m_sound.GetUserData());
|
auto userData = static_cast<SI2USERDATA*>(object->m_sound.GetUserData());
|
||||||
|
|
||||||
|
|||||||
@ -36,6 +36,7 @@ class SI2 {
|
|||||||
static void RegisterUserCVars();
|
static void RegisterUserCVars();
|
||||||
static void RegisterScriptFunctions();
|
static void RegisterScriptFunctions();
|
||||||
static void StartGlueMusic(const char* name);
|
static void StartGlueMusic(const char* name);
|
||||||
|
static int32_t StopGlueMusic(float fadeOutTime);
|
||||||
static int32_t StopOrFadeOut(SOUNDKITOBJECT* object, int32_t stop, float fadeOutTime, int32_t a4);
|
static int32_t StopOrFadeOut(SOUNDKITOBJECT* object, int32_t stop, float fadeOutTime, int32_t a4);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user