[quake3-commits] r1930 - trunk/code/client

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Mar 14 11:57:39 EDT 2011


Author: thilo
Date: 2011-03-14 11:57:39 -0400 (Mon, 14 Mar 2011)
New Revision: 1930

Modified:
   trunk/code/client/qal.h
   trunk/code/client/snd_openal.c
Log:
- Remove alext.h dependency and manually add the required macros
- Use ALC_DEFAULT_ALL_DEVICES_SPECIFIER instead of ALC_DEFAULT_DEVICE_SPECIFIER if extension exists


Modified: trunk/code/client/qal.h
===================================================================
--- trunk/code/client/qal.h	2011-03-13 16:54:41 UTC (rev 1929)
+++ trunk/code/client/qal.h	2011-03-14 15:57:39 UTC (rev 1930)
@@ -44,10 +44,16 @@
 #else
   #include <AL/al.h>
   #include <AL/alc.h>
-  #include <AL/alext.h>
 #endif
 #endif
 
+/* Hack to enable compiling both on OpenAL SDK and OpenAL-soft. */
+#ifndef ALC_ENUMERATE_ALL_EXT
+#  define ALC_ENUMERATE_ALL_EXT 1
+#  define ALC_DEFAULT_ALL_DEVICES_SPECIFIER        0x1012
+#  define ALC_ALL_DEVICES_SPECIFIER                0x1013
+#endif
+
 #ifdef USE_OPENAL_DLOPEN
 extern LPALENABLE qalEnable;
 extern LPALDISABLE qalDisable;

Modified: trunk/code/client/snd_openal.c
===================================================================
--- trunk/code/client/snd_openal.c	2011-03-13 16:54:41 UTC (rev 1929)
+++ trunk/code/client/snd_openal.c	2011-03-14 15:57:39 UTC (rev 1930)
@@ -2397,16 +2397,18 @@
 		
 		// get all available devices + the default device name.
 		if(enumeration_ext)
+		{
         		devicelist = qalcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER);
+        		defaultdevice = qalcGetString(NULL, ALC_DEFAULT_ALL_DEVICES_SPECIFIER);
+                }
                 else
                 {
                         // We don't have ALC_ENUMERATE_ALL_EXT but normal enumeration.
                         devicelist = qalcGetString(NULL, ALC_DEVICE_SPECIFIER);
+        		defaultdevice = qalcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER);
                         enumeration_ext = qtrue;
                 }
                 
-		defaultdevice = qalcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER);
-
 #ifdef _WIN32
 		// check whether the default device is generic hardware. If it is, change to
 		// Generic Software as that one works more reliably with various sound systems.



More information about the quake3-commits mailing list