From 52dc5cf3da1ff46e91564778642fe72f89a8183b Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Tue, 16 Aug 2022 11:02:36 +0100 Subject: [PATCH] Device Name -OpenAL wraps device name in brackets, if found return only device name. --- Engine/source/sfx/sfxSystem.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Engine/source/sfx/sfxSystem.cpp b/Engine/source/sfx/sfxSystem.cpp index 9c864842f..ffe5c6351 100644 --- a/Engine/source/sfx/sfxSystem.cpp +++ b/Engine/source/sfx/sfxSystem.cpp @@ -1264,7 +1264,16 @@ DefineEngineFunction( sfxGetAvailableDevices, const char*, (),, { const SFXDeviceInfo* info = deviceInfo[d]; const char *providerName = provider->getName().c_str(); - const char *infoName = info->name.c_str(); + char *infoName = (char*)info->name.c_str(); + char* openFind = dStrchr(&infoName[0], '('); + if (openFind) + { + infoName = openFind + 1; + char* closeFind = dStrchr(infoName, ')'); + if (closeFind) + (*closeFind) = '\0'; + } + dSprintf(ptr, len, "%s\t%s\t%s\t%i\n", providerName, infoName, info->hasHardware ? "1" : "0", info->maxBuffers); ptr += dStrlen(ptr);