Set an error if NaN is given for panning values
This commit is contained in:
parent
45b16ff456
commit
7940003d06
@ -10,6 +10,7 @@ INCLUDE(CheckFunctionExists)
|
||||
INCLUDE(CheckLibraryExists)
|
||||
INCLUDE(CheckIncludeFile)
|
||||
INCLUDE(CheckIncludeFiles)
|
||||
INCLUDE(CheckSymbolExists)
|
||||
INCLUDE(CheckCCompilerFlag)
|
||||
INCLUDE(CheckCSourceCompiles)
|
||||
INCLUDE(CheckTypeSize)
|
||||
@ -167,6 +168,17 @@ IF(NOT HAVE_SNPRINTF)
|
||||
ADD_DEFINITIONS(-Dsnprintf=_snprintf)
|
||||
ENDIF()
|
||||
|
||||
CHECK_SYMBOL_EXISTS(isnan math.h HAVE_ISNAN)
|
||||
IF(NOT HAVE_ISNAN)
|
||||
CHECK_FUNCTION_EXISTS(_isnan HAVE__ISNAN)
|
||||
IF(NOT HAVE__ISNAN)
|
||||
MESSAGE(FATAL_ERROR "No isnan function found, please report!")
|
||||
ENDIF()
|
||||
|
||||
ADD_DEFINITIONS(-Disnan=_isnan)
|
||||
ENDIF()
|
||||
|
||||
|
||||
# Check for the dlopen API (for dynamicly loading backend libs)
|
||||
IF(DLOPEN)
|
||||
CHECK_INCLUDE_FILE(dlfcn.h HAVE_DLFCN_H)
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "AL/al.h"
|
||||
#include "AL/alc.h"
|
||||
@ -666,14 +667,24 @@ ALvoid AL_APIENTRY alEffectfv(ALuint effect, ALenum param, ALfloat *pflValues)
|
||||
break;
|
||||
|
||||
case AL_EAXREVERB_REFLECTIONS_PAN:
|
||||
ALEffect->Reverb.ReflectionsPan[0] = pflValues[0];
|
||||
ALEffect->Reverb.ReflectionsPan[1] = pflValues[1];
|
||||
ALEffect->Reverb.ReflectionsPan[2] = pflValues[2];
|
||||
if(!isnan(pflValues[0]) && !isnan(pflValues[1]) && !isnan(pflValues[2]))
|
||||
{
|
||||
ALEffect->Reverb.ReflectionsPan[0] = pflValues[0];
|
||||
ALEffect->Reverb.ReflectionsPan[1] = pflValues[1];
|
||||
ALEffect->Reverb.ReflectionsPan[2] = pflValues[2];
|
||||
}
|
||||
else
|
||||
alSetError(AL_INVALID_VALUE);
|
||||
break;
|
||||
case AL_EAXREVERB_LATE_REVERB_PAN:
|
||||
ALEffect->Reverb.LateReverbPan[0] = pflValues[0];
|
||||
ALEffect->Reverb.LateReverbPan[1] = pflValues[1];
|
||||
ALEffect->Reverb.LateReverbPan[2] = pflValues[2];
|
||||
if(!isnan(pflValues[0]) && !isnan(pflValues[1]) && !isnan(pflValues[2]))
|
||||
{
|
||||
ALEffect->Reverb.LateReverbPan[0] = pflValues[0];
|
||||
ALEffect->Reverb.LateReverbPan[1] = pflValues[1];
|
||||
ALEffect->Reverb.LateReverbPan[2] = pflValues[2];
|
||||
}
|
||||
else
|
||||
alSetError(AL_INVALID_VALUE);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user