Fix compilation with configure --disable-sound.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10562 4a71c877-e1ca-e34f-864e-861f7616d084
master
Christian Ohm 2010-04-12 21:14:09 +00:00 committed by Git SVN Gateway
parent 642efd7480
commit 122bd513dd
1 changed files with 10 additions and 1 deletions

View File

@ -555,9 +555,14 @@ void audio_Update()
{
return;
}
#ifndef WZ_NOSOUND
alGetError(); // clear error codes
#endif
audio_UpdateQueue();
#ifndef WZ_NOSOUND
alGetError(); // clear error codes
#endif
// get player position
playerPos = audio_GetPlayerPos();
audio_Get3DPlayerRotAboutVerticalAxis(&angle);
@ -693,10 +698,12 @@ static BOOL audio_Play3DTrack( SDWORD iX, SDWORD iY, SDWORD iZ, int iTrack, void
//~~~~~~~~~~~~~~~~~~~~~~
AUDIO_SAMPLE *psSample;
// coordinates
float listenerX, listenerY, listenerZ, dX, dY, dZ;
float listenerX = .0f, listenerY = .0f, listenerZ = .0f, dX, dY, dZ;
// calculation results
float distance, gain, sfx3d_volume;
#ifndef WZ_NOSOUND
ALenum err;
#endif
//~~~~~~~~~~~~~~~~~~~~~~
// if audio not enabled return true to carry on game without audio
@ -712,12 +719,14 @@ static BOOL audio_Play3DTrack( SDWORD iX, SDWORD iY, SDWORD iZ, int iTrack, void
// compute distance
// NOTE, if this call fails, expect garbage
#ifndef WZ_NOSOUND
alGetListener3f(AL_POSITION, &listenerX, &listenerY, &listenerZ);
err = sound_GetError();
if (err != AL_NO_ERROR)
{
return false;
}
#endif
dX = (float)iX - listenerX; // distances on all axis
dY = (float)iY - listenerY;
dZ = (float)iZ - listenerZ;