diff options
author | Chris Robinson <[email protected]> | 2018-12-19 03:13:15 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-12-19 03:13:15 -0800 |
commit | b49e8985a47f384dfde0ddd04d97426e3c37f480 (patch) | |
tree | ab59376d106642348372d9f7a41621405a54211c /Alc/alc.cpp | |
parent | fbd47961d54fdc9fa14e9fe9310b578bfbc84e56 (diff) |
Don't hardcode the channel count from the device ambisonic order
Diffstat (limited to 'Alc/alc.cpp')
-rw-r--r-- | Alc/alc.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Alc/alc.cpp b/Alc/alc.cpp index 5de9bd49..5b6d3bb3 100644 --- a/Alc/alc.cpp +++ b/Alc/alc.cpp @@ -1185,7 +1185,7 @@ static void ProbeCaptureDeviceList(void) /************************************************ * Device format information ************************************************/ -const ALCchar *DevFmtTypeString(enum DevFmtType type) +const ALCchar *DevFmtTypeString(DevFmtType type) noexcept { switch(type) { @@ -1199,7 +1199,7 @@ const ALCchar *DevFmtTypeString(enum DevFmtType type) } return "(unknown type)"; } -const ALCchar *DevFmtChannelsString(enum DevFmtChannels chans) +const ALCchar *DevFmtChannelsString(DevFmtChannels chans) noexcept { switch(chans) { @@ -1215,7 +1215,7 @@ const ALCchar *DevFmtChannelsString(enum DevFmtChannels chans) return "(unknown channels)"; } -ALsizei BytesFromDevFmt(enum DevFmtType type) +ALsizei BytesFromDevFmt(DevFmtType type) noexcept { switch(type) { @@ -1229,7 +1229,7 @@ ALsizei BytesFromDevFmt(enum DevFmtType type) } return 0; } -ALsizei ChannelsFromDevFmt(enum DevFmtChannels chans, ALsizei ambiorder) +ALsizei ChannelsFromDevFmt(DevFmtChannels chans, ALsizei ambiorder) noexcept { switch(chans) { @@ -1240,9 +1240,7 @@ ALsizei ChannelsFromDevFmt(enum DevFmtChannels chans, ALsizei ambiorder) case DevFmtX51Rear: return 6; case DevFmtX61: return 7; case DevFmtX71: return 8; - case DevFmtAmbi3D: return (ambiorder >= 3) ? 16 : - (ambiorder == 2) ? 9 : - (ambiorder == 1) ? 4 : 1; + case DevFmtAmbi3D: return (ambiorder+1) * (ambiorder+1); } return 0; } |