From 6c2abde5c99a236453b795abaa6d7d70105e31f7 Mon Sep 17 00:00:00 2001 From: untodesu Date: Fri, 26 Dec 2025 14:50:33 +0500 Subject: Just a big Ctrl+H refactoring --- src/game/client/world/voxel_sounds.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/game/client/world/voxel_sounds.cc') 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> footsteps_sounds[world::VMAT_COUNT]; +static std::vector> 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(name)) { footsteps_sounds[material].push_back(effect); } } -static resource_ptr get_footsteps_effect(world::VoxelMaterial material) +static resource_ptr get_footsteps_effect(VoxelMaterial material) { auto surface_index = static_cast(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 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 world::voxel_sounds::get_footsteps(world::VoxelMaterial material) +resource_ptr voxel_sounds::get_footsteps(VoxelMaterial material) { if(auto effect = get_footsteps_effect(material)) { return effect; @@ -77,7 +77,7 @@ resource_ptr world::voxel_sounds::get_footsteps(world::VoxelMateria return nullptr; } -resource_ptr world::voxel_sounds::get_placebreak(world::VoxelMaterial material) +resource_ptr voxel_sounds::get_placebreak(VoxelMaterial material) { return nullptr; } -- cgit