Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Fix car fake/cruise top gear SFX at high FPS.
Re-implements 2d3f93e
  • Loading branch information
Veyrdite committed Aug 1, 2021
1 parent 165867d commit 5d19085dfe330602d6d66573b5ca619ccb210a56
Showing with 11 additions and 5 deletions.
  1. +11 −5 src/audio/AudioLogic.cpp
@@ -2347,11 +2347,17 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams& params, CVehicle* veh
SampleManager.StopChannel(CHANNEL_PLAYER_VEHICLE_ENGINE);
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;
#ifdef FIX_BUGS
// Prevent the fake top gear ("cruise gear") rising in pitch too quickly at high FPS.
if (CTimer::GetLogicalFramesPassed())
#endif
{
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)

0 comments on commit 5d19085

Please sign in to comment.