summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-12-25 08:13:01 +0100
committerSergeanur <s.anureev@yandex.ua>2020-12-25 08:13:01 +0100
commit1cc8a1d2470e691a6214af5fa9759e9d6eb2f738 (patch)
tree7ecd04ca9c4e17312a7246f06a7c6285d31ba11f /src
parentSmall type use fixes (diff)
downloadre3-1cc8a1d2470e691a6214af5fa9759e9d6eb2f738.tar
re3-1cc8a1d2470e691a6214af5fa9759e9d6eb2f738.tar.gz
re3-1cc8a1d2470e691a6214af5fa9759e9d6eb2f738.tar.bz2
re3-1cc8a1d2470e691a6214af5fa9759e9d6eb2f738.tar.lz
re3-1cc8a1d2470e691a6214af5fa9759e9d6eb2f738.tar.xz
re3-1cc8a1d2470e691a6214af5fa9759e9d6eb2f738.tar.zst
re3-1cc8a1d2470e691a6214af5fa9759e9d6eb2f738.zip
Diffstat (limited to '')
-rw-r--r--src/audio/AudioLogic.cpp22
1 files changed, 3 insertions, 19 deletions
diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp
index 88f48db6..8180a97a 100644
--- a/src/audio/AudioLogic.cpp
+++ b/src/audio/AudioLogic.cpp
@@ -2002,27 +2002,11 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams& params, CVehicle* veh
}
} else {
nCruising = 1;
- params.m_pVehicle->bAudioChangingGear = true;
- bAccelSampleStopped = true;
- SampleManager.StopChannel(m_nActiveSamples);
- if (isMoped || accelerateState >= 150 && wheelsOnGround && brakeState <= 0 && !params.m_pVehicle->bIsHandbrakeOn
- && !lostTraction && currentGear >= params.m_pTransmission->nNumberOfGears - 1) {
- if (accelerateState >= 220 && params.m_fVelocityChange + 0.001f >= velocityChangeForAudio) {
- if (nCruising < 800)
- ++nCruising;
- } else if (nCruising > 3) {
- --nCruising;
- }
- freq = 27 * nCruising + freqModifier + 22050;
- if (engineSoundType == SFX_BANK_TRUCK)
- freq /= 2;
- AudioManager.AddPlayerCarSample(120, freq, soundOffset + SFX_CAR_AFTER_ACCEL_1, engineSoundType, 64, true);
- } else {
- nCruising = 0;
- }
+ goto PlayCruising;
}
}
} else {
+PlayCruising:
bAccelSampleStopped = true;
SampleManager.StopChannel(m_nActiveSamples);
if (isMoped || accelerateState >= 150 && wheelsOnGround && brakeState <= 0 && !params.m_pVehicle->bIsHandbrakeOn
@@ -2036,7 +2020,7 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams& params, CVehicle* veh
freq = 27 * nCruising + freqModifier + 22050;
if (engineSoundType == SFX_BANK_TRUCK)
freq /= 2;
- AudioManager.AddPlayerCarSample(120, freq, soundOffset + SFX_CAR_AFTER_ACCEL_1, engineSoundType, 64, true);
+ AddPlayerCarSample(120, freq, soundOffset + SFX_CAR_AFTER_ACCEL_1, engineSoundType, 64, true);
} else {
nCruising = 0;
}