aboutsummaryrefslogtreecommitdiffstats
path: root/al/buffer.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-04-03 10:36:06 -0700
committerChris Robinson <[email protected]>2023-04-03 10:36:06 -0700
commit2c82778f93a2104632702b04bf6f1c6a15c53612 (patch)
treee465131c5beecc8b4b549fefa398df89e12d2c24 /al/buffer.cpp
parentcce910d0b4f177fb7f863da01e663c9bd30bed0e (diff)
Remove a duplicate function
Diffstat (limited to 'al/buffer.cpp')
-rw-r--r--al/buffer.cpp22
1 files changed, 3 insertions, 19 deletions
diff --git a/al/buffer.cpp b/al/buffer.cpp
index 3e7f8175..ee506596 100644
--- a/al/buffer.cpp
+++ b/al/buffer.cpp
@@ -275,22 +275,6 @@ ALuint SanitizeAlignment(FmtType type, ALuint align)
}
-const ALchar *NameFromFmtType(FmtType type)
-{
- switch(type)
- {
- case FmtUByte: return "UInt8";
- case FmtShort: return "Int16";
- case FmtFloat: return "Float32";
- case FmtDouble: return "Float64";
- case FmtMulaw: return "muLaw";
- case FmtAlaw: return "aLaw";
- case FmtIMA4: return "IMA4 ADPCM";
- case FmtMSADPCM: return "MSADPCM";
- }
- return "<internal type error>";
-}
-
/** Loads the specified data into the buffer, using the specified format. */
void LoadData(ALCcontext *context, ALbuffer *ALBuf, ALsizei freq, ALuint size,
const FmtChannels DstChannels, const FmtType DstType, const al::byte *SrcData,
@@ -304,7 +288,7 @@ void LoadData(ALCcontext *context, ALbuffer *ALBuf, ALsizei freq, ALuint size,
const ALuint align{SanitizeAlignment(DstType, unpackalign)};
if(align < 1) UNLIKELY
return context->setError(AL_INVALID_VALUE, "Invalid unpack alignment %u for %s samples",
- unpackalign, NameFromFmtType(DstType));
+ unpackalign, NameFromFormat(DstType));
const ALuint ambiorder{IsBFormat(DstChannels) ? ALBuf->UnpackAmbiOrder :
(IsUHJ(DstChannels) ? 1 : 0)};
@@ -463,7 +447,7 @@ void PrepareUserPtr(ALCcontext *context, ALbuffer *ALBuf, ALsizei freq,
const ALuint align{SanitizeAlignment(DstType, unpackalign)};
if(align < 1) UNLIKELY
return context->setError(AL_INVALID_VALUE, "Invalid unpack alignment %u for %s samples",
- unpackalign, NameFromFmtType(DstType));
+ unpackalign, NameFromFormat(DstType));
auto get_type_alignment = [](const FmtType type) noexcept -> ALuint
{
@@ -486,7 +470,7 @@ void PrepareUserPtr(ALCcontext *context, ALbuffer *ALBuf, ALsizei freq,
const auto typealign = get_type_alignment(DstType);
if((reinterpret_cast<uintptr_t>(sdata) & (typealign-1)) != 0)
return context->setError(AL_INVALID_VALUE, "Pointer %p is misaligned for %s samples (%u)",
- static_cast<void*>(sdata), NameFromFmtType(DstType), typealign);
+ static_cast<void*>(sdata), NameFromFormat(DstType), typealign);
const ALuint ambiorder{IsBFormat(DstChannels) ? ALBuf->UnpackAmbiOrder :
(IsUHJ(DstChannels) ? 1 : 0)};