From 7bacf3b6f48aa5c46079c8019963f47a1e7cf9ab Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Thu, 29 Jul 2021 01:52:49 +0300 Subject: Reverse unused audio functions --- src/audio/AudioManager.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/audio/AudioManager.cpp') 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) -- cgit v1.2.3