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

build 200615. brake release sound tweak, low detail interior vehicle screens support

This commit is contained in:
tmj-fstate
2020-06-15 12:51:27 +02:00
parent 8bb5554b20
commit 765cdd58ad
3 changed files with 17 additions and 5 deletions

View File

@@ -4122,19 +4122,19 @@ void TDynamicObject::RenderSounds() {
if( m_lastbrakepressure != -1.f ) {
// calculate rate of pressure drop in brake cylinder, once it's been initialized
auto const brakepressuredifference{ m_lastbrakepressure - MoverParameters->BrakePress };
m_brakepressurechange = interpolate<float>( m_brakepressurechange, brakepressuredifference / dt, 0.005f );
m_brakepressurechange = interpolate<float>( m_brakepressurechange, brakepressuredifference / dt, 0.05f );
}
m_lastbrakepressure = MoverParameters->BrakePress;
// ensure some basic level of volume and scale it up depending on pressure in the cylinder; scale this by the air release rate
volume = 20 * m_brakepressurechange * ( 0.25 + 0.75 * brakepressureratio );
if( volume > 0.075f ) {
if( ( m_brakepressurechange > 0.05 ) && ( brakepressureratio > 0.05 ) ) {
rsUnbrake
.gain( volume )
.play( sound_flags::exclusive | sound_flags::looping );
}
else {
// don't stop the sound too abruptly
volume = std::max( 0.0, rsUnbrake.gain() - 0.2 * dt );
volume = std::max( 0.0, rsUnbrake.gain() - 0.5 * dt );
rsUnbrake.gain( volume );
if( volume < 0.05 ) {
rsUnbrake.stop();
@@ -5011,6 +5011,9 @@ void TDynamicObject::LoadMMediaFile( std::string const &TypeName, std::string co
if( pants[ i ].smElement[ 2 ] ) {
pants[ i ].smElement[ 2 ]->WillBeAnimated();
}
else {
ErrorLog( "Bad model: " + asFileName + " - missed submodel " + asAnimName, logtype::model ); // brak ramienia
}
}
}
}
@@ -5026,6 +5029,9 @@ void TDynamicObject::LoadMMediaFile( std::string const &TypeName, std::string co
if( pants[ i ].smElement[ 3 ] ) {
pants[ i ].smElement[ 3 ]->WillBeAnimated();
}
else {
ErrorLog( "Bad model: " + asFileName + " - missed submodel " + asAnimName, logtype::model ); // brak ramienia
}
}
}
}
@@ -5044,6 +5050,9 @@ void TDynamicObject::LoadMMediaFile( std::string const &TypeName, std::string co
pants[ i ].fMaxDist = 300 * 300; // nie podnosić w większej odległości
pants[ i ].iNumber = i;
}
else {
ErrorLog( "Bad model: " + asFileName + " - missed submodel " + asAnimName, logtype::model ); // brak ramienia
}
}
}
}