diff options
| author | untodesu <kirill@untode.su> | 2025-12-26 22:32:38 +0500 |
|---|---|---|
| committer | untodesu <kirill@untode.su> | 2025-12-26 22:32:38 +0500 |
| commit | 6bb4233d5b2a1688e63c947542e92ec5d5a857a6 (patch) | |
| tree | a1321e1f515e5a89949596d188c541e93144f43e /src/game/client/io/sound.hh | |
| parent | 2103ce38edb160b2cc982b341535e1f147e66360 (diff) | |
| download | voxelius-6bb4233d5b2a1688e63c947542e92ec5d5a857a6.tar.bz2 voxelius-6bb4233d5b2a1688e63c947542e92ec5d5a857a6.zip | |
move sound code to io
Diffstat (limited to 'src/game/client/io/sound.hh')
| -rw-r--r-- | src/game/client/io/sound.hh | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/game/client/io/sound.hh b/src/game/client/io/sound.hh new file mode 100644 index 0000000..d96d0c4 --- /dev/null +++ b/src/game/client/io/sound.hh @@ -0,0 +1,43 @@ +#pragma once + +#include "core/resource/resource.hh" + +namespace config +{ +class Float; +} // namespace config + +struct SoundEffect; + +namespace sound +{ +extern config::Float volume_master; +extern config::Float volume_effects; +extern config::Float volume_music; +extern config::Float volume_ui; +} // namespace sound + +namespace sound +{ +void init_config(void); +void init(void); +void init_late(void); +void shutdown(void); +void update(void); +} // namespace sound + +namespace sound +{ +void play_generic(std::string_view sound, bool looping, float pitch); +void play_entity(entt::entity entity, std::string_view sound, bool looping, float pitch); +void play_player(std::string_view sound, bool looping, float pitch); +void play_ui(std::string_view sound, bool looping, float pitch); +} // namespace sound + +namespace sound +{ +void play_generic(resource_ptr<SoundEffect> sound, bool looping, float pitch); +void play_entity(entt::entity entity, resource_ptr<SoundEffect> sound, bool looping, float pitch); +void play_player(resource_ptr<SoundEffect> sound, bool looping, float pitch); +void play_ui(resource_ptr<SoundEffect> sound, bool looping, float pitch); +} // namespace sound |
