summaryrefslogtreecommitdiffstats
path: root/src/audio/AudioLogic.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-07-29 09:16:51 +0200
committerSergeanur <s.anureev@yandex.ua>2021-08-12 10:39:34 +0200
commit6c2d179aadd9e54afc010c7f8b79d663017d168c (patch)
tree60190b4286698f4ff609d214fe9e423202891da2 /src/audio/AudioLogic.cpp
parentFix unset emitting volume for sawmill (diff)
downloadre3-6c2d179aadd9e54afc010c7f8b79d663017d168c.tar
re3-6c2d179aadd9e54afc010c7f8b79d663017d168c.tar.gz
re3-6c2d179aadd9e54afc010c7f8b79d663017d168c.tar.bz2
re3-6c2d179aadd9e54afc010c7f8b79d663017d168c.tar.lz
re3-6c2d179aadd9e54afc010c7f8b79d663017d168c.tar.xz
re3-6c2d179aadd9e54afc010c7f8b79d663017d168c.tar.zst
re3-6c2d179aadd9e54afc010c7f8b79d663017d168c.zip
Diffstat (limited to '')
-rw-r--r--src/audio/AudioLogic.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp
index d4d1ed96..e9ce7777 100644
--- a/src/audio/AudioLogic.cpp
+++ b/src/audio/AudioLogic.cpp
@@ -1329,6 +1329,9 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams& params, CAutomobile *
AddPlayerCarSample(vol, freq, (engineSoundType - CAR_SFX_BANKS_OFFSET + SFX_CAR_REV_1), SFX_BANK_0, 2, TRUE);
} else {
TranslateEntity(&m_sQueueSample.m_vecPos, &pos);
+#ifndef EXTERNAL_3D_SOUND
+ m_sQueueSample.m_nOffset = ComputePan(m_sQueueSample.m_fDistance, &pos);
+#endif
if (bAccelSampleStopped) {
if (CurrentPretendGear != 1 || currentGear != 2) {
gearNr = currentGear - 1;
@@ -1356,9 +1359,15 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams& params, CAutomobile *
SampleManager.SetChannelLoopPoints(CHANNEL_PLAYER_VEHICLE_ENGINE, 0, -1);
}
+#ifdef EXTERNAL_3D_SOUND
SampleManager.SetChannelEmittingVolume(CHANNEL_PLAYER_VEHICLE_ENGINE, 85);
SampleManager.SetChannel3DPosition(CHANNEL_PLAYER_VEHICLE_ENGINE, pos.x, pos.y, pos.z);
SampleManager.SetChannel3DDistances(CHANNEL_PLAYER_VEHICLE_ENGINE, 50.f, 12.5f);
+#else
+
+ SampleManager.SetChannelVolume(CHANNEL_PLAYER_VEHICLE_ENGINE, ComputeVolume(85, 50.0f, m_sQueueSample.m_fDistance));
+ SampleManager.SetChannelPan(CHANNEL_PLAYER_VEHICLE_ENGINE, m_sQueueSample.m_nOffset);
+#endif
freq = GearFreqAdj[CurrentPretendGear] + freqModifier + 22050;
if (engineSoundType == SFX_BANK_TRUCK)
freq /= 2;