fix non static volume

This commit is contained in:
Askou
2021-06-08 16:48:31 +02:00
parent 64c8d12bce
commit f12497ced6
4 changed files with 4 additions and 2 deletions
@@ -12,6 +12,7 @@ namespace BBM
_musicPath(musicPath),
_music(RAY::Audio::Music(musicPath))
{
this->volume = 1;
}
WAL::Component *MusicComponent::clone(WAL::Entity &entity) const
+1 -1
View File
@@ -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;
@@ -14,6 +14,7 @@ const std::map<SoundComponent::soundIndex, std::string> &soundPath)
_soundIndex(IDLE),
_soundPath(soundPath)
{
this->volume = 1;
for (int i = 0; i <= DEATH; i++) {
if (soundPath.at(static_cast<soundIndex>(i)).empty()) {
this->_isLoad[static_cast<soundIndex>(i)] = false;
+1 -1
View File
@@ -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