mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 07:34:45 +00:00
update openal-soft to 1.24.3
keeping the alt 87514151c4 (diff-73a8dc1ce58605f6c5ea53548454c3bae516ec5132a29c9d7ff7edf9730c75be)
This commit is contained in:
parent
12db0500e8
commit
ba32094b7b
276 changed files with 49304 additions and 8712 deletions
|
|
@ -17,12 +17,16 @@
|
|||
|
||||
#include "almalloc.h"
|
||||
#include "router.h"
|
||||
#include "strutils.h"
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
using namespace std::string_view_literals;
|
||||
|
||||
std::once_flag InitOnce;
|
||||
void LoadDrivers() { std::call_once(InitOnce, []{ LoadDriverList(); }); }
|
||||
|
||||
struct FuncExportEntry {
|
||||
const char *funcName;
|
||||
void *address;
|
||||
|
|
@ -337,7 +341,7 @@ void EnumeratedList::AppendDeviceList(const ALCchar* names, ALCuint idx)
|
|||
size_t count{0};
|
||||
while(*name_end)
|
||||
{
|
||||
TRACE("Enumerated \"%s\", driver %u\n", name_end, idx);
|
||||
TRACE("Enumerated \"{}\", driver {}", name_end, idx);
|
||||
++count;
|
||||
name_end += strlen(name_end)+1; /* NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic) */
|
||||
}
|
||||
|
|
@ -375,8 +379,8 @@ void InitCtxFuncs(DriverIface &iface)
|
|||
#define LOAD_PROC(x) do { \
|
||||
iface.x = reinterpret_cast<decltype(iface.x)>(iface.alGetProcAddress(#x));\
|
||||
if(!iface.x) \
|
||||
ERR("Failed to find entry point for %s in %ls\n", #x, \
|
||||
iface.Name.c_str()); \
|
||||
ERR("Failed to find entry point for {} in {}", #x, \
|
||||
wstr_to_utf8(iface.Name)); \
|
||||
} while(0)
|
||||
if(iface.alcIsExtensionPresent(device, "ALC_EXT_EFX"))
|
||||
{
|
||||
|
|
@ -422,6 +426,8 @@ void InitCtxFuncs(DriverIface &iface)
|
|||
|
||||
ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *devicename) noexcept
|
||||
{
|
||||
LoadDrivers();
|
||||
|
||||
ALCdevice *device{nullptr};
|
||||
std::optional<ALCuint> idx;
|
||||
|
||||
|
|
@ -448,10 +454,10 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *devicename) noexcep
|
|||
if(!idx)
|
||||
{
|
||||
LastError.store(ALC_INVALID_VALUE);
|
||||
TRACE("Failed to find driver for name \"%s\"\n", devicename);
|
||||
TRACE("Failed to find driver for name \"{}\"", devicename);
|
||||
return nullptr;
|
||||
}
|
||||
TRACE("Found driver %u for name \"%s\"\n", *idx, devicename);
|
||||
TRACE("Found driver {} for name \"{}\"", *idx, devicename);
|
||||
device = DriverList[*idx]->alcOpenDevice(devicename);
|
||||
}
|
||||
else
|
||||
|
|
@ -459,10 +465,10 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *devicename) noexcep
|
|||
ALCuint drvidx{0};
|
||||
for(const auto &drv : DriverList)
|
||||
{
|
||||
if(drv->ALCVer >= MAKE_ALC_VER(1, 1)
|
||||
if(drv->ALCVer >= MakeALCVer(1, 1)
|
||||
|| drv->alcIsExtensionPresent(nullptr, "ALC_ENUMERATION_EXT"))
|
||||
{
|
||||
TRACE("Using default device from driver %u\n", drvidx);
|
||||
TRACE("Using default device from driver {}", drvidx);
|
||||
device = drv->alcOpenDevice(nullptr);
|
||||
idx = drvidx;
|
||||
break;
|
||||
|
|
@ -685,6 +691,8 @@ ALC_API ALCenum ALC_APIENTRY alcGetEnumValue(ALCdevice *device, const ALCchar *e
|
|||
|
||||
ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *device, ALCenum param) noexcept
|
||||
{
|
||||
LoadDrivers();
|
||||
|
||||
if(device)
|
||||
{
|
||||
if(const auto idx = maybe_get(DeviceIfaceMap, device))
|
||||
|
|
@ -712,7 +720,7 @@ ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *device, ALCenum para
|
|||
for(const auto &drv : DriverList)
|
||||
{
|
||||
/* Only enumerate names from drivers that support it. */
|
||||
if(drv->ALCVer >= MAKE_ALC_VER(1, 1)
|
||||
if(drv->ALCVer >= MakeALCVer(1, 1)
|
||||
|| drv->alcIsExtensionPresent(nullptr, "ALC_ENUMERATION_EXT"))
|
||||
DevicesList.AppendDeviceList(drv->alcGetString(nullptr,ALC_DEVICE_SPECIFIER), idx);
|
||||
++idx;
|
||||
|
|
@ -737,7 +745,7 @@ ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *device, ALCenum para
|
|||
if(drv->alcIsExtensionPresent(nullptr, "ALC_ENUMERATE_ALL_EXT"))
|
||||
AllDevicesList.AppendDeviceList(
|
||||
drv->alcGetString(nullptr, ALC_ALL_DEVICES_SPECIFIER), idx);
|
||||
else if(drv->ALCVer >= MAKE_ALC_VER(1, 1)
|
||||
else if(drv->ALCVer >= MakeALCVer(1, 1)
|
||||
|| drv->alcIsExtensionPresent(nullptr, "ALC_ENUMERATION_EXT"))
|
||||
AllDevicesList.AppendDeviceList(
|
||||
drv->alcGetString(nullptr, ALC_DEVICE_SPECIFIER), idx);
|
||||
|
|
@ -757,7 +765,7 @@ ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *device, ALCenum para
|
|||
ALCuint idx{0};
|
||||
for(const auto &drv : DriverList)
|
||||
{
|
||||
if(drv->ALCVer >= MAKE_ALC_VER(1, 1)
|
||||
if(drv->ALCVer >= MakeALCVer(1, 1)
|
||||
|| drv->alcIsExtensionPresent(nullptr, "ALC_EXT_CAPTURE"))
|
||||
CaptureDevicesList.AppendDeviceList(
|
||||
drv->alcGetString(nullptr, ALC_CAPTURE_DEVICE_SPECIFIER), idx);
|
||||
|
|
@ -774,7 +782,7 @@ ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *device, ALCenum para
|
|||
{
|
||||
for(const auto &drv : DriverList)
|
||||
{
|
||||
if(drv->ALCVer >= MAKE_ALC_VER(1, 1)
|
||||
if(drv->ALCVer >= MakeALCVer(1, 1)
|
||||
|| drv->alcIsExtensionPresent(nullptr, "ALC_ENUMERATION_EXT"))
|
||||
return drv->alcGetString(nullptr, ALC_DEFAULT_DEVICE_SPECIFIER);
|
||||
}
|
||||
|
|
@ -795,7 +803,7 @@ ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *device, ALCenum para
|
|||
{
|
||||
for(const auto &drv : DriverList)
|
||||
{
|
||||
if(drv->ALCVer >= MAKE_ALC_VER(1, 1)
|
||||
if(drv->ALCVer >= MakeALCVer(1, 1)
|
||||
|| drv->alcIsExtensionPresent(nullptr, "ALC_EXT_CAPTURE"))
|
||||
return drv->alcGetString(nullptr, ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER);
|
||||
}
|
||||
|
|
@ -866,6 +874,8 @@ ALC_API void ALC_APIENTRY alcGetIntegerv(ALCdevice *device, ALCenum param, ALCsi
|
|||
ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *devicename, ALCuint frequency,
|
||||
ALCenum format, ALCsizei buffersize) noexcept
|
||||
{
|
||||
LoadDrivers();
|
||||
|
||||
ALCdevice *device{nullptr};
|
||||
std::optional<ALCuint> idx;
|
||||
|
||||
|
|
@ -881,10 +891,10 @@ ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *devicename,
|
|||
if(!idx)
|
||||
{
|
||||
LastError.store(ALC_INVALID_VALUE);
|
||||
TRACE("Failed to find driver for name \"%s\"\n", devicename);
|
||||
TRACE("Failed to find driver for name \"{}\"", devicename);
|
||||
return nullptr;
|
||||
}
|
||||
TRACE("Found driver %u for name \"%s\"\n", *idx, devicename);
|
||||
TRACE("Found driver {} for name \"{}\"", *idx, devicename);
|
||||
device = DriverList[*idx]->alcCaptureOpenDevice(devicename, frequency, format, buffersize);
|
||||
}
|
||||
else
|
||||
|
|
@ -892,10 +902,10 @@ ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *devicename,
|
|||
ALCuint drvidx{0};
|
||||
for(const auto &drv : DriverList)
|
||||
{
|
||||
if(drv->ALCVer >= MAKE_ALC_VER(1, 1)
|
||||
if(drv->ALCVer >= MakeALCVer(1, 1)
|
||||
|| drv->alcIsExtensionPresent(nullptr, "ALC_EXT_CAPTURE"))
|
||||
{
|
||||
TRACE("Using default capture device from driver %u\n", drvidx);
|
||||
TRACE("Using default capture device from driver {}", drvidx);
|
||||
device = drv->alcCaptureOpenDevice(nullptr, frequency, format, buffersize);
|
||||
idx = drvidx;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue