diff options
author | Chris Robinson <[email protected]> | 2013-11-04 13:44:46 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-11-04 13:44:46 -0800 |
commit | d3c70e63b4a42c92f8229f3c9e7f21a2048b6b9d (patch) | |
tree | 31b5ca98a42f4d1e51d0fd76bf7040a1c2e8da44 /Alc | |
parent | 551f893ae910c2b1b72c0a22aeab1ede75d3e5ed (diff) |
Use C99 inline in more places
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALc.c | 4 | ||||
-rw-r--r-- | Alc/ALu.c | 22 | ||||
-rw-r--r-- | Alc/helpers.c | 4 | ||||
-rw-r--r-- | Alc/panning.c | 2 |
4 files changed, 32 insertions, 0 deletions
@@ -1274,6 +1274,7 @@ const ALCchar *DevFmtChannelsString(enum DevFmtChannels chans) return "(unknown channels)"; } +extern inline ALuint FrameSizeFromDevFmt(enum DevFmtChannels chans, enum DevFmtType type); ALuint BytesFromDevFmt(enum DevFmtType type) { switch(type) @@ -1415,6 +1416,9 @@ void ALCdevice_Unlock(ALCdevice *device) V0(device->Backend,unlock)(); } +extern inline void LockContext(ALCcontext *context); +extern inline void UnlockContext(ALCcontext *context); + /* SetDefaultWFXChannelOrder * @@ -48,6 +48,28 @@ ALfloat ConeScale = 1.0f; /* Localized Z scalar for mono sources */ ALfloat ZScale = 1.0f; +extern inline ALfloat minf(ALfloat a, ALfloat b); +extern inline ALfloat maxf(ALfloat a, ALfloat b); +extern inline ALfloat clampf(ALfloat val, ALfloat min, ALfloat max); + +extern inline ALuint minu(ALuint a, ALuint b); +extern inline ALuint maxu(ALuint a, ALuint b); +extern inline ALuint clampu(ALuint val, ALuint min, ALuint max); + +extern inline ALint mini(ALint a, ALint b); +extern inline ALint maxi(ALint a, ALint b); +extern inline ALint clampi(ALint val, ALint min, ALint max); + +extern inline ALint64 mini64(ALint64 a, ALint64 b); +extern inline ALint64 maxi64(ALint64 a, ALint64 b); +extern inline ALint64 clampi64(ALint64 val, ALint64 min, ALint64 max); + +extern inline ALuint64 minu64(ALuint64 a, ALuint64 b); +extern inline ALuint64 maxu64(ALuint64 a, ALuint64 b); +extern inline ALuint64 clampu64(ALuint64 val, ALuint64 min, ALuint64 max); + +extern inline ALfloat lerp(ALfloat val1, ALfloat val2, ALfloat mu); +extern inline ALfloat cubic(ALfloat val0, ALfloat val1, ALfloat val2, ALfloat val3, ALfloat mu); static ResamplerFunc SelectResampler(enum Resampler Resampler, ALuint increment) { diff --git a/Alc/helpers.c b/Alc/helpers.c index 94dedcf8..6c6c88e2 100644 --- a/Alc/helpers.c +++ b/Alc/helpers.c @@ -86,6 +86,10 @@ extern inline void UnlockUIntMapRead(UIntMap *map); extern inline void LockUIntMapWrite(UIntMap *map); extern inline void UnlockUIntMapWrite(UIntMap *map); +extern inline ALuint NextPowerOf2(ALuint value); +extern inline ALint fastf2i(ALfloat f); +extern inline ALuint fastf2u(ALfloat f); + ALuint CPUCapFlags = 0; diff --git a/Alc/panning.c b/Alc/panning.c index 80041696..30a1e571 100644 --- a/Alc/panning.c +++ b/Alc/panning.c @@ -31,6 +31,8 @@ #include "AL/alc.h" #include "alu.h" +extern inline void SetGains(const ALCdevice *device, ALfloat ingain, ALfloat gains[MaxChannels]); + static void SetSpeakerArrangement(const char *name, ALfloat SpeakerAngle[MaxChannels], enum Channel Speaker2Chan[MaxChannels], ALint chans) { |