mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-08 17:57:02 +08:00
fix(audio): set distance model, reduce max distance, fix sound pos
- Set OpenAL distance model to AL_INVERSE_DISTANCE_CLAMPED in engine. - Reduced AL_MAX_DISTANCE from 100 to 48 for better falloff. - Fixed block sound position to use world coordinates instead of local block coordinates.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "Cubed/audio/audio_engine.hpp"
|
||||
|
||||
#include "Cubed/audio/audio_error.hpp"
|
||||
#include "Cubed/config.hpp"
|
||||
#include "Cubed/tools/cubed_assert.hpp"
|
||||
#include "Cubed/tools/log.hpp"
|
||||
@@ -34,6 +35,9 @@ void AudioEngine::init() {
|
||||
}
|
||||
alcMakeContextCurrent(context);
|
||||
|
||||
alDistanceModel(AL_INVERSE_DISTANCE_CLAMPED);
|
||||
check_al_error();
|
||||
|
||||
auto& config = Config::get();
|
||||
|
||||
m_music_volume = static_cast<float>(config.get<double>("volume.music"));
|
||||
|
||||
Reference in New Issue
Block a user