mirror of
https://github.com/OpenMW/openmw.git
synced 2025-11-08 17:16:42 +00:00
Merge branch 'unused_hrtf' into 'master'
Remove unused code See merge request OpenMW/openmw!3750
This commit is contained in:
commit
ff78c13903
3 changed files with 0 additions and 61 deletions
|
|
@ -1034,65 +1034,6 @@ namespace MWSound
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenAL_Output::setHrtf(const std::string& hrtfname, HrtfMode hrtfmode)
|
|
||||||
{
|
|
||||||
if (!mDevice || !ALC.SOFT_HRTF)
|
|
||||||
{
|
|
||||||
Log(Debug::Info) << "HRTF extension not present";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
LPALCGETSTRINGISOFT alcGetStringiSOFT = nullptr;
|
|
||||||
getALCFunc(alcGetStringiSOFT, mDevice, "alcGetStringiSOFT");
|
|
||||||
|
|
||||||
LPALCRESETDEVICESOFT alcResetDeviceSOFT = nullptr;
|
|
||||||
getALCFunc(alcResetDeviceSOFT, mDevice, "alcResetDeviceSOFT");
|
|
||||||
|
|
||||||
std::vector<ALCint> attrs;
|
|
||||||
attrs.reserve(15);
|
|
||||||
|
|
||||||
attrs.push_back(ALC_HRTF_SOFT);
|
|
||||||
attrs.push_back(hrtfmode == HrtfMode::Disable ? ALC_FALSE
|
|
||||||
: hrtfmode == HrtfMode::Enable ? ALC_TRUE
|
|
||||||
:
|
|
||||||
/*hrtfmode == HrtfMode::Auto ?*/ ALC_DONT_CARE_SOFT);
|
|
||||||
if (!hrtfname.empty())
|
|
||||||
{
|
|
||||||
ALCint index = -1;
|
|
||||||
ALCint num_hrtf;
|
|
||||||
alcGetIntegerv(mDevice, ALC_NUM_HRTF_SPECIFIERS_SOFT, 1, &num_hrtf);
|
|
||||||
for (ALCint i = 0; i < num_hrtf; ++i)
|
|
||||||
{
|
|
||||||
const ALCchar* entry = alcGetStringiSOFT(mDevice, ALC_HRTF_SPECIFIER_SOFT, i);
|
|
||||||
if (hrtfname == entry)
|
|
||||||
{
|
|
||||||
index = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (index < 0)
|
|
||||||
Log(Debug::Warning) << "Failed to find HRTF name \"" << hrtfname << "\", using default";
|
|
||||||
else
|
|
||||||
{
|
|
||||||
attrs.push_back(ALC_HRTF_ID_SOFT);
|
|
||||||
attrs.push_back(index);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
attrs.push_back(0);
|
|
||||||
alcResetDeviceSOFT(mDevice, attrs.data());
|
|
||||||
|
|
||||||
ALCint hrtf_state;
|
|
||||||
alcGetIntegerv(mDevice, ALC_HRTF_SOFT, 1, &hrtf_state);
|
|
||||||
if (!hrtf_state)
|
|
||||||
Log(Debug::Info) << "HRTF disabled";
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const ALCchar* hrtf = alcGetString(mDevice, ALC_HRTF_SPECIFIER_SOFT);
|
|
||||||
Log(Debug::Info) << "Enabled HRTF " << hrtf;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
std::pair<Sound_Handle, size_t> OpenAL_Output::loadSound(const std::string& fname)
|
std::pair<Sound_Handle, size_t> OpenAL_Output::loadSound(const std::string& fname)
|
||||||
{
|
{
|
||||||
getALError();
|
getALError();
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,6 @@ namespace MWSound
|
||||||
void deinit() override;
|
void deinit() override;
|
||||||
|
|
||||||
std::vector<std::string> enumerateHrtf() override;
|
std::vector<std::string> enumerateHrtf() override;
|
||||||
void setHrtf(const std::string& hrtfname, HrtfMode hrtfmode) override;
|
|
||||||
|
|
||||||
std::pair<Sound_Handle, size_t> loadSound(const std::string& fname) override;
|
std::pair<Sound_Handle, size_t> loadSound(const std::string& fname) override;
|
||||||
size_t unloadSound(Sound_Handle data) override;
|
size_t unloadSound(Sound_Handle data) override;
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,6 @@ namespace MWSound
|
||||||
virtual void deinit() = 0;
|
virtual void deinit() = 0;
|
||||||
|
|
||||||
virtual std::vector<std::string> enumerateHrtf() = 0;
|
virtual std::vector<std::string> enumerateHrtf() = 0;
|
||||||
virtual void setHrtf(const std::string& hrtfname, HrtfMode hrtfmode) = 0;
|
|
||||||
|
|
||||||
virtual std::pair<Sound_Handle, size_t> loadSound(const std::string& fname) = 0;
|
virtual std::pair<Sound_Handle, size_t> loadSound(const std::string& fname) = 0;
|
||||||
virtual size_t unloadSound(Sound_Handle data) = 0;
|
virtual size_t unloadSound(Sound_Handle data) = 0;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue