aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--al/buffer.cpp1
-rw-r--r--alc/effects/convolution.cpp1
-rw-r--r--core/buffer_storage.cpp2
-rw-r--r--core/buffer_storage.h1
-rw-r--r--core/fmt_traits.h8
-rw-r--r--core/voice.cpp1
6 files changed, 14 insertions, 0 deletions
diff --git a/al/buffer.cpp b/al/buffer.cpp
index 8ba874e4..82068b62 100644
--- a/al/buffer.cpp
+++ b/al/buffer.cpp
@@ -464,6 +464,7 @@ void PrepareUserPtr(ALCcontext *context, ALbuffer *ALBuf, ALsizei freq,
{
case FmtUByte: return alignof(ALubyte);
case FmtShort: return alignof(ALshort);
+ case FmtInt: return alignof(ALint);
case FmtFloat: return alignof(ALfloat);
case FmtDouble: return alignof(ALdouble);
case FmtMulaw: return alignof(ALubyte);
diff --git a/alc/effects/convolution.cpp b/alc/effects/convolution.cpp
index 5c0b2677..517e6b08 100644
--- a/alc/effects/convolution.cpp
+++ b/alc/effects/convolution.cpp
@@ -84,6 +84,7 @@ void LoadSamples(float *RESTRICT dst, const std::byte *src, const size_t srcstep
{
HANDLE_FMT(FmtUByte);
HANDLE_FMT(FmtShort);
+ HANDLE_FMT(FmtInt);
HANDLE_FMT(FmtFloat);
HANDLE_FMT(FmtDouble);
HANDLE_FMT(FmtMulaw);
diff --git a/core/buffer_storage.cpp b/core/buffer_storage.cpp
index 98ca2c1b..6ffab124 100644
--- a/core/buffer_storage.cpp
+++ b/core/buffer_storage.cpp
@@ -12,6 +12,7 @@ const char *NameFromFormat(FmtType type) noexcept
{
case FmtUByte: return "UInt8";
case FmtShort: return "Int16";
+ case FmtInt: return "Int32";
case FmtFloat: return "Float";
case FmtDouble: return "Double";
case FmtMulaw: return "muLaw";
@@ -49,6 +50,7 @@ uint BytesFromFmt(FmtType type) noexcept
{
case FmtUByte: return sizeof(uint8_t);
case FmtShort: return sizeof(int16_t);
+ case FmtInt: return sizeof(int32_t);
case FmtFloat: return sizeof(float);
case FmtDouble: return sizeof(double);
case FmtMulaw: return sizeof(uint8_t);
diff --git a/core/buffer_storage.h b/core/buffer_storage.h
index d8ab0b67..3b581b5e 100644
--- a/core/buffer_storage.h
+++ b/core/buffer_storage.h
@@ -15,6 +15,7 @@ using uint = unsigned int;
enum FmtType : unsigned char {
FmtUByte,
FmtShort,
+ FmtInt,
FmtFloat,
FmtDouble,
FmtMulaw,
diff --git a/core/fmt_traits.h b/core/fmt_traits.h
index 1879c81b..02473014 100644
--- a/core/fmt_traits.h
+++ b/core/fmt_traits.h
@@ -31,6 +31,14 @@ struct FmtTypeTraits<FmtShort> {
static constexpr OutT to(const Type val) noexcept { return val*OutT{1.0/32768.0}; }
};
template<>
+struct FmtTypeTraits<FmtInt> {
+ using Type = int32_t;
+
+ template<typename OutT>
+ static constexpr OutT to(const Type val) noexcept
+ { return static_cast<OutT>(val)*OutT{1.0/2147483648.0}; }
+};
+template<>
struct FmtTypeTraits<FmtFloat> {
using Type = float;
diff --git a/core/voice.cpp b/core/voice.cpp
index b8acc7a6..3889c42d 100644
--- a/core/voice.cpp
+++ b/core/voice.cpp
@@ -474,6 +474,7 @@ void LoadSamples(float *dstSamples, const std::byte *src, const size_t srcChan,
{
HANDLE_FMT(FmtUByte);
HANDLE_FMT(FmtShort);
+ HANDLE_FMT(FmtInt);
HANDLE_FMT(FmtFloat);
HANDLE_FMT(FmtDouble);
HANDLE_FMT(FmtMulaw);