diff options
| author | untodesu <kirill@untode.su> | 2025-12-26 14:50:33 +0500 |
|---|---|---|
| committer | untodesu <kirill@untode.su> | 2025-12-26 14:50:33 +0500 |
| commit | 6c2abde5c99a236453b795abaa6d7d70105e31f7 (patch) | |
| tree | f085049b9615a7d03cca5de40adb6529d6c13e11 /src/game/client/world/voxel_sounds.cc | |
| parent | f40d09cb8f712e87691af4912f3630d92d692779 (diff) | |
| download | voxelius-6c2abde5c99a236453b795abaa6d7d70105e31f7.tar.bz2 voxelius-6c2abde5c99a236453b795abaa6d7d70105e31f7.zip | |
Just a big Ctrl+H refactoring
Diffstat (limited to 'src/game/client/world/voxel_sounds.cc')
| -rw-r--r-- | src/game/client/world/voxel_sounds.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/game/client/world/voxel_sounds.cc b/src/game/client/world/voxel_sounds.cc index 42552f5..b60df94 100644 --- a/src/game/client/world/voxel_sounds.cc +++ b/src/game/client/world/voxel_sounds.cc @@ -4,21 +4,21 @@ #include "client/resource/sound_effect.hh" -static std::vector<resource_ptr<SoundEffect>> footsteps_sounds[world::VMAT_COUNT]; +static std::vector<resource_ptr<SoundEffect>> footsteps_sounds[VMAT_COUNT]; static std::mt19937_64 randomizer; -static void add_footsteps_effect(world::VoxelMaterial material, std::string_view name) +static void add_footsteps_effect(VoxelMaterial material, std::string_view name) { if(auto effect = resource::load<SoundEffect>(name)) { footsteps_sounds[material].push_back(effect); } } -static resource_ptr<SoundEffect> get_footsteps_effect(world::VoxelMaterial material) +static resource_ptr<SoundEffect> get_footsteps_effect(VoxelMaterial material) { auto surface_index = static_cast<std::size_t>(material); - if(surface_index >= world::VMAT_COUNT) { + if(surface_index >= VMAT_COUNT) { // Surface index out of range return nullptr; } @@ -34,7 +34,7 @@ static resource_ptr<SoundEffect> get_footsteps_effect(world::VoxelMaterial mater return sounds.at(dist(randomizer)); } -void world::voxel_sounds::init(void) +void voxel_sounds::init(void) { add_footsteps_effect(VMAT_DEFAULT, "sounds/surface/default1.wav"); add_footsteps_effect(VMAT_DEFAULT, "sounds/surface/default2.wav"); @@ -57,14 +57,14 @@ void world::voxel_sounds::init(void) add_footsteps_effect(VMAT_WOOD, "sounds/surface/wood3.wav"); } -void world::voxel_sounds::shutdown(void) +void voxel_sounds::shutdown(void) { - for(std::size_t i = 0; i < world::VMAT_COUNT; ++i) { + for(std::size_t i = 0; i < VMAT_COUNT; ++i) { footsteps_sounds[i].clear(); } } -resource_ptr<SoundEffect> world::voxel_sounds::get_footsteps(world::VoxelMaterial material) +resource_ptr<SoundEffect> voxel_sounds::get_footsteps(VoxelMaterial material) { if(auto effect = get_footsteps_effect(material)) { return effect; @@ -77,7 +77,7 @@ resource_ptr<SoundEffect> world::voxel_sounds::get_footsteps(world::VoxelMateria return nullptr; } -resource_ptr<SoundEffect> world::voxel_sounds::get_placebreak(world::VoxelMaterial material) +resource_ptr<SoundEffect> voxel_sounds::get_placebreak(VoxelMaterial material) { return nullptr; } |
