[quake3-commits] r1918 - in trunk: . code/client

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Wed Mar 9 07:59:26 EST 2011


Author: thilo
Date: 2011-03-09 07:59:25 -0500 (Wed, 09 Mar 2011)
New Revision: 1918

Modified:
   trunk/README
   trunk/code/client/snd_openal.c
Log:
- I accidentally committed patch by slacker from (#4915) in r1916. Patch adds input device selection support
- Add check for ALC_ENUMERATE_ALL_EXT before using ALC_ALL_DEVICES_SPECIFIER in device enumeration
- Patch readme for new cvars by Zack Middleton


Modified: trunk/README
===================================================================
--- trunk/README	2011-03-08 02:14:39 UTC (rev 1917)
+++ trunk/README	2011-03-09 12:59:25 UTC (rev 1918)
@@ -132,6 +132,8 @@
   s_alDriver                        - which OpenAL library to use
   s_alDevice                        - which OpenAL device to use
   s_alAvailableDevices              - list of available OpenAL devices
+  s_alInputDevice                   - which OpenAL input device to use
+  s_alAvailableInputDevices         - list of available OpenAL input devices
   s_sdlBits                         - SDL bit resolution
   s_sdlSpeed                        - SDL sample rate
   s_sdlChannels                     - SDL number of channels

Modified: trunk/code/client/snd_openal.c
===================================================================
--- trunk/code/client/snd_openal.c	2011-03-08 02:14:39 UTC (rev 1917)
+++ trunk/code/client/snd_openal.c	2011-03-09 12:59:25 UTC (rev 1918)
@@ -45,6 +45,8 @@
 cvar_t *s_alAvailableDevices;
 cvar_t *s_alAvailableInputDevices;
 
+static enumeration_ext = qfalse;
+
 /*
 =================
 S_AL_Format
@@ -2278,7 +2280,7 @@
 	Com_Printf( "  Renderer:   %s\n", qalGetString( AL_RENDERER ) );
 	Com_Printf( "  AL Extensions: %s\n", qalGetString( AL_EXTENSIONS ) );
 	Com_Printf( "  ALC Extensions: %s\n", qalcGetString( alDevice, ALC_EXTENSIONS ) );
-	if(qalcIsExtensionPresent(NULL, "ALC_ENUMERATION_EXT"))
+	if(enumeration_ext)
 	{
 		Com_Printf("  Device:      %s\n", qalcGetString(alDevice, ALC_DEVICE_SPECIFIER));
 		Com_Printf("Available Devices:\n%s", s_alAvailableDevices->string);
@@ -2383,8 +2385,10 @@
 	if(inputdevice && !*inputdevice)
 		inputdevice = NULL;
 
-	// Device enumeration support (extension is implemented reasonably only on Windows right now).
-	if(qalcIsExtensionPresent(NULL, "ALC_ENUMERATION_EXT"))
+	// Device enumeration support
+	if(qalcIsExtensionPresent(NULL, "ALC_ENUMERATION_EXT") ||
+	   (enumeration_ext = qalcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT"))
+	  )
 	{
 		char devicenames[1024] = "";
 		const char *devicelist;
@@ -2392,7 +2396,15 @@
 		int curlen;
 		
 		// get all available devices + the default device name.
-		devicelist = qalcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER);
+		if(enumeration_ext)
+        		devicelist = qalcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER);
+                else
+                {
+                        // We don't have ALC_ENUMERATE_ALL_EXT but normal enumeration.
+                        devicelist = qalcGetString(NULL, ALC_DEVICE_SPECIFIER);
+                        enumeration_ext = qtrue;
+                }
+                
 		defaultdevice = qalcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER);
 
 #ifdef _WIN32



More information about the quake3-commits mailing list