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/entity/sound_emitter.cc | |
| parent | f40d09cb8f712e87691af4912f3630d92d692779 (diff) | |
| download | voxelius-6c2abde5c99a236453b795abaa6d7d70105e31f7.tar.bz2 voxelius-6c2abde5c99a236453b795abaa6d7d70105e31f7.zip | |
Just a big Ctrl+H refactoring
Diffstat (limited to 'src/game/client/entity/sound_emitter.cc')
| -rw-r--r-- | src/game/client/entity/sound_emitter.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/game/client/entity/sound_emitter.cc b/src/game/client/entity/sound_emitter.cc index 57909ec..79b5ab0 100644 --- a/src/game/client/entity/sound_emitter.cc +++ b/src/game/client/entity/sound_emitter.cc @@ -19,35 +19,35 @@ #include "client/globals.hh" -entity::SoundEmitter::SoundEmitter(void) +SoundEmitter::SoundEmitter(void) { alGenSources(1, &source); sound = nullptr; } -entity::SoundEmitter::~SoundEmitter(void) +SoundEmitter::~SoundEmitter(void) { alSourceStop(source); alDeleteSources(1, &source); } -void entity::SoundEmitter::update(void) +void SoundEmitter::update(void) { if(globals::dimension) { - const auto view = globals::dimension->entities.view<entity::SoundEmitter>(); + const auto view = globals::dimension->entities.view<SoundEmitter>(); - const auto& pivot = entity::camera::position_chunk; + const auto& pivot = camera::position_chunk; const auto gain = glm::clamp(sound::volume_effects.get_value() * 0.01f, 0.0f, 1.0f); for(const auto [entity, emitter] : view.each()) { alSourcef(emitter.source, AL_GAIN, gain); - if(const auto transform = globals::dimension->entities.try_get<entity::client::TransformIntr>(entity)) { + if(const auto transform = globals::dimension->entities.try_get<client::TransformIntr>(entity)) { auto position = coord::to_relative(pivot, transform->chunk, transform->local); alSource3f(emitter.source, AL_POSITION, position.x, position.y, position.z); } - if(const auto velocity = globals::dimension->entities.try_get<entity::Velocity>(entity)) { + if(const auto velocity = globals::dimension->entities.try_get<Velocity>(entity)) { alSource3f(emitter.source, AL_VELOCITY, velocity->value.x, velocity->value.y, velocity->value.z); } |
