16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 17:09:19 +02:00

build 171205. support for random sound sets, explicit range-driven sound attenuation

This commit is contained in:
tmj-fstate
2017-12-05 19:51:36 +01:00
parent 4f9464499c
commit 807eecd482
7 changed files with 135 additions and 79 deletions

View File

@@ -5163,7 +5163,7 @@ TTrain::update_sounds( double const Deltatime ) {
if( ( mvOccupied->BrakeHandle == FV4a )
|| ( mvOccupied->BrakeHandle == FVel6 ) ) {
// upuszczanie z PG
fPPress = interpolate<float>( fPPress, mvOccupied->Handle->GetSound( s_fv4a_b ), 0.05 );
fPPress = interpolate( fPPress, static_cast<float>( mvOccupied->Handle->GetSound( s_fv4a_b ) ), 0.05f );
volume = (
fPPress > 0 ?
rsHiss.m_amplitudefactor * fPPress * 0.25 :
@@ -5177,7 +5177,7 @@ TTrain::update_sounds( double const Deltatime ) {
rsHiss.stop();
}
// napelnianie PG
fNPress = interpolate<float>( fNPress, mvOccupied->Handle->GetSound( s_fv4a_u ), 0.25 );
fNPress = interpolate( fNPress, static_cast<float>( mvOccupied->Handle->GetSound( s_fv4a_u ) ), 0.25f );
volume = (
fNPress > 0 ?
rsHissU.m_amplitudefactor * fNPress :
@@ -5269,7 +5269,8 @@ TTrain::update_sounds( double const Deltatime ) {
}
// szum w czasie jazdy
if( DynamicObject->GetVelocity() > 0.5 ) {
if( ( false == FreeFlyModeFlag )
&& ( DynamicObject->GetVelocity() > 0.5 ) ) {
volume = rsRunningNoise.m_amplitudefactor * mvOccupied->Vel + rsRunningNoise.m_amplitudeoffset;
auto frequency { rsRunningNoise.m_frequencyfactor * mvOccupied->Vel + rsRunningNoise.m_frequencyoffset };