From 8f47013e43a1585bfe7ba1fea244bda9e4e73670 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 3 Apr 2020 08:49:15 -0700 Subject: [PATCH] Some more ALfloat->float cleanup --- alc/alu.cpp | 16 ++++++++-------- alc/alu.h | 34 +++++++++++++++++----------------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/alc/alu.cpp b/alc/alu.cpp index b8befd03..9df3a605 100644 --- a/alc/alu.cpp +++ b/alc/alu.cpp @@ -111,9 +111,9 @@ namespace { using namespace std::placeholders; -ALfloat InitConeScale() +float InitConeScale() { - ALfloat ret{1.0f}; + float ret{1.0f}; if(auto optval = al::getenv("__ALSOFT_HALF_ANGLE_CONES")) { if(al::strcasecmp(optval->c_str(), "true") == 0 @@ -123,9 +123,9 @@ ALfloat InitConeScale() return ret; } -ALfloat InitZScale() +float InitZScale() { - ALfloat ret{1.0f}; + float ret{1.0f}; if(auto optval = al::getenv("__ALSOFT_REVERSE_Z")) { if(al::strcasecmp(optval->c_str(), "true") == 0 @@ -138,17 +138,17 @@ ALfloat InitZScale() } // namespace /* Cone scalar */ -const ALfloat ConeScale{InitConeScale()}; +const float ConeScale{InitConeScale()}; /* Localized Z scalar for mono sources */ -const ALfloat ZScale{InitZScale()}; +const float ZScale{InitZScale()}; namespace { struct ChanMap { Channel channel; - ALfloat angle; - ALfloat elevation; + float angle; + float elevation; }; HrtfDirectMixerFunc MixDirectHrtf{MixDirectHrtf_}; diff --git a/alc/alu.h b/alc/alu.h index ac07b4a6..0b6aa103 100644 --- a/alc/alu.h +++ b/alc/alu.h @@ -32,30 +32,30 @@ extern MixerFunc MixSamples; extern RowMixerFunc MixRowSamples; -#define GAIN_MIX_MAX (1000.0f) /* +60dB */ +#define GAIN_MIX_MAX 1000.0f /* +60dB */ -#define GAIN_SILENCE_THRESHOLD (0.00001f) /* -100dB */ +#define GAIN_SILENCE_THRESHOLD 0.00001f /* -100dB */ -#define SPEEDOFSOUNDMETRESPERSEC (343.3f) -#define AIRABSORBGAINHF (0.99426f) /* -0.05dB */ +#define SPEEDOFSOUNDMETRESPERSEC 343.3f +#define AIRABSORBGAINHF 0.99426f /* -0.05dB */ /* Target gain for the reverb decay feedback reaching the decay time. */ -#define REVERB_DECAY_GAIN (0.001f) /* -60 dB */ +#define REVERB_DECAY_GAIN 0.001f /* -60 dB */ -#define FRACTIONBITS (12) +#define FRACTIONBITS 12 #define FRACTIONONE (1< gains); -inline std::array GetAmbiIdentityRow(size_t i) noexcept +inline std::array GetAmbiIdentityRow(size_t i) noexcept { - std::array ret{}; + std::array ret{}; ret[i] = 1.0f; return ret; } @@ -153,7 +153,7 @@ void aluMixData(ALCdevice *device, void *OutBuffer, const ALuint NumSamples, /* Caller must lock the device state, and the mixer must not be running. */ void aluHandleDisconnect(ALCdevice *device, const char *msg, ...) DECL_FORMAT(printf, 2, 3); -extern const ALfloat ConeScale; -extern const ALfloat ZScale; +extern const float ConeScale; +extern const float ZScale; #endif