aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alState.c
diff options
context:
space:
mode:
Diffstat (limited to 'OpenAL32/alState.c')
-rw-r--r--OpenAL32/alState.c100
1 files changed, 44 insertions, 56 deletions
diff --git a/OpenAL32/alState.c b/OpenAL32/alState.c
index 41eec7a5..bcf03e1b 100644
--- a/OpenAL32/alState.c
+++ b/OpenAL32/alState.c
@@ -282,29 +282,26 @@ AL_API ALvoid AL_APIENTRY alGetBooleanv(ALenum pname,ALboolean *data)
{
ALCcontext *Context;
- Context = GetLockedContext();
- if(!Context) return;
-
if(data)
{
switch(pname)
{
case AL_DOPPLER_FACTOR:
- *data = (ALboolean)((Context->DopplerFactor != 0.0f) ? AL_TRUE : AL_FALSE);
- break;
-
case AL_DOPPLER_VELOCITY:
- *data = (ALboolean)((Context->DopplerVelocity != 0.0f) ? AL_TRUE : AL_FALSE);
- break;
-
case AL_DISTANCE_MODEL:
- *data = (ALboolean)((Context->DistanceModel == AL_INVERSE_DISTANCE_CLAMPED) ? AL_TRUE : AL_FALSE);
- break;
-
case AL_SPEED_OF_SOUND:
- *data = (ALboolean)((Context->flSpeedOfSound != 0.0f) ? AL_TRUE : AL_FALSE);
- break;
+ *data = alGetBoolean(pname);
+ return;
+ }
+ }
+
+ Context = GetLockedContext();
+ if(!Context) return;
+ if(data)
+ {
+ switch(pname)
+ {
default:
alSetError(Context, AL_INVALID_ENUM);
break;
@@ -323,29 +320,26 @@ AL_API ALvoid AL_APIENTRY alGetDoublev(ALenum pname,ALdouble *data)
{
ALCcontext *Context;
- Context = GetLockedContext();
- if(!Context) return;
-
if(data)
{
switch(pname)
{
case AL_DOPPLER_FACTOR:
- *data = (double)Context->DopplerFactor;
- break;
-
case AL_DOPPLER_VELOCITY:
- *data = (double)Context->DopplerVelocity;
- break;
-
case AL_DISTANCE_MODEL:
- *data = (double)Context->DistanceModel;
- break;
-
case AL_SPEED_OF_SOUND:
- *data = (double)Context->flSpeedOfSound;
- break;
+ *data = alGetDouble(pname);
+ return;
+ }
+ }
+
+ Context = GetLockedContext();
+ if(!Context) return;
+ if(data)
+ {
+ switch(pname)
+ {
default:
alSetError(Context, AL_INVALID_ENUM);
break;
@@ -364,29 +358,26 @@ AL_API ALvoid AL_APIENTRY alGetFloatv(ALenum pname,ALfloat *data)
{
ALCcontext *Context;
- Context = GetLockedContext();
- if(!Context) return;
-
if(data)
{
switch(pname)
{
case AL_DOPPLER_FACTOR:
- *data = Context->DopplerFactor;
- break;
-
case AL_DOPPLER_VELOCITY:
- *data = Context->DopplerVelocity;
- break;
-
case AL_DISTANCE_MODEL:
- *data = (float)Context->DistanceModel;
- break;
-
case AL_SPEED_OF_SOUND:
- *data = Context->flSpeedOfSound;
- break;
+ *data = alGetFloat(pname);
+ return;
+ }
+ }
+
+ Context = GetLockedContext();
+ if(!Context) return;
+ if(data)
+ {
+ switch(pname)
+ {
default:
alSetError(Context, AL_INVALID_ENUM);
break;
@@ -405,29 +396,26 @@ AL_API ALvoid AL_APIENTRY alGetIntegerv(ALenum pname,ALint *data)
{
ALCcontext *Context;
- Context = GetLockedContext();
- if(!Context) return;
-
if(data)
{
switch(pname)
{
case AL_DOPPLER_FACTOR:
- *data = (ALint)Context->DopplerFactor;
- break;
-
case AL_DOPPLER_VELOCITY:
- *data = (ALint)Context->DopplerVelocity;
- break;
-
case AL_DISTANCE_MODEL:
- *data = (ALint)Context->DistanceModel;
- break;
-
case AL_SPEED_OF_SOUND:
- *data = (ALint)Context->flSpeedOfSound;
- break;
+ *data = alGetInteger(pname);
+ return;
+ }
+ }
+
+ Context = GetLockedContext();
+ if(!Context) return;
+ if(data)
+ {
+ switch(pname)
+ {
default:
alSetError(Context, AL_INVALID_ENUM);
break;