diff --git a/sources/Component/Music/MusicComponent.cpp b/sources/Component/Music/MusicComponent.cpp index a792a186..49bb03ff 100644 --- a/sources/Component/Music/MusicComponent.cpp +++ b/sources/Component/Music/MusicComponent.cpp @@ -12,6 +12,7 @@ namespace BBM _musicPath(musicPath), _music(RAY::Audio::Music(musicPath)) { + this->volume = 1; } WAL::Component *MusicComponent::clone(WAL::Entity &entity) const diff --git a/sources/Component/Music/MusicComponent.hpp b/sources/Component/Music/MusicComponent.hpp index 5761437b..2d291e47 100644 --- a/sources/Component/Music/MusicComponent.hpp +++ b/sources/Component/Music/MusicComponent.hpp @@ -44,7 +44,7 @@ namespace BBM //! @brief A Music component is not assignable MusicComponent &operator=(const MusicComponent &) = delete; //! @brief Volume of the muisc - float volume = 1; + static float volume; private: //! @brief music of this entity RAY::Audio::Music _music; diff --git a/sources/Component/Sound/SoundComponent.cpp b/sources/Component/Sound/SoundComponent.cpp index dd492c03..ddbddb77 100644 --- a/sources/Component/Sound/SoundComponent.cpp +++ b/sources/Component/Sound/SoundComponent.cpp @@ -14,6 +14,7 @@ const std::map &soundPath) _soundIndex(IDLE), _soundPath(soundPath) { + this->volume = 1; for (int i = 0; i <= DEATH; i++) { if (soundPath.at(static_cast(i)).empty()) { this->_isLoad[static_cast(i)] = false; diff --git a/sources/Component/Sound/SoundComponent.hpp b/sources/Component/Sound/SoundComponent.hpp index a953f6da..792140ab 100644 --- a/sources/Component/Sound/SoundComponent.hpp +++ b/sources/Component/Sound/SoundComponent.hpp @@ -61,7 +61,7 @@ namespace BBM //! @brief A Sound component is not assignable SoundComponent &operator=(const SoundComponent &) = delete; //! @brief Volume of the sounds - float volume = 1; + static float volume; private: //! @brief Sounds of this entity