Forráskód Böngészése

* BugFix: Fix AL device listing so that functions like sfxGetAvailableDevices return the actual devices on the system.

Robert MacGregor 4 éve
szülő
commit
5e88ab2570
1 módosított fájl, 3 hozzáadás és 3 törlés
  1. 3 3
      Engine/source/sfx/openal/aldlist.cpp

+ 3 - 3
Engine/source/sfx/openal/aldlist.cpp

@@ -56,7 +56,7 @@ ALDeviceList::ALDeviceList( const OPENALFNTABLE &oalft )
 
    // grab function pointers for 1.0-API functions, and if successful proceed to enumerate all devices
    if (ALFunction.alcIsExtensionPresent(NULL, "ALC_ENUMERATION_EXT")) {
-      devices = (char *)ALFunction.alcGetString(NULL, ALC_DEVICE_SPECIFIER);
+      devices = (char *)ALFunction.alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER);
       defaultDeviceName = (char *)ALFunction.alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER);
       index = 0;
       // go through device list (each device terminated with a single NULL, list terminated with double NULL)
@@ -70,7 +70,7 @@ ALDeviceList::ALDeviceList( const OPENALFNTABLE &oalft )
             if (context) {
                ALFunction.alcMakeContextCurrent(context);
                // if new actual device name isn't already in the list, then add it...
-               actualDeviceName = ALFunction.alcGetString(device, ALC_DEVICE_SPECIFIER);
+               actualDeviceName = devices;
                bool bNewName = true;
                for (int i = 0; i < GetNumDevices(); i++) {
                   if (String::compare(GetDeviceName(i), actualDeviceName) == 0) {
@@ -313,4 +313,4 @@ unsigned int ALDeviceList::GetMaxNumSources()
 	}
 
 	return iSourceCount;
-}
+}