Move aluCart2LUTpos to alu.h

This commit is contained in:
Chris Robinson 2009-11-19 09:24:35 -08:00
parent e868eef679
commit ff8e09495d
4 changed files with 18 additions and 32 deletions

View File

@ -399,20 +399,6 @@ ALvoid aluInitPanning(ALCcontext *Context)
}
}
static __inline ALint aluCart2LUTpos(ALfloat re, ALfloat im)
{
ALint pos = 0;
ALfloat denom = aluFabs(re) + aluFabs(im);
if(denom > 0.0f)
pos = (ALint)(QUADRANT_NUM*aluFabs(im) / denom + 0.5);
if(re < 0.0)
pos = 2 * QUADRANT_NUM - pos;
if(im < 0.0)
pos = LUT_NUM - pos;
return pos%LUT_NUM;
}
static ALvoid CalcSourceParams(const ALCcontext *ALContext, ALsource *ALSource,
ALboolean isMono)
{

View File

@ -393,21 +393,6 @@ ALvoid VerbDestroy(ALeffectState *effect)
}
}
// NOTE: Temp, remove later.
static __inline ALint aluCart2LUTpos(ALfloat re, ALfloat im)
{
ALint pos = 0;
ALfloat denom = aluFabs(re) + aluFabs(im);
if(denom > 0.0f)
pos = (ALint)(QUADRANT_NUM*aluFabs(im) / denom + 0.5);
if(re < 0.0)
pos = 2 * QUADRANT_NUM - pos;
if(im < 0.0)
pos = LUT_NUM - pos;
return pos%LUT_NUM;
}
// This updates the device-dependant reverb state. This is called on
// initialization and any time the device parameters (eg. playback frequency,
// format) have been changed.

View File

@ -163,9 +163,6 @@ static __inline void al_print(const char *fname, unsigned int line, const char *
#define LOWPASSFREQCUTOFF (5000)
#define QUADRANT_NUM 128
#define LUT_NUM (4 * QUADRANT_NUM)
typedef struct {
ALCboolean (*OpenPlayback)(ALCdevice*, const ALCchar*);

View File

@ -5,6 +5,7 @@
#include "AL/alc.h"
#include "AL/alext.h"
#include <math.h>
#ifdef HAVE_FLOAT_H
#include <float.h>
#endif
@ -46,6 +47,9 @@
#define __min min
#endif
#define QUADRANT_NUM 128
#define LUT_NUM (4 * QUADRANT_NUM)
#ifdef __cplusplus
extern "C" {
#endif
@ -145,6 +149,20 @@ static __inline ALuint aluChannelsFromFormat(ALenum format)
}
}
static __inline ALint aluCart2LUTpos(ALfloat re, ALfloat im)
{
ALint pos = 0;
ALfloat denom = aluFabs(re) + aluFabs(im);
if(denom > 0.0f)
pos = (ALint)(QUADRANT_NUM*aluFabs(im) / denom + 0.5);
if(re < 0.0)
pos = 2 * QUADRANT_NUM - pos;
if(im < 0.0)
pos = LUT_NUM - pos;
return pos%LUT_NUM;
}
ALvoid aluInitPanning(ALCcontext *Context);
ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size);
ALvoid aluHandleDisconnect(ALCdevice *device);