diff --git a/include/GEngine/libdev/systems/driver/output/AudioManager.hpp b/include/GEngine/libdev/systems/driver/output/AudioManager.hpp index 98e62592..4da01ba2 100644 --- a/include/GEngine/libdev/systems/driver/output/AudioManager.hpp +++ b/include/GEngine/libdev/systems/driver/output/AudioManager.hpp @@ -62,6 +62,7 @@ class AudioManager geg::component::network::NetSend()); else { getMusicComponent().musicId = getMusicIdByPath(e.path); + getMusicComponent().volume = e.volume; for (auto [e, _unused, netSend] : gengine::Zip(musics, netSends)) { netSend.update(); break; diff --git a/include/GEngine/libdev/systems/events/driver/output/Sound.hpp b/include/GEngine/libdev/systems/events/driver/output/Sound.hpp index cbe96050..87282dad 100644 --- a/include/GEngine/libdev/systems/events/driver/output/Sound.hpp +++ b/include/GEngine/libdev/systems/events/driver/output/Sound.hpp @@ -40,10 +40,12 @@ struct SoundPlayed : public Event { }; struct Music : public Event { - Music(const std::string &path) - : path(path) { + Music(const std::string &path, float volume = 1.f) + : path(path) + , volume(volume) { } const std::string path; + const float volume; }; } // namespace gengine::system::event::driver::output