diff --git a/lib/sound/openal_error.h b/lib/sound/openal_error.h index 28a599050..bed68055a 100644 --- a/lib/sound/openal_error.h +++ b/lib/sound/openal_error.h @@ -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__ diff --git a/lib/sound/openal_track.c b/lib/sound/openal_track.c index 5231eb1cd..c39bdb1fa 100644 --- a/lib/sound/openal_track.c +++ b/lib/sound/openal_track.c @@ -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 - } +} //* // =======================================================================================================================