diff --git a/src/sound/SESound.cpp b/src/sound/SESound.cpp index 746384e..1bed896 100644 --- a/src/sound/SESound.cpp +++ b/src/sound/SESound.cpp @@ -599,6 +599,22 @@ void SESound::Play() { } } +void SESound::SetFadeInTime(float fadeInTime) { + if (!this->m_internal) { + return; + } + + this->m_internal->m_fadeInTime = fadeInTime; +} + +void SESound::SetFadeOutTime(float fadeOutTime) { + if (!this->m_internal) { + return; + } + + this->m_internal->m_fadeOutTime = fadeOutTime; +} + void SESound::SetUserData(SEUserData* userData) { if (!this->m_internal) { return; diff --git a/src/sound/SESound.hpp b/src/sound/SESound.hpp index 045ecd3..c191194 100644 --- a/src/sound/SESound.hpp +++ b/src/sound/SESound.hpp @@ -40,6 +40,8 @@ class SESound { bool IsPlaying(); int32_t Load(const char* filename, int32_t a3, FMOD::SoundGroup* soundGroup1, FMOD::SoundGroup* soundGroup2, bool a6, bool a7, uint32_t a8, int32_t a9, uint32_t a10); void Play(); + void SetFadeInTime(float fadeInTime); + void SetFadeOutTime(float fadeOutTime); void SetUserData(SEUserData* userData); private: diff --git a/src/sound/SESoundInternal.hpp b/src/sound/SESoundInternal.hpp index 1a09948..8b7e649 100644 --- a/src/sound/SESoundInternal.hpp +++ b/src/sound/SESoundInternal.hpp @@ -31,6 +31,12 @@ class SESoundInternal : public TSLinkedNode { FMOD::Channel* m_fmodChannel = nullptr; SESound* m_sound = nullptr; SEUserData* m_userData = nullptr; + float m_volume = 1.0f; + float m_fadeVolume = 0.0f; + float m_fadeInTime = 0.0f; + float m_fadeOutTime = 0.0f; + uint8_t m_fadeIn = 0; + uint8_t m_fadeOut = 0; // TODO int32_t m_useCache = 0; int32_t m_type = 0; diff --git a/src/sound/SI2.cpp b/src/sound/SI2.cpp index 3fc1586..df38bdc 100644 --- a/src/sound/SI2.cpp +++ b/src/sound/SI2.cpp @@ -426,6 +426,16 @@ int32_t SI2::PlaySoundKit(int32_t id, int32_t a2, SOUNDKITOBJECT* object, SoundK // TODO + if (properties->m_fadeInTime >= 0.0f) { + sound->SetFadeInTime(properties->m_fadeInTime); + } + + if (properties->m_fadeOutTime >= 0.0f) { + sound->SetFadeOutTime(properties->m_fadeOutTime); + } + + // TODO + sound->CompleteLoad(); // TODO diff --git a/src/sound/SoundKitProperties.cpp b/src/sound/SoundKitProperties.cpp index 816e63b..77261da 100644 --- a/src/sound/SoundKitProperties.cpp +++ b/src/sound/SoundKitProperties.cpp @@ -8,6 +8,9 @@ void SoundKitProperties::ResetToDefaults() { // TODO + this->m_fadeInTime = 0.0f; + this->m_fadeOutTime = 0.0f; + this->m_type = 0; // TODO diff --git a/src/sound/SoundKitProperties.hpp b/src/sound/SoundKitProperties.hpp index 1e8d6d8..0efce52 100644 --- a/src/sound/SoundKitProperties.hpp +++ b/src/sound/SoundKitProperties.hpp @@ -8,6 +8,9 @@ class SoundKitProperties { // Member variables uint32_t m_type; // TODO + float m_fadeInTime; + float m_fadeOutTime; + // TODO int32_t int20; uint32_t uint24; uint32_t uint28;