mirror of
https://github.com/love2d/megasource.git
synced 2026-08-18 19:54:37 +02:00
update OpenAL-Soft to 1.24.3.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "device.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
#include <numeric>
|
||||
|
||||
@@ -10,15 +11,14 @@
|
||||
#include "al/effect.h"
|
||||
#include "al/filter.h"
|
||||
#include "albit.h"
|
||||
#include "alconfig.h"
|
||||
#include "alnumeric.h"
|
||||
#include "atomic.h"
|
||||
#include "backends/base.h"
|
||||
#include "core/bformatdec.h"
|
||||
#include "core/bs2b.h"
|
||||
#include "core/front_stablizer.h"
|
||||
#include "core/devformat.h"
|
||||
#include "core/hrtf.h"
|
||||
#include "core/logging.h"
|
||||
#include "core/mastering.h"
|
||||
#include "core/uhjfilter.h"
|
||||
#include "flexarray.h"
|
||||
|
||||
|
||||
namespace {
|
||||
@@ -27,13 +27,14 @@ using voidp = void*;
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace al {
|
||||
|
||||
ALCdevice::ALCdevice(DeviceType type) : DeviceBase{type}
|
||||
Device::Device(DeviceType type) : DeviceBase{type}
|
||||
{ }
|
||||
|
||||
ALCdevice::~ALCdevice()
|
||||
Device::~Device()
|
||||
{
|
||||
TRACE("Freeing device %p\n", voidp{this});
|
||||
TRACE("Freeing device {}", voidp{this});
|
||||
|
||||
Backend = nullptr;
|
||||
|
||||
@@ -41,35 +42,35 @@ ALCdevice::~ALCdevice()
|
||||
[](size_t cur, const BufferSubList &sublist) noexcept -> size_t
|
||||
{ return cur + static_cast<uint>(al::popcount(~sublist.FreeMask)); })};
|
||||
if(count > 0)
|
||||
WARN("%zu Buffer%s not deleted\n", count, (count==1)?"":"s");
|
||||
WARN("{} Buffer{} not deleted", count, (count==1)?"":"s");
|
||||
|
||||
count = std::accumulate(EffectList.cbegin(), EffectList.cend(), 0_uz,
|
||||
[](size_t cur, const EffectSubList &sublist) noexcept -> size_t
|
||||
{ return cur + static_cast<uint>(al::popcount(~sublist.FreeMask)); });
|
||||
if(count > 0)
|
||||
WARN("%zu Effect%s not deleted\n", count, (count==1)?"":"s");
|
||||
WARN("{} Effect{} not deleted", count, (count==1)?"":"s");
|
||||
|
||||
count = std::accumulate(FilterList.cbegin(), FilterList.cend(), 0_uz,
|
||||
[](size_t cur, const FilterSubList &sublist) noexcept -> size_t
|
||||
{ return cur + static_cast<uint>(al::popcount(~sublist.FreeMask)); });
|
||||
if(count > 0)
|
||||
WARN("%zu Filter%s not deleted\n", count, (count==1)?"":"s");
|
||||
WARN("{} Filter{} not deleted", count, (count==1)?"":"s");
|
||||
}
|
||||
|
||||
void ALCdevice::enumerateHrtfs()
|
||||
void Device::enumerateHrtfs()
|
||||
{
|
||||
mHrtfList = EnumerateHrtf(configValue<std::string>({}, "hrtf-paths"));
|
||||
if(auto defhrtfopt = configValue<std::string>({}, "default-hrtf"))
|
||||
{
|
||||
auto iter = std::find(mHrtfList.begin(), mHrtfList.end(), *defhrtfopt);
|
||||
if(iter == mHrtfList.end())
|
||||
WARN("Failed to find default HRTF \"%s\"\n", defhrtfopt->c_str());
|
||||
WARN("Failed to find default HRTF \"{}\"", *defhrtfopt);
|
||||
else if(iter != mHrtfList.begin())
|
||||
std::rotate(mHrtfList.begin(), iter, iter+1);
|
||||
}
|
||||
}
|
||||
|
||||
auto ALCdevice::getOutputMode1() const noexcept -> OutputMode1
|
||||
auto Device::getOutputMode1() const noexcept -> OutputMode1
|
||||
{
|
||||
if(mContexts.load(std::memory_order_relaxed)->empty())
|
||||
return OutputMode1::Any;
|
||||
@@ -88,9 +89,12 @@ auto ALCdevice::getOutputMode1() const noexcept -> OutputMode1
|
||||
case DevFmtX61: return OutputMode1::X61;
|
||||
case DevFmtX71: return OutputMode1::X71;
|
||||
case DevFmtX714:
|
||||
case DevFmtX7144:
|
||||
case DevFmtX3D71:
|
||||
case DevFmtAmbi3D:
|
||||
break;
|
||||
}
|
||||
return OutputMode1::Any;
|
||||
}
|
||||
|
||||
} // namespace al
|
||||
|
||||
Reference in New Issue
Block a user