From bbe9ac102f2caafe260737e3fe3b2f667e9684a8 Mon Sep 17 00:00:00 2001 From: avolkov Date: Tue, 19 Apr 2005 22:20:41 +0000 Subject: [PATCH] Never positioning sources at the same location as listener (chase fix for #472) git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1654 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/libs/sound/openal/audiodrv_openal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sc2/src/sc2code/libs/sound/openal/audiodrv_openal.c b/sc2/src/sc2code/libs/sound/openal/audiodrv_openal.c index c1861fb64..c1be7ea73 100644 --- a/sc2/src/sc2code/libs/sound/openal/audiodrv_openal.c +++ b/sc2/src/sc2code/libs/sound/openal/audiodrv_openal.c @@ -28,6 +28,7 @@ ALCcontext *alcContext = NULL; ALCdevice *alcDevice = NULL; +ALfloat defaultPos[] = {0.0f, 0.0f, -1.0f}; ALfloat listenerPos[] = {0.0f, 0.0f, 0.0f}; ALfloat listenerVel[] = {0.0f, 0.0f, 0.0f}; ALfloat listenerOri[] = {0.0f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f}; @@ -161,7 +162,7 @@ openAL_Init (audio_Driver *driver, sint32 flags) alGenSources (1, &soundSource[i].handle); alSourcei (soundSource[i].handle, AL_LOOPING, AL_FALSE); - alSourcefv (soundSource[i].handle, AL_POSITION, zero); + alSourcefv (soundSource[i].handle, AL_POSITION, defaultPos); alSourcefv (soundSource[i].handle, AL_VELOCITY, zero); alSourcefv (soundSource[i].handle, AL_DIRECTION, zero);