From 3c8b4c2587b731436faf771fba47ea91de7b464c Mon Sep 17 00:00:00 2001 From: Lynix Date: Sun, 8 May 2022 15:44:59 +0200 Subject: [PATCH] Audio: Fix loading of OpenAL --- src/Nazara/Audio/OpenALLibrary.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Nazara/Audio/OpenALLibrary.cpp b/src/Nazara/Audio/OpenALLibrary.cpp index 718787041..7ab0c5ea6 100644 --- a/src/Nazara/Audio/OpenALLibrary.cpp +++ b/src/Nazara/Audio/OpenALLibrary.cpp @@ -26,8 +26,8 @@ namespace Nz #if defined(NAZARA_PLATFORM_WINDOWS) std::array libs{ "soft_oal.dll", - "wrap_oal.dll", - "openal32.dll" + "openal32.dll", + "wrap_oal.dll" }; #elif defined(NAZARA_PLATFORM_LINUX) std::array libs { @@ -53,7 +53,7 @@ namespace Nz auto LoadSymbol = [this](const char* name, bool optional) { DynLibFunc funcPtr = m_library.GetSymbol(name); - if (!funcPtr) + if (!funcPtr && !optional) throw std::runtime_error(std::string("failed to load ") + name); return funcPtr; @@ -74,12 +74,12 @@ namespace Nz continue; } + m_hasCaptureSupport = alcIsExtensionPresent(nullptr, "ALC_EXT_CAPTURE"); + unloadOnFailure.Reset(); return true; } - m_hasCaptureSupport = alcIsExtensionPresent(nullptr, "ALC_EXT_CAPTURE"); - NazaraError("failed to load OpenAL library"); return false; }