From 467917233ad4b2a3d9222ef7d06b70c3dd8fd80e Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Sat, 19 Aug 2006 22:17:04 +0000 Subject: [PATCH] - Change available device list to be displayed on sound initialization and use line feeds as separators. --- code/client/snd_openal.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/code/client/snd_openal.c b/code/client/snd_openal.c index 6d644e15..4cdaa7f9 100644 --- a/code/client/snd_openal.c +++ b/code/client/snd_openal.c @@ -1675,10 +1675,12 @@ void S_AL_SoundInfo( void ) Com_Printf( " Vendor: %s\n", qalGetString( AL_VENDOR ) ); Com_Printf( " Version: %s\n", qalGetString( AL_VERSION ) ); Com_Printf( " Renderer: %s\n", qalGetString( AL_RENDERER ) ); - if(qalcIsExtensionPresent(NULL, "ALC_ENUMERATION_EXT")) - Com_Printf( " Device: %s\n", qalcGetString(alDevice, ALC_DEVICE_SPECIFIER) ); Com_Printf( " Extensions: %s\n", qalGetString( AL_EXTENSIONS ) ); - + if(qalcIsExtensionPresent(NULL, "ALC_ENUMERATION_EXT")) + { + Com_Printf(" Device: %s\n", qalcGetString(alDevice, ALC_DEVICE_SPECIFIER)); + Com_Printf("Available Devices:\n%s", s_alAvailableDevices->string); + } } /* @@ -1751,7 +1753,6 @@ qboolean S_AL_Init( soundInterface_t *si ) const ALCchar *devicelist; const ALCchar *defaultdevice; int curlen; - qboolean hasbegun = qfalse; // get all available devices + the default device name. devicelist = qalcGetString(NULL, ALC_DEVICE_SPECIFIER); @@ -1771,11 +1772,8 @@ qboolean S_AL_Init( soundInterface_t *si ) // dump a list of available devices to a cvar for the user to see. while((curlen = strlen(devicelist))) { - if(hasbegun) - Q_strcat(devicenames, sizeof(devicenames), ", "); - Q_strcat(devicenames, sizeof(devicenames), devicelist); - hasbegun = qtrue; + Q_strcat(devicenames, sizeof(devicenames), "\n"); // check whether the device we want to load is available at all. if(!strcmp(s_alDevice->string, devicelist))