aboutsummaryrefslogtreecommitdiffstats
path: root/al
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-04-08 10:15:43 -0700
committerChris Robinson <[email protected]>2020-04-08 10:15:43 -0700
commitd67cba99bd97d42e7e52c6dfd7a08c288b1539c0 (patch)
tree014425832a37173da8d9c3b2377526ce41d58d36 /al
parent8a5153ce0dee072c283b04ff5a61faa764f81743 (diff)
Clean up some more unnecessary uses of AL types
Diffstat (limited to 'al')
-rw-r--r--al/auxeffectslot.h10
-rw-r--r--al/buffer.cpp26
-rw-r--r--al/effect.h2
-rw-r--r--al/filter.cpp64
-rw-r--r--al/listener.h32
5 files changed, 67 insertions, 67 deletions
diff --git a/al/auxeffectslot.h b/al/auxeffectslot.h
index ae41a32a..c1432c56 100644
--- a/al/auxeffectslot.h
+++ b/al/auxeffectslot.h
@@ -64,12 +64,12 @@ struct ALeffectslot {
EffectProps mEffectProps{};
EffectState *mEffectState{nullptr};
- ALfloat RoomRolloff{0.0f}; /* Added to the source's room rolloff, not multiplied. */
- ALfloat DecayTime{0.0f};
- ALfloat DecayLFRatio{0.0f};
- ALfloat DecayHFRatio{0.0f};
+ float RoomRolloff{0.0f}; /* Added to the source's room rolloff, not multiplied. */
+ float DecayTime{0.0f};
+ float DecayLFRatio{0.0f};
+ float DecayHFRatio{0.0f};
bool DecayHFLimit{false};
- ALfloat AirAbsorptionGainHF{1.0f};
+ float AirAbsorptionGainHF{1.0f};
} Params;
/* Self ID */
diff --git a/al/buffer.cpp b/al/buffer.cpp
index d989a37d..4573d757 100644
--- a/al/buffer.cpp
+++ b/al/buffer.cpp
@@ -101,10 +101,10 @@ constexpr int MSADPCMAdaptionCoeff[7][2] = {
};
-void DecodeIMA4Block(ALshort *dst, const al::byte *src, size_t numchans, size_t align)
+void DecodeIMA4Block(int16_t *dst, const al::byte *src, size_t numchans, size_t align)
{
- ALint sample[MaxAdpcmChannels]{};
- ALint index[MaxAdpcmChannels]{};
+ int sample[MaxAdpcmChannels]{};
+ int index[MaxAdpcmChannels]{};
ALuint code[MaxAdpcmChannels]{};
for(size_t c{0};c < numchans;c++)
@@ -147,11 +147,11 @@ void DecodeIMA4Block(ALshort *dst, const al::byte *src, size_t numchans, size_t
}
}
-void DecodeMSADPCMBlock(ALshort *dst, const al::byte *src, size_t numchans, size_t align)
+void DecodeMSADPCMBlock(int16_t *dst, const al::byte *src, size_t numchans, size_t align)
{
ALubyte blockpred[MaxAdpcmChannels]{};
- ALint delta[MaxAdpcmChannels]{};
- ALshort samples[MaxAdpcmChannels][2]{};
+ int delta[MaxAdpcmChannels]{};
+ int16_t samples[MaxAdpcmChannels][2]{};
for(size_t c{0};c < numchans;c++)
{
@@ -195,23 +195,23 @@ void DecodeMSADPCMBlock(ALshort *dst, const al::byte *src, size_t numchans, size
else
nibble = *(src++) & 0x0f;
- ALint pred{(samples[c][0]*MSADPCMAdaptionCoeff[blockpred[c]][0] +
+ int pred{(samples[c][0]*MSADPCMAdaptionCoeff[blockpred[c]][0] +
samples[c][1]*MSADPCMAdaptionCoeff[blockpred[c]][1]) / 256};
pred += (al::to_integer<int>(nibble^0x08) - 0x08) * delta[c];
pred = clampi(pred, -32768, 32767);
samples[c][1] = samples[c][0];
- samples[c][0] = static_cast<ALshort>(pred);
+ samples[c][0] = static_cast<int16_t>(pred);
delta[c] = (MSADPCMAdaption[al::to_integer<ALubyte>(nibble)] * delta[c]) / 256;
delta[c] = maxi(16, delta[c]);
- *(dst++) = static_cast<ALshort>(pred);
+ *(dst++) = static_cast<int16_t>(pred);
}
}
}
-void Convert_ALshort_ALima4(ALshort *dst, const al::byte *src, size_t numchans, size_t len,
+void Convert_ALshort_ALima4(int16_t *dst, const al::byte *src, size_t numchans, size_t len,
size_t align)
{
assert(numchans <= MaxAdpcmChannels);
@@ -226,7 +226,7 @@ void Convert_ALshort_ALima4(ALshort *dst, const al::byte *src, size_t numchans,
}
}
-void Convert_ALshort_ALmsadpcm(ALshort *dst, const al::byte *src, size_t numchans, size_t len,
+void Convert_ALshort_ALmsadpcm(int16_t *dst, const al::byte *src, size_t numchans, size_t len,
size_t align)
{
assert(numchans <= MaxAdpcmChannels);
@@ -523,7 +523,7 @@ void LoadData(ALCcontext *context, ALbuffer *ALBuf, ALsizei freq, ALuint size,
{
assert(DstType == FmtShort);
if(SrcData != nullptr && !ALBuf->mData.empty())
- Convert_ALshort_ALima4(reinterpret_cast<ALshort*>(ALBuf->mData.data()),
+ Convert_ALshort_ALima4(reinterpret_cast<int16_t*>(ALBuf->mData.data()),
SrcData, NumChannels, frames, align);
ALBuf->OriginalAlign = align;
}
@@ -531,7 +531,7 @@ void LoadData(ALCcontext *context, ALbuffer *ALBuf, ALsizei freq, ALuint size,
{
assert(DstType == FmtShort);
if(SrcData != nullptr && !ALBuf->mData.empty())
- Convert_ALshort_ALmsadpcm(reinterpret_cast<ALshort*>(ALBuf->mData.data()),
+ Convert_ALshort_ALmsadpcm(reinterpret_cast<int16_t*>(ALBuf->mData.data()),
SrcData, NumChannels, frames, align);
ALBuf->OriginalAlign = align;
}
diff --git a/al/effect.h b/al/effect.h
index 74858dc7..76215f40 100644
--- a/al/effect.h
+++ b/al/effect.h
@@ -27,7 +27,7 @@ enum {
};
extern bool DisabledEffects[MAX_EFFECTS];
-extern ALfloat ReverbBoost;
+extern float ReverbBoost;
struct EffectList {
const char name[16];
diff --git a/al/filter.cpp b/al/filter.cpp
index 3bf54fd8..3746c1be 100644
--- a/al/filter.cpp
+++ b/al/filter.cpp
@@ -48,11 +48,11 @@ namespace {
#define FILTER_MIN_GAIN 0.0f
#define FILTER_MAX_GAIN 4.0f /* +12dB */
-void ALlowpass_setParami(ALfilter*, ALCcontext *context, ALenum param, ALint)
+void ALlowpass_setParami(ALfilter*, ALCcontext *context, ALenum param, int)
{ context->setError(AL_INVALID_ENUM, "Invalid low-pass integer property 0x%04x", param); }
-void ALlowpass_setParamiv(ALfilter*, ALCcontext *context, ALenum param, const ALint*)
+void ALlowpass_setParamiv(ALfilter*, ALCcontext *context, ALenum param, const int*)
{ context->setError(AL_INVALID_ENUM, "Invalid low-pass integer-vector property 0x%04x", param); }
-void ALlowpass_setParamf(ALfilter *filter, ALCcontext *context, ALenum param, ALfloat val)
+void ALlowpass_setParamf(ALfilter *filter, ALCcontext *context, ALenum param, float val)
{
switch(param)
{
@@ -72,14 +72,14 @@ void ALlowpass_setParamf(ALfilter *filter, ALCcontext *context, ALenum param, AL
context->setError(AL_INVALID_ENUM, "Invalid low-pass float property 0x%04x", param);
}
}
-void ALlowpass_setParamfv(ALfilter *filter, ALCcontext *context, ALenum param, const ALfloat *vals)
+void ALlowpass_setParamfv(ALfilter *filter, ALCcontext *context, ALenum param, const float *vals)
{ ALlowpass_setParamf(filter, context, param, vals[0]); }
-void ALlowpass_getParami(const ALfilter*, ALCcontext *context, ALenum param, ALint*)
+void ALlowpass_getParami(const ALfilter*, ALCcontext *context, ALenum param, int*)
{ context->setError(AL_INVALID_ENUM, "Invalid low-pass integer property 0x%04x", param); }
-void ALlowpass_getParamiv(const ALfilter*, ALCcontext *context, ALenum param, ALint*)
+void ALlowpass_getParamiv(const ALfilter*, ALCcontext *context, ALenum param, int*)
{ context->setError(AL_INVALID_ENUM, "Invalid low-pass integer-vector property 0x%04x", param); }
-void ALlowpass_getParamf(const ALfilter *filter, ALCcontext *context, ALenum param, ALfloat *val)
+void ALlowpass_getParamf(const ALfilter *filter, ALCcontext *context, ALenum param, float *val)
{
switch(param)
{
@@ -95,17 +95,17 @@ void ALlowpass_getParamf(const ALfilter *filter, ALCcontext *context, ALenum par
context->setError(AL_INVALID_ENUM, "Invalid low-pass float property 0x%04x", param);
}
}
-void ALlowpass_getParamfv(const ALfilter *filter, ALCcontext *context, ALenum param, ALfloat *vals)
+void ALlowpass_getParamfv(const ALfilter *filter, ALCcontext *context, ALenum param, float *vals)
{ ALlowpass_getParamf(filter, context, param, vals); }
DEFINE_ALFILTER_VTABLE(ALlowpass);
-void ALhighpass_setParami(ALfilter*, ALCcontext *context, ALenum param, ALint)
+void ALhighpass_setParami(ALfilter*, ALCcontext *context, ALenum param, int)
{ context->setError(AL_INVALID_ENUM, "Invalid high-pass integer property 0x%04x", param); }
-void ALhighpass_setParamiv(ALfilter*, ALCcontext *context, ALenum param, const ALint*)
+void ALhighpass_setParamiv(ALfilter*, ALCcontext *context, ALenum param, const int*)
{ context->setError(AL_INVALID_ENUM, "Invalid high-pass integer-vector property 0x%04x", param); }
-void ALhighpass_setParamf(ALfilter *filter, ALCcontext *context, ALenum param, ALfloat val)
+void ALhighpass_setParamf(ALfilter *filter, ALCcontext *context, ALenum param, float val)
{
switch(param)
{
@@ -125,14 +125,14 @@ void ALhighpass_setParamf(ALfilter *filter, ALCcontext *context, ALenum param, A
context->setError(AL_INVALID_ENUM, "Invalid high-pass float property 0x%04x", param);
}
}
-void ALhighpass_setParamfv(ALfilter *filter, ALCcontext *context, ALenum param, const ALfloat *vals)
+void ALhighpass_setParamfv(ALfilter *filter, ALCcontext *context, ALenum param, const float *vals)
{ ALhighpass_setParamf(filter, context, param, vals[0]); }
-void ALhighpass_getParami(const ALfilter*, ALCcontext *context, ALenum param, ALint*)
+void ALhighpass_getParami(const ALfilter*, ALCcontext *context, ALenum param, int*)
{ context->setError(AL_INVALID_ENUM, "Invalid high-pass integer property 0x%04x", param); }
-void ALhighpass_getParamiv(const ALfilter*, ALCcontext *context, ALenum param, ALint*)
+void ALhighpass_getParamiv(const ALfilter*, ALCcontext *context, ALenum param, int*)
{ context->setError(AL_INVALID_ENUM, "Invalid high-pass integer-vector property 0x%04x", param); }
-void ALhighpass_getParamf(const ALfilter *filter, ALCcontext *context, ALenum param, ALfloat *val)
+void ALhighpass_getParamf(const ALfilter *filter, ALCcontext *context, ALenum param, float *val)
{
switch(param)
{
@@ -148,17 +148,17 @@ void ALhighpass_getParamf(const ALfilter *filter, ALCcontext *context, ALenum pa
context->setError(AL_INVALID_ENUM, "Invalid high-pass float property 0x%04x", param);
}
}
-void ALhighpass_getParamfv(const ALfilter *filter, ALCcontext *context, ALenum param, ALfloat *vals)
+void ALhighpass_getParamfv(const ALfilter *filter, ALCcontext *context, ALenum param, float *vals)
{ ALhighpass_getParamf(filter, context, param, vals); }
DEFINE_ALFILTER_VTABLE(ALhighpass);
-void ALbandpass_setParami(ALfilter*, ALCcontext *context, ALenum param, ALint)
+void ALbandpass_setParami(ALfilter*, ALCcontext *context, ALenum param, int)
{ context->setError(AL_INVALID_ENUM, "Invalid band-pass integer property 0x%04x", param); }
-void ALbandpass_setParamiv(ALfilter*, ALCcontext *context, ALenum param, const ALint*)
+void ALbandpass_setParamiv(ALfilter*, ALCcontext *context, ALenum param, const int*)
{ context->setError(AL_INVALID_ENUM, "Invalid band-pass integer-vector property 0x%04x", param); }
-void ALbandpass_setParamf(ALfilter *filter, ALCcontext *context, ALenum param, ALfloat val)
+void ALbandpass_setParamf(ALfilter *filter, ALCcontext *context, ALenum param, float val)
{
switch(param)
{
@@ -184,14 +184,14 @@ void ALbandpass_setParamf(ALfilter *filter, ALCcontext *context, ALenum param, A
context->setError(AL_INVALID_ENUM, "Invalid band-pass float property 0x%04x", param);
}
}
-void ALbandpass_setParamfv(ALfilter *filter, ALCcontext *context, ALenum param, const ALfloat *vals)
+void ALbandpass_setParamfv(ALfilter *filter, ALCcontext *context, ALenum param, const float *vals)
{ ALbandpass_setParamf(filter, context, param, vals[0]); }
-void ALbandpass_getParami(const ALfilter*, ALCcontext *context, ALenum param, ALint*)
+void ALbandpass_getParami(const ALfilter*, ALCcontext *context, ALenum param, int*)
{ context->setError(AL_INVALID_ENUM, "Invalid band-pass integer property 0x%04x", param); }
-void ALbandpass_getParamiv(const ALfilter*, ALCcontext *context, ALenum param, ALint*)
+void ALbandpass_getParamiv(const ALfilter*, ALCcontext *context, ALenum param, int*)
{ context->setError(AL_INVALID_ENUM, "Invalid band-pass integer-vector property 0x%04x", param); }
-void ALbandpass_getParamf(const ALfilter *filter, ALCcontext *context, ALenum param, ALfloat *val)
+void ALbandpass_getParamf(const ALfilter *filter, ALCcontext *context, ALenum param, float *val)
{
switch(param)
{
@@ -211,28 +211,28 @@ void ALbandpass_getParamf(const ALfilter *filter, ALCcontext *context, ALenum pa
context->setError(AL_INVALID_ENUM, "Invalid band-pass float property 0x%04x", param);
}
}
-void ALbandpass_getParamfv(const ALfilter *filter, ALCcontext *context, ALenum param, ALfloat *vals)
+void ALbandpass_getParamfv(const ALfilter *filter, ALCcontext *context, ALenum param, float *vals)
{ ALbandpass_getParamf(filter, context, param, vals); }
DEFINE_ALFILTER_VTABLE(ALbandpass);
-void ALnullfilter_setParami(ALfilter*, ALCcontext *context, ALenum param, ALint)
+void ALnullfilter_setParami(ALfilter*, ALCcontext *context, ALenum param, int)
{ context->setError(AL_INVALID_ENUM, "Invalid null filter property 0x%04x", param); }
-void ALnullfilter_setParamiv(ALfilter*, ALCcontext *context, ALenum param, const ALint*)
+void ALnullfilter_setParamiv(ALfilter*, ALCcontext *context, ALenum param, const int*)
{ context->setError(AL_INVALID_ENUM, "Invalid null filter property 0x%04x", param); }
-void ALnullfilter_setParamf(ALfilter*, ALCcontext *context, ALenum param, ALfloat)
+void ALnullfilter_setParamf(ALfilter*, ALCcontext *context, ALenum param, float)
{ context->setError(AL_INVALID_ENUM, "Invalid null filter property 0x%04x", param); }
-void ALnullfilter_setParamfv(ALfilter*, ALCcontext *context, ALenum param, const ALfloat*)
+void ALnullfilter_setParamfv(ALfilter*, ALCcontext *context, ALenum param, const float*)
{ context->setError(AL_INVALID_ENUM, "Invalid null filter property 0x%04x", param); }
-void ALnullfilter_getParami(const ALfilter*, ALCcontext *context, ALenum param, ALint*)
+void ALnullfilter_getParami(const ALfilter*, ALCcontext *context, ALenum param, int*)
{ context->setError(AL_INVALID_ENUM, "Invalid null filter property 0x%04x", param); }
-void ALnullfilter_getParamiv(const ALfilter*, ALCcontext *context, ALenum param, ALint*)
+void ALnullfilter_getParamiv(const ALfilter*, ALCcontext *context, ALenum param, int*)
{ context->setError(AL_INVALID_ENUM, "Invalid null filter property 0x%04x", param); }
-void ALnullfilter_getParamf(const ALfilter*, ALCcontext *context, ALenum param, ALfloat*)
+void ALnullfilter_getParamf(const ALfilter*, ALCcontext *context, ALenum param, float*)
{ context->setError(AL_INVALID_ENUM, "Invalid null filter property 0x%04x", param); }
-void ALnullfilter_getParamfv(const ALfilter*, ALCcontext *context, ALenum param, ALfloat*)
+void ALnullfilter_getParamfv(const ALfilter*, ALCcontext *context, ALenum param, float*)
{ context->setError(AL_INVALID_ENUM, "Invalid null filter property 0x%04x", param); }
DEFINE_ALFILTER_VTABLE(ALnullfilter);
diff --git a/al/listener.h b/al/listener.h
index c96b35bf..e30f45c3 100644
--- a/al/listener.h
+++ b/al/listener.h
@@ -15,12 +15,12 @@ enum class DistanceModel;
struct ALlistenerProps {
- std::array<ALfloat,3> Position;
- std::array<ALfloat,3> Velocity;
- std::array<ALfloat,3> OrientAt;
- std::array<ALfloat,3> OrientUp;
- ALfloat Gain;
- ALfloat MetersPerUnit;
+ std::array<float,3> Position;
+ std::array<float,3> Velocity;
+ std::array<float,3> OrientAt;
+ std::array<float,3> OrientUp;
+ float Gain;
+ float MetersPerUnit;
std::atomic<ALlistenerProps*> next;
@@ -28,12 +28,12 @@ struct ALlistenerProps {
};
struct ALlistener {
- std::array<ALfloat,3> Position{{0.0f, 0.0f, 0.0f}};
- std::array<ALfloat,3> Velocity{{0.0f, 0.0f, 0.0f}};
- std::array<ALfloat,3> OrientAt{{0.0f, 0.0f, -1.0f}};
- std::array<ALfloat,3> OrientUp{{0.0f, 1.0f, 0.0f}};
- ALfloat Gain{1.0f};
- ALfloat mMetersPerUnit{AL_DEFAULT_METERS_PER_UNIT};
+ std::array<float,3> Position{{0.0f, 0.0f, 0.0f}};
+ std::array<float,3> Velocity{{0.0f, 0.0f, 0.0f}};
+ std::array<float,3> OrientAt{{0.0f, 0.0f, -1.0f}};
+ std::array<float,3> OrientUp{{0.0f, 1.0f, 0.0f}};
+ float Gain{1.0f};
+ float mMetersPerUnit{AL_DEFAULT_METERS_PER_UNIT};
std::atomic_flag PropsClean;
@@ -46,11 +46,11 @@ struct ALlistener {
alu::Matrix Matrix;
alu::Vector Velocity;
- ALfloat Gain;
- ALfloat MetersPerUnit;
+ float Gain;
+ float MetersPerUnit;
- ALfloat DopplerFactor;
- ALfloat SpeedOfSound; /* in units per sec! */
+ float DopplerFactor;
+ float SpeedOfSound; /* in units per sec! */
bool SourceDistanceModel;
DistanceModel mDistanceModel;