* Apply the last bit of patch #884 by Buginator (openal_track.c)

* Make sure that sound_GetError and sound_GetDeviceError are useable in WZ_NOSOUND builds as well


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3053 4a71c877-e1ca-e34f-864e-861f7616d084
master
Giel van Schijndel 2007-12-14 15:11:59 +00:00
parent d179c09f17
commit 8fcd2410be
2 changed files with 7 additions and 14 deletions

View File

@ -51,8 +51,8 @@ extern ALenum __sound_GetDeviceError(ALCdevice* device, const char* location_des
__sound_GetDeviceError(device, AT_MACRO)
#else // !defined(WZ_NOSOUND)
# define sound_GetError(err_code)
# define sound_GetDeviceError(err_code)
# define sound_GetError(err_code) AL_NO_ERROR
# define sound_GetDeviceError(err_code) ALC_NO_ERROR
#endif // !defined(WZ_NOSOUND)
#endif // __INCLUDED_LIB_SOUND_OPENAL_ERROR_H__

View File

@ -196,18 +196,16 @@ void sound_ShutdownLibrary( void )
// =======================================================================================================================
// =======================================================================================================================
//
void sound_Update( void )
void sound_Update()
{
#ifndef WZ_NOSOUND
int err;
#endif
SAMPLE_LIST* node = active_samples;
SAMPLE_LIST* previous = NULL;
ALCenum err;
while (node != NULL)
{
#ifndef WZ_NOSOUND
ALenum state;
ALenum state, err;
alGetSourcei(node->curr->iSample, AL_SOURCE_STATE, &state);
@ -238,9 +236,7 @@ void sound_Update( void )
break;
case AL_STOPPED:
#endif
sound_FinishedCallback(node->curr);
#ifndef WZ_NOSOUND
default:
// If an OpenAL source is associated with this sample, release it
@ -249,7 +245,7 @@ void sound_Update( void )
alDeleteSources(1, &node->curr->iSample);
sound_GetError();
}
#endif
// Remove the sample from the list
sound_RemoveSample(previous, node);
// Free it
@ -257,15 +253,12 @@ void sound_Update( void )
// Get a pointer to the next node, the previous pointer doesn't change
node = (previous != NULL) ? previous->next : active_samples;
#ifndef WZ_NOSOUND
break;
}
#endif
}
cdAudio_Update();
#ifndef WZ_NOSOUND
// Reset the current error state
alcGetError(device);
@ -278,7 +271,7 @@ void sound_Update( void )
alGetString(err));
}
#endif
}
}
//*
// =======================================================================================================================