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

Merge remote-tracking branch 'youby/master' into sim

This commit is contained in:
milek7
2022-01-14 16:39:20 +01:00
4 changed files with 38 additions and 14 deletions

View File

@@ -7522,7 +7522,7 @@ TTrain::update_sounds( double const Deltatime ) {
fPPress = interpolate( fPPress, static_cast<float>( mvOccupied->Handle->GetSound( s_fv4a_b ) ), 0.05f );
volume = (
fPPress > 0 ?
rsHiss->m_amplitudefactor * fPPress * 0.25 :
rsHiss->m_amplitudefactor * fPPress * 0.25 + rsHiss->m_amplitudeoffset :
0 );
if( volume * brakevolumescale > 0.05 ) {
rsHiss->gain( volume * brakevolumescale );
@@ -7537,7 +7537,7 @@ TTrain::update_sounds( double const Deltatime ) {
fNPress = interpolate( fNPress, static_cast<float>( mvOccupied->Handle->GetSound( s_fv4a_u ) ), 0.25f );
volume = (
fNPress > 0 ?
rsHissU->m_amplitudefactor * fNPress :
rsHissU->m_amplitudefactor * fNPress + rsHissU->m_amplitudeoffset :
0 );
if( volume * brakevolumescale > 0.05 ) {
rsHissU->gain( volume * brakevolumescale );
@@ -7549,7 +7549,7 @@ TTrain::update_sounds( double const Deltatime ) {
}
// upuszczanie przy naglym
if( rsHissE ) {
volume = mvOccupied->Handle->GetSound( s_fv4a_e ) * rsHissE->m_amplitudefactor;
volume = mvOccupied->Handle->GetSound( s_fv4a_e ) * rsHissE->m_amplitudefactor + rsHissE->m_amplitudeoffset;
if( volume * brakevolumescale > 0.05 ) {
rsHissE->gain( volume * brakevolumescale );
rsHissE->play( sound_flags::exclusive | sound_flags::looping );
@@ -7560,7 +7560,7 @@ TTrain::update_sounds( double const Deltatime ) {
}
// upuszczanie sterujacego fala
if( rsHissX ) {
volume = mvOccupied->Handle->GetSound( s_fv4a_x ) * rsHissX->m_amplitudefactor;
volume = mvOccupied->Handle->GetSound( s_fv4a_x ) * rsHissX->m_amplitudefactor + rsHissX->m_amplitudeoffset;
if( volume * brakevolumescale > 0.05 ) {
rsHissX->gain( volume * brakevolumescale );
rsHissX->play( sound_flags::exclusive | sound_flags::looping );
@@ -7571,7 +7571,7 @@ TTrain::update_sounds( double const Deltatime ) {
}
// upuszczanie z czasowego
if( rsHissT ) {
volume = mvOccupied->Handle->GetSound( s_fv4a_t ) * rsHissT->m_amplitudefactor;
volume = mvOccupied->Handle->GetSound( s_fv4a_t ) * rsHissT->m_amplitudefactor + +rsHissT->m_amplitudeoffset;
if( volume * brakevolumescale > 0.05 ) {
rsHissT->gain( volume * brakevolumescale );
rsHissT->play( sound_flags::exclusive | sound_flags::looping );
@@ -7588,7 +7588,7 @@ TTrain::update_sounds( double const Deltatime ) {
fPPress = ( 4.0f * fPPress + std::max( 0.0, mvOccupied->dpMainValve ) ) / ( 4.0f + 1.0f );
volume = (
fPPress > 0.0f ?
2.0 * rsHiss->m_amplitudefactor * fPPress :
2.0 * rsHiss->m_amplitudefactor * fPPress + rsHiss->m_amplitudeoffset :
0.0 );
if( volume > 0.05 ) {
rsHiss->gain( volume );
@@ -7603,7 +7603,7 @@ TTrain::update_sounds( double const Deltatime ) {
fNPress = ( 4.0f * fNPress + Min0R( 0.0, mvOccupied->dpMainValve ) ) / ( 4.0f + 1.0f );
volume = (
fNPress < 0.0f ?
-1.0 * rsHissU->m_amplitudefactor * fNPress :
-1.0 * rsHissU->m_amplitudefactor * fNPress + rsHissU->m_amplitudeoffset :
0.0 );
if( volume > 0.01 ) {
rsHissU->gain( volume );