summaryrefslogtreecommitdiffstats
path: root/src/audio/AudioManager.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-07-29 00:52:49 +0200
committerSergeanur <s.anureev@yandex.ua>2021-07-29 00:52:49 +0200
commit7bacf3b6f48aa5c46079c8019963f47a1e7cf9ab (patch)
tree40a032476478e7009e26fb85d78f7f27a15cca34 /src/audio/AudioManager.cpp
parentReverse unused audio functions from mobile (diff)
downloadre3-7bacf3b6f48aa5c46079c8019963f47a1e7cf9ab.tar
re3-7bacf3b6f48aa5c46079c8019963f47a1e7cf9ab.tar.gz
re3-7bacf3b6f48aa5c46079c8019963f47a1e7cf9ab.tar.bz2
re3-7bacf3b6f48aa5c46079c8019963f47a1e7cf9ab.tar.lz
re3-7bacf3b6f48aa5c46079c8019963f47a1e7cf9ab.tar.xz
re3-7bacf3b6f48aa5c46079c8019963f47a1e7cf9ab.tar.zst
re3-7bacf3b6f48aa5c46079c8019963f47a1e7cf9ab.zip
Diffstat (limited to 'src/audio/AudioManager.cpp')
-rw-r--r--src/audio/AudioManager.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp
index 75af289c..ad76b73a 100644
--- a/src/audio/AudioManager.cpp
+++ b/src/audio/AudioManager.cpp
@@ -264,9 +264,9 @@ cAudioManager::SetMusicFadeVol(uint8 volume)
}
void
-cAudioManager::SetMonoMode(bool8 mono)
+cAudioManager::SetOutputMode(bool8 surround)
{
- SampleManager.SetMonoMode(mono);
+ // on ps2 this calls another method of cAudioManager to set DTS mode on or off
}
void
@@ -530,11 +530,22 @@ cAudioManager::TranslateEntity(Const CVector *in, CVector *out)
*out = MultiplyInverse(TheCamera.GetMatrix(), *in);
}
+static uint8 PanTable[64] = { 0, 3, 8, 12, 16, 19, 22, 24, 26, 28, 30, 31, 33, 34, 36, 37, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 49, 50, 51, 52, 53, 53,
+ 54, 55, 55, 56, 56, 57, 57, 58, 58, 58, 59, 59, 59, 60, 60, 61, 61, 61, 61, 62, 62, 62, 62, 62, 63, 63, 63, 63, 63, 63, 63, 63};
+
+int32
+cAudioManager::ComputeFrontRearMix(float dist, CVector *vec)
+{
+ int32 index = Min(63, Abs(int32(vec->y / (dist / 64.f))));
+
+ if (vec->y > 0.f)
+ return Max(0, 63 - PanTable[index]);
+ return Min(127, PanTable[index] + 63);
+}
+
int32
cAudioManager::ComputePan(float dist, CVector *vec)
{
- const uint8 PanTable[64] = { 0, 3, 8, 12, 16, 19, 22, 24, 26, 28, 30, 31, 33, 34, 36, 37, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 49, 50, 51, 52, 53, 53,
- 54, 55, 55, 56, 56, 57, 57, 58, 58, 58, 59, 59, 59, 60, 60, 61, 61, 61, 61, 62, 62, 62, 62, 62, 63, 63, 63, 63, 63, 63, 63, 63};
int32 index = Min(63, Abs(int32(vec->x / (dist / 64.f))));
if (vec->x > 0.f)