mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-11 22:54:34 +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
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
#include "alnumeric.h"
|
||||
#include "alspan.h"
|
||||
#include "alstring.h"
|
||||
#include "fmt/core.h"
|
||||
|
||||
#include "sofa-support.h"
|
||||
|
||||
|
|
@ -39,28 +39,29 @@
|
|||
|
||||
namespace {
|
||||
|
||||
using namespace std::string_view_literals;
|
||||
using uint = unsigned int;
|
||||
|
||||
void PrintSofaAttributes(const char *prefix, MYSOFA_ATTRIBUTE *attribute)
|
||||
void PrintSofaAttributes(const std::string_view prefix, MYSOFA_ATTRIBUTE *attribute)
|
||||
{
|
||||
while(attribute)
|
||||
{
|
||||
fprintf(stdout, "%s.%s: %s\n", prefix, attribute->name, attribute->value);
|
||||
fmt::println("{}.{}: {}", prefix, attribute->name, attribute->value);
|
||||
attribute = attribute->next;
|
||||
}
|
||||
}
|
||||
|
||||
void PrintSofaArray(const char *prefix, MYSOFA_ARRAY *array, bool showValues=true)
|
||||
void PrintSofaArray(const std::string_view prefix, MYSOFA_ARRAY *array, bool showValues=true)
|
||||
{
|
||||
PrintSofaAttributes(prefix, array->attributes);
|
||||
if(showValues)
|
||||
{
|
||||
const auto values = al::span{array->values, array->elements};
|
||||
for(size_t i{0u};i < values.size();++i)
|
||||
fprintf(stdout, "%s[%zu]: %.6f\n", prefix, i, values[i]);
|
||||
fmt::println("{}[{}]: {:.6f}", prefix, i, values[i]);
|
||||
}
|
||||
else
|
||||
fprintf(stdout, "%s[...]: <%u values suppressed>\n", prefix, array->elements);
|
||||
fmt::println("{}[...]: <{} values suppressed>", prefix, array->elements);
|
||||
}
|
||||
|
||||
/* Attempts to produce a compatible layout. Most data sets tend to be
|
||||
|
|
@ -71,12 +72,12 @@ void PrintSofaArray(const char *prefix, MYSOFA_ARRAY *array, bool showValues=tru
|
|||
*/
|
||||
void PrintCompatibleLayout(const al::span<const float> xyzs)
|
||||
{
|
||||
fputc('\n', stdout);
|
||||
fmt::println("");
|
||||
|
||||
auto fds = GetCompatibleLayout(xyzs);
|
||||
if(fds.empty())
|
||||
{
|
||||
fprintf(stdout, "No compatible field layouts in SOFA file.\n");
|
||||
fmt::println("No compatible field layouts in SOFA file.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -87,18 +88,18 @@ void PrintCompatibleLayout(const al::span<const float> xyzs)
|
|||
used_elems += fds[fi].mAzCounts[ei];
|
||||
}
|
||||
|
||||
fprintf(stdout, "Compatible Layout (%u of %zu measurements):\n\ndistance = %.3f", used_elems,
|
||||
fmt::print("Compatible Layout ({} of {} measurements):\n\ndistance = {:.3f}", used_elems,
|
||||
xyzs.size()/3, fds[0].mDistance);
|
||||
for(size_t fi{1u};fi < fds.size();fi++)
|
||||
fprintf(stdout, ", %.3f", fds[fi].mDistance);
|
||||
fmt::print(", {:.3f}", fds[fi].mDistance);
|
||||
|
||||
fprintf(stdout, "\nazimuths = ");
|
||||
fmt::print("\nazimuths = ");
|
||||
for(size_t fi{0u};fi < fds.size();++fi)
|
||||
{
|
||||
for(uint ei{0u};ei < fds[fi].mEvStart;++ei)
|
||||
fprintf(stdout, "%d%s", fds[fi].mAzCounts[fds[fi].mEvCount - 1 - ei], ", ");
|
||||
fmt::print("{}{}", fds[fi].mAzCounts[fds[fi].mEvCount - 1 - ei], ", ");
|
||||
for(uint ei{fds[fi].mEvStart};ei < fds[fi].mEvCount;++ei)
|
||||
fprintf(stdout, "%d%s", fds[fi].mAzCounts[ei],
|
||||
fmt::print("{}{}", fds[fi].mAzCounts[ei],
|
||||
(ei < (fds[fi].mEvCount - 1)) ? ", " :
|
||||
(fi < (fds.size() - 1)) ? ";\n " : "\n");
|
||||
}
|
||||
|
|
@ -111,7 +112,7 @@ void SofaInfo(const std::string &filename)
|
|||
MySofaHrtfPtr sofa{mysofa_load(filename.c_str(), &err)};
|
||||
if(!sofa)
|
||||
{
|
||||
fprintf(stdout, "Error: Could not load source file '%s' (%s).\n", filename.c_str(),
|
||||
fmt::println("Error: Could not load source file '{}' ({}).", filename,
|
||||
SofaErrorStr(err));
|
||||
return;
|
||||
}
|
||||
|
|
@ -119,21 +120,21 @@ void SofaInfo(const std::string &filename)
|
|||
/* NOTE: Some valid SOFA files are failing this check. */
|
||||
err = mysofa_check(sofa.get());
|
||||
if(err != MYSOFA_OK)
|
||||
fprintf(stdout, "Warning: Supposedly malformed source file '%s' (%s).\n", filename.c_str(),
|
||||
fmt::println("Warning: Supposedly malformed source file '{}' ({}).", filename,
|
||||
SofaErrorStr(err));
|
||||
|
||||
mysofa_tocartesian(sofa.get());
|
||||
|
||||
PrintSofaAttributes("Info", sofa->attributes);
|
||||
|
||||
fprintf(stdout, "Measurements: %u\n", sofa->M);
|
||||
fprintf(stdout, "Receivers: %u\n", sofa->R);
|
||||
fprintf(stdout, "Emitters: %u\n", sofa->E);
|
||||
fprintf(stdout, "Samples: %u\n", sofa->N);
|
||||
fmt::println("Measurements: {}", sofa->M);
|
||||
fmt::println("Receivers: {}", sofa->R);
|
||||
fmt::println("Emitters: {}", sofa->E);
|
||||
fmt::println("Samples: {}", sofa->N);
|
||||
|
||||
PrintSofaArray("SampleRate", &sofa->DataSamplingRate);
|
||||
PrintSofaArray("DataDelay", &sofa->DataDelay);
|
||||
PrintSofaArray("SourcePosition", &sofa->SourcePosition, false);
|
||||
PrintSofaArray("SampleRate"sv, &sofa->DataSamplingRate);
|
||||
PrintSofaArray("DataDelay"sv, &sofa->DataDelay);
|
||||
PrintSofaArray("SourcePosition"sv, &sofa->SourcePosition, false);
|
||||
|
||||
PrintCompatibleLayout(al::span{sofa->SourcePosition.values, sofa->M*3_uz});
|
||||
}
|
||||
|
|
@ -142,7 +143,7 @@ int main(al::span<std::string_view> args)
|
|||
{
|
||||
if(args.size() != 2)
|
||||
{
|
||||
fprintf(stdout, "Usage: %.*s <sofa-file>\n", al::sizei(args[0]), args[0].data());
|
||||
fmt::println("Usage: {} <sofa-file>", args[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue